Moving an OpenBSD filesystem

From Wiki

Jump to: navigation, search
  • Make a new filesystem:
# fdisk -i /dev/wd<n>
# disklabel -f /tmp/dl -E wd<n>
# newfs /dev/rwd<n><n>
  • Mount it somewhere:
# mount /dev/wd<n><n> /mnt
  • cd to the mount point and copy the old partition to the new one:
# cd /mnt
# dump 0af - /usr | restore rf -
  DUMP: Date of this level 0 dump: Wed Dec  9 09:33:53 2009
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rwd0d (/usr) to standard output
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 1470754 tape blocks.
  DUMP: Volume 1 started at: Wed Dec  9 09:33:54 2009
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: 51.13% done, finished in 0:04
  DUMP: 1500182 tape blocks
  DUMP: Date of this level 0 dump: Wed Dec  9 09:33:53 2009
  DUMP: Volume 1 completed at: Wed Dec  9 09:43:32 2009
  DUMP: Volume 1 took 0:09:38
  DUMP: Volume 1 transfer rate: 2595 KB/s
  DUMP: Date this dump completed:  Wed Dec  9 09:43:32 2009
  DUMP: Average transfer rate: 2595 KB/s
  DUMP: DUMP IS DONE
  • Update /etc/fstab with the new location of the partition and reboot just to be safe.
Personal tools