Correction to Formatting Media For Use With FreeBSD Sec 4.2
Albert Kinderman
albert.kinderman at csun.edu
Sat Sep 13 18:22:23 UTC 2003
[I cannot send mail from my FreeBSD box, so send-pr is not available.
The web interface for pr's is not available, so I am writing directly to
the list]
Here is the current section 4.2 of Formatting Media For Use With FreeBSD
[begin quote]
4.2 Copying the Contents of Disks
Submitted By: Renaud Waldura (<renaud at softway.com>)
To move file[s] from your original base disk to the fresh new one, do:
# mount /dev/ad2 /mnt
# pax -r -w -p e /usr/home /mnt
# umount /mnt
# rm -rf /usr/home/*
# mount /dev/ad2 /usr/home
[end quote]
The problem with this is that pax copies the directory structure of
/usr/home to /mnt (an ls of /mnt after pax shows usr, of /mnt/usr shows
home).Thus, once /usr/home is mounted on /dev/ad2, the contents of
/usr/home will be /usr/home, i.e., the files you want are in
/usr/home/usr/home. The correct method replaces line two with
#cd /usr/home
#pax -r -w -p e * /mnt
#cd /
This copies the directories and files from /usr/home to /mnt, but not
the complete /usr/home directory structure.
CAVEAT: I did not do this on a whole disk. I added a new disk, sliced
it, and partitioned the slice, so that I was mounting just a partition
within a slice, e.g., /dev/ad1s1e. I used the listed method on /usr,
and only later discovered that all the files from /usr were now in
/usr/usr. (I changed /etc/fstab to mount the new slice on /usr, and my
reboot couldn't go into multiuser mode when all the files supposed to be
in /usr were not found.) After fixing /usr, I did a test by creating
/usr/fred and following the original instructions. The result was that
all my files were in /usr/fred/usr/fred.
Al
More information about the freebsd-doc
mailing list