Date: Tue, 11 Aug 2009 17:52:29 +0200 From: Polytropon <freebsd@edvax.de> To: PJ <af.gourmet@videotron.ca> Cc: Bill Moran <wmoran@potentialtech.com>, freebsd-questions@freebsd.org Subject: Re: boot sector f*ed Message-ID: <20090811175229.8c3eb361.freebsd@edvax.de> In-Reply-To: <4A817355.20006@videotron.ca> References: <4A816EC9.7070408@videotron.ca> <20090811092214.e38fd90c.wmoran@potentialtech.com> <4A817355.20006@videotron.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 11 Aug 2009 09:34:13 -0400, PJ <af.gourmet@videotron.ca> 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, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090811175229.8c3eb361.freebsd>