new bootable drive

David Kelly dkelly at HiWAAY.net
Thu Jul 10 15:49:56 PDT 2003


On Thursday 10 July 2003 01:11 pm, Casey Scott wrote:
> I need to replace the drive that my fbsd boots from. I have read the
> documentation on how to format, and copy files to a drive.  e.g.:
>
> To move file from your original base disk to the fresh new one, do:
>
> # mount /dev/ad2 /mnt
> # pax -r -w -p e / /mnt
> # umount /mnt
> # mount /dev/ad2 /
>
> I am not sure if that procedure will copy the necessary bootstrap
> data to the new disk. I do not want to use a ghosting utility because
> I need a new partition scheme on the new drive. Will the procedure
> above copy EVERYTHING from / to the new /  making it a replacement
> for the bootable disk?  If not, what is the best procedure for that?

No, the above will not create the boot block(s), nor partition the disk. 
Easiest way to do that is to fire up /stand/sysinstall, bypass the 
install stuff and go directly to the disk partition actions. Invoke the 
"write" function before leaving each of the partitioner and disk 
labeler. Use the standard FreeBSD boot manager and let it write the 
MBR.

The above pax command "works" but does not preserve file flags. "-p e" 
preserves mode bits and timestamps, but I'm not so sure about the flags 
which chflags(8) would manipulate. I believe dump(8) piped into 
restore(8) would. Something like this:

# dump 0af - / | ( cd /mnt; restore rf - )

Repeat above for each filesystem.

-- 
David Kelly N4HHE, dkelly at hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.


More information about the freebsd-questions mailing list