I will shortly be moving my system to a larger SSD. In the process I'd like to create a dataset /usr/local as a child of /user. This could make life easier if I have problems after upgrading packages and need to roll back.
My current structure is:
I would like to create ssd/ROOT/fbsd12.2d/usr/local as a new dataset before using zfs send and zfs receive to copy the data.
My first thoughts are:
1)
2)
3)
4)
I can see there's a risk if pulling the rug from under my feet in steps 3 & 4 unless I drop into single user mode, or switch to a different boot environment, and use some temporary mount points for ssd/ROOT/fbsd12.2d/usr and ssd/ROOT/fbsd12.2d/usr/local but is there a neater way of doing this by initially setting up an empty file system with the new structure on the destination drive before using zfs send and zfs receive?
My current structure is:
Code:
NAME USED AVAIL REFER MOUNTPOINT
ssd/ROOT/fbsd12.2d 40.2G 74.9G 1.55G /
ssd/ROOT/fbsd12.2d/usr 31.7G 74.9G 9.89G /usr
ssd/ROOT/fbsd12.2d/usr/ports 8.84G 74.9G 6.72G /usr/ports
ssd/ROOT/fbsd12.2d/usr/src 3.52G 74.9G 1.46G /usr/src
ssd/ROOT/fbsd12.2d/var 6.67G 74.9G 1.63G /var
ssd/ROOT/fbsd12.2d/var/db 3.21G 74.9G 1.93G /var/db
ssd/ROOT/fbsd12.2d/var/empty 104K 74.9G 96K /var/empty
ssd/ROOT/fbsd12.2d/var/tmp 1.03G 74.9G 136K /var/tmp
My first thoughts are:
1)
zfs create sdd/ROOT/fbsd12.2d/usr/dummy-local
2)
rsync -a /usr/local/ /usr/dummy-local
3)
zfs destroy /usr/local
4)
zfs rename /usr/dummy-local /usr/local
I can see there's a risk if pulling the rug from under my feet in steps 3 & 4 unless I drop into single user mode, or switch to a different boot environment, and use some temporary mount points for ssd/ROOT/fbsd12.2d/usr and ssd/ROOT/fbsd12.2d/usr/local but is there a neater way of doing this by initially setting up an empty file system with the new structure on the destination drive before using zfs send and zfs receive?