Hi
I have just installed Freebsd on my old Macmini and want to transfer zfs datasets from a usb drive to the macmini
I just need to copy across some data and set up a few config files to get macmini set up,
so i can finally ditch osx and go full freebsd on all my machines
Is it possible to do a zfs send recv from the datasets on the usb drive to the datasets on the macmini
Note from future self to past self:
You can send zfs datasets from a usb drive to datasets on another computer using send recv
I had to set the altroot when i imported the zfs pool
then use zfs send recv to send the snapshots
after sending the snapshots i set the mount point
and finally mount the datasets
job done
First question:
When i import the zpool on the new machine the datasets for my home are mounted in my home directory,
so the zfs dataset for my Desktop is mounted over the current Desktop if that makes sense
What i want to do is mount the zbackup pool to /mnt/usb,
which is a mount point i have created
The zbackup pool has its zfs mount point set to /mnt/usb, like so
I guess i need to set the altroot to /mnt/usb or something on macmini
Second question:
Is it possible to do a zfs send recv of the datasets from the the usb drive to the datasets on the macmini
something like this
Or should i try and mount the zpool to /mnt/usb and then use rsync or cp -Rpv,
to copy the data from the usb to the zfs datasets i have created on the macmini
On the macmini i have created all the zfs datasets
and mount points
after i transfer the data i would set the zfs mount points and then mount them
Heres how i created the zfs datasets on the external usb drive
list the disks
switch to root
wipe the drive which is /dev/da0
use gpart to create a gpt partition on the drive and add a label
create the mount point on my macbook air
create a new zpool and give it the same name as the gpt label to make things easy to remember set the mount point and use chown to change the owner of the mount point, replacing username:username with your username
create zfs pool on the external drive
list zfs directory structure
create the snapshot
send the snapshots to the corresponding pool on the drive use the -R option to create the datasets on the external drive
take a new snapshot to send the incremental snapshot
send incremental snapshots use the -R option on the zroot pool to send incremental snapshots of the descendant file system
export the zfs backup before removing the drive
I have just installed Freebsd on my old Macmini and want to transfer zfs datasets from a usb drive to the macmini
I just need to copy across some data and set up a few config files to get macmini set up,
so i can finally ditch osx and go full freebsd on all my machines
Is it possible to do a zfs send recv from the datasets on the usb drive to the datasets on the macmini
Note from future self to past self:
You can send zfs datasets from a usb drive to datasets on another computer using send recv
I had to set the altroot when i imported the zfs pool
Bash:
# zpool import -o altroot=/mnt/usb zbackup
then use zfs send recv to send the snapshots
Bash:
# zfs send -Rv zbackup/zroot/data/desktop@freebsd-12.1 | zfs recv -F zroot/data/desktop
after sending the snapshots i set the mount point
Bash:
# zfs set mountpoint=/usr/home/djwilcox/Desktop zroot/data/desktop
and finally mount the datasets
Bash:
# zfs mount -a
job done
First question:
When i import the zpool on the new machine the datasets for my home are mounted in my home directory,
so the zfs dataset for my Desktop is mounted over the current Desktop if that makes sense
Bash:
# zpool import zbackup
What i want to do is mount the zbackup pool to /mnt/usb,
which is a mount point i have created
The zbackup pool has its zfs mount point set to /mnt/usb, like so
Bash:
# zfs set mountpoint=/mnt/usb zbackup
I guess i need to set the altroot to /mnt/usb or something on macmini
Second question:
Is it possible to do a zfs send recv of the datasets from the the usb drive to the datasets on the macmini
something like this
Bash:
# zfs send -Rv zbackup/zroot/data/desktop@freebsd-12.1 | zfs recv -F zroot/data/desktop
Or should i try and mount the zpool to /mnt/usb and then use rsync or cp -Rpv,
to copy the data from the usb to the zfs datasets i have created on the macmini
On the macmini i have created all the zfs datasets
Bash:
# zfs create zroot/data
# zfs create zroot/data/desktop
# zfs create zroot/data/documents
# zfs create zroot/data/downloads
# zfs create zroot/data/git
# zfs create zroot/data/config
# zfs create zroot/data/emacsd
# zfs create zroot/data/local
# zfs create zroot/data/mozilla
# zfs create zroot/data/ossuary
# zfs create zroot/data/weechat
and mount points
Bash:
mkdir -p ~/Desktop
mkdir -p ~/documents
mkdir -p ~/downloads
mkdir -p ~/git
mkdir -p ~/.config
mkdir -p ~/.emacs.d
mkdir -p ~/.local
mkdir -p ~/.mozzila
mkdir -p ~/.ossuary
mkdir -p ~/.weechat
after i transfer the data i would set the zfs mount points and then mount them
Bash:
# zfs set mountpoint=/usr/home/djwilcox/Desktop zroot/data/desktop
# zfs set mountpoint=/usr/home/djwilcox/documents zroot/data/documents
# zfs set mountpoint=/usr/home/djwilcox/downloads zroot/data/downloads
# zfs set mountpoint=/usr/home/djwilcox/git zroot/data/git
# zfs set mountpoint=/usr/home/djwilcox/.config zroot/data/config
# zfs set mountpoint=/usr/home/djwilcox/.emacs.d zroot/data/emacsd
# zfs set mountpoint=/usr/home/djwilcox/.local zroot/data/local
# zfs set mountpoint=/usr/home/djwilcox/.mozilla zroot/data/mozilla
# zfs set mountpoint=/usr/home/djwilcox/.ossuary zroot/data/ossuary
# zfs set mountpoint=/usr/home/djwilcox/.weechat zroot/data/weechat
Heres how i created the zfs datasets on the external usb drive
list the disks
Bash:
geom disk list
switch to root
Bash:
doas su
wipe the drive which is /dev/da0
Bash:
gpart destroy -F da0
dd if=/dev/zero of=/dev/da0 bs=1m count=128
use gpart to create a gpt partition on the drive and add a label
Bash:
gpart create -s gpt da0
gpart add -t freebsd-zfs -l zbackup da0
create the mount point on my macbook air
Bash:
# mkdir -p /mnt/usb
create a new zpool and give it the same name as the gpt label to make things easy to remember set the mount point and use chown to change the owner of the mount point, replacing username:username with your username
create zfs pool on the external drive
Bash:
zpool create zbackup gpt/zbackup
zfs set mountpoint=/mnt/usb zbackup
chown username:username /mnt/usb
list zfs directory structure
Bash:
zfs list
create the snapshot
Code:
# zfs snapshot -r zroot@freebsd-12.1
send the snapshots to the corresponding pool on the drive use the -R option to create the datasets on the external drive
Bash:
# zfs send -Rv zroot@freebsd-12.1 | zfs receive -F zbackup/zroot
take a new snapshot to send the incremental snapshot
Bash:
zfs snapshot -r zroot@second-snapshot
send incremental snapshots use the -R option on the zroot pool to send incremental snapshots of the descendant file system
Bash:
# zfs send -Rv -I zroot@freebsd-12.1 zroot@second-snapshot | zfs recv -F zbackup/zroot
export the zfs backup before removing the drive
Bash:
# zfs export zbackup