wiki:FreeBSD ZFS Backup & Restore Full Instructions

Version 4 (modified by Paul Kulda, 4 months ago) ( diff )

--

FreeBSD ZFS Backup & Restore Full Instructions

Ok in my search for a way to shrink a zfs partition (which you can not do) I found a bunch of articles on the FreeBSD website.

I appreciate all the information on "how to" backup a zfs volume and the restore it on another drive fully in tact.

Issue is the restore part was way more complicated trying to use the "LiveCD"

That being said here is how you do it.

  • You can backup to a network share or a portable usb drive
    • Drive or network share must be the same size or larger of the size of data.
    • Example if you are backing up a 2TB system you will need an external 2TB drive
    • Or 2TB avaliable on the nfs network share
  • Next you need to consider the following before proceeding.
    • FreeBSD Live CD does not allow mounting of zfs pools etc (which you dont want anyways for a restore)
    • It also does not allow mounting of ntfs (windows) file system
      • best suggetion is to format an external usb drive using newfs
      • or backup to a network nfs share (also supported on the LiveCD
  • From here is where the fun begins :
    • to backup the zfs volume do the following,
    • zfs snapshot zroot/ROOT/default@backup
    • then to do the actual backup
    • zfs send zroot/ROOT/default@backup > backup.zfs
    • please Do Not zip the file
    • you can for archiving purposes, but you need the raw file to restore.
    • Next you need to make note of the ZFS pools that you have
      • FreeBSD for some reason makes extra mount points on a default install
      • I took the time to sort that out and stripped my backup down to the root only. *
  • Once logged into the LiveCD you WILL need to zfspool import zroot
  • It will not mount but it loads the drivers needed to access the volume
Note: See TracWiki for help on using the wiki.