UFS: Maintenance

Table of Contents

Using dump(8)
Using restore(8)
Recreate the system/move system to another drive

Recreate the system/move system to another drive

by ross at 08:44:10 on November 18, 2012

If you are going to restore remote dumps don't forget to create these dumps as shown on previous pages.

Boot from FreeBSD installation media

  • Choose "Shell"

Increase size of memory-based /tmp file system (needed by restore program):

mount | grep tmp
/dev/md1 on /tmp (ufs, local)
# umount /tmp
# mdsfs -s 512M md1 /tmp

Create filesystems on target drive

Follow this article to delete/create new filesystems, install bootcode and mount the filesystems under /mnt, i.e. new root (/) on /mnt, new /var on /mnt/var and so on.

Restore remotely stored dumps

Bring the network interface up:

# ifconfig rl0 up 192.168.10.10/24 media 100baseTX mediaopt full-duplex

I manually set media here because the computers are connected using cross-over cable and media isn't autodetected correctly. You probably want to leave it to autodetect (no media or mediaopt parameters) if your hosts are connected via a switch.

# cd /mnt
# ssh [email protected] zcat /home/backup/coffin/root.2008-08-15.dump.gz \
  | restore -rvf -
# rm restoresymtable

# cd /mnt/var
# ssh [email protected] zcat /home/backup/coffin/var.2008-08-15.dump.gz \
  | restore -rvf -
# rm restoresymtable

# cd /mnt/usr
# ssh [email protected] zcat /home/backup/coffin/usr.2008-08-15.dump.gz \
  | restore -rvf -
# rm restoresymtable

# cd /mnt/usr/home
# ssh [email protected] zcat /home/backup/coffin/usr-home.2008-08-15.dump.gz \
  | restore -rvf -
# rm restoresymtable

Edit /mnt/etc/fstab to meet new layout.

Or: move system to another drive

No need for network, using camcontrol devlist find out the name of original drive and (assuming that the old drive is ada0 and new drive partitions are created and mounted under /mnt):

# cd /mnt
# dump -0af - /dev/ada0s1a | restore -rvf -
# rm restoresymtable

# cd /mnt/var
# dump -0af - /dev/ada0s1d | restore -rvf -
# rm restoresymtable

# cd /mnt/usr
# dump -0af - /dev/ada0s1e | restore -rvf -
# rm restoresymtable

# cd /mnt/usr/home
# dump -0af - /dev/ada0s1f | restore -rvf -
# rm restoresymtable

Edit /mnt/etc/fstab to meet new layout.

Comments