From owner-freebsd-questions@FreeBSD.ORG Tue Aug 11 16:09:40 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54EEA106564A for ; Tue, 11 Aug 2009 16:09:40 +0000 (UTC) (envelope-from kraduk@googlemail.com) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id B84028FC43 for ; Tue, 11 Aug 2009 16:09:39 +0000 (UTC) Received: by fxm24 with SMTP id 24so4199007fxm.36 for ; Tue, 11 Aug 2009 09:09:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=kYwi7OrqciQl/HicmnqKF9L/ppJjHJm2GOIMzJHtbvk=; b=KO/Unhb8NvuE2hwxoI1FjkIVgLqAkN/4UN/19Q+pR79kzSOX9TKWDFwHpr6Th0Rrje V+88X0OqgXJ9ux6F74YSLILSCVUrBiqTV/9HgyjxHcLdOE9D1IcLZaaUhznm7WmbMK46 ojkwufSSi0M0hRDwPk/+IU4wVaETN5Kn+TjK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=h1nDVggZvmzzXnLzJ8e/aGif2kimzTH4Icrrl9cQCDzhFjn/ARrkkfszhClezDn1Fn 0ffvuRhD8d5w0XR511l4jU7tehZ7iyX/5wKvqmO3K4QnqIsMPDumBz1fC31oBsrtvKed ksV+3FHn7Jf1TiWCVdbprTgquvlUcy9kZzGEg= MIME-Version: 1.0 Received: by 10.103.171.20 with SMTP id y20mr2491307muo.100.1250006978619; Tue, 11 Aug 2009 09:09:38 -0700 (PDT) In-Reply-To: <20090811175229.8c3eb361.freebsd@edvax.de> References: <4A816EC9.7070408@videotron.ca> <20090811092214.e38fd90c.wmoran@potentialtech.com> <4A817355.20006@videotron.ca> <20090811175229.8c3eb361.freebsd@edvax.de> Date: Tue, 11 Aug 2009 17:09:38 +0100 Message-ID: From: chris scott To: Polytropon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: PJ , Bill Moran , freebsd-questions@freebsd.org Subject: Re: boot sector f*ed X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2009 16:09:40 -0000 2009/8/11 Polytropon > On Tue, 11 Aug 2009 09:34:13 -0400, PJ wrote: > > I've got another disk about the same size on the machine and I'm > > wonderiing how could I transfer the whole shebang to it? > > Maybe an 1:1 copy using dd with a bs=1m would work. > > > > > Would doing a minimum 7.2 install be enough, followed by copying all the > > slices to the corresponding slices on the new disk? > > I'm thinking of mounting the broken drive on the new one and then > > copying... does that sound about right? > > No. Does not. :-) > > The proper way of doing this - or at least ONE of the proper ways - > is to use the intended tools for this task. These are dump and > restore. > > First of all, you use a FreeBSD live system (such as FreeSBIE) or > the livefs CD of the FreeBSD OS to run the OS. The goal is: Most > minimal interaction with the drives. > > Let's assume ad0 is your source disk and ad1 the target disk. > > You can use the sysinstall tool to slice and partition the target > disk. You can create the same layout as on the source disk. Of > course, using tools like bsdlabel and newfs is valid, too. If > you're done, things go like this: > > 1. Check the source. > > # fsck /dev/ad0s1a /dev/ad0s1e /dev/ad0s1f /dev/ad0s1g /dev/ad0s1h > > Add -f (and dangerous -y) if intended. > > > > 2. You don't mount the source disk. Instead, you first prepare > the target disk which you mount. Then you use dump and restore > to transfer the data from the unmounted source partition to > the mounted target partition. > > # mount /dev/ad1s1a /mnt > # cd /mnt > # dump -0 -f - /dev/ad0s1a | restore -r -f - > > Keep an eye on where you mount it. Maybe the live system you > use already employs /mnt for its own purposes. Create /target > instead, or anything else you like. > > > > 3. After transferting /, continue with /tmp /var /usr and /home. > > # mount /dev/ad1s1a /mnt > # cd /mnt > # dump -0 -f - /dev/ad0s1a | restore -r -f - > > # mount /dev/ad1s1e /mnt/tmp > # cd /mnt/tmp > # dump -0 -f - /dev/ad0s1e | restore -r -f - > > # mount /dev/ad1s1f /mnt/var > # cd /mnt/var > # dump -0 -f - /dev/ad0s1f | restore -r -f - > > # mount /dev/ad1s1g /mnt/usr > # cd /mnt/usr > # dump -0 -f - /dev/ad0s1g | restore -r -f - > > # mount /dev/ad1s1h /mnt/home > # cd /mnt/home > # dump -0 -f - /dev/ad0s1h | restore -r -f - > > Of course, triplepluscheck the commands before running them! > > > > 4. Unmount the target disks. > > # cd / > # umount /mnt/home > # umount /mnt/usr > # umount /mnt/var > # umount /mnt/tmp > # umount /mnt > # sync > # halt > > Replace the disks and start using your target. > > > > > I haven't looked at the broken one yet; I'll have to see what theat > > 177mg dump was.. > > Kernel image? > > > -- > Polytropon > >From Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" > Dumping is all very well and good. However if you want daily or hourly backups etc it is very costly. Thats why our in house system at work is based around rsync and zfs Basically we rsync the file to the x4500 with ~ 36 TB and then snapshot the backup. You then have incremental forever. On large systems that dont have much % change of content the benefits are huge