I am trying to transfer my root file system to a smaller drive:
I am trying to follow this: https://blog.grem.de/sysadmin/Shrinking-ZFS-Pool-2014-05-29-21-00.html
Below are my commands and errors (under bold lines)
IT SHOWED EVERYTHING TRANSFERING NO ERRORS
At this point var, usr, tmp and zroot40 appear under /mnt/usb
Now var, usr, tmp and zroot40 have disappeared from /mnt/usb
cp: /mnt/usb/boot/zfs/zpool.cache: No such file or directory
zpool list shows: zroot40 is mounted at /mnt/usb
zfs list shows it there also
As you probably can tell, I am new to this, I have done searches and cannot figure out what I am doing wrong.
If you can help, please be specific like you are explaining to a child.
Thanks
I am trying to follow this: https://blog.grem.de/sysadmin/Shrinking-ZFS-Pool-2014-05-29-21-00.html
Below are my commands and errors (under bold lines)
Code:
root@vmbsd:/usr/home/pete # gpart destroy -F ada5
ada5 destroyed
root@vmbsd:/usr/home/pete # gpart create -s GPT ada5
ada5 created
root@vmbsd:/usr/home/pete # gpart add -t freebsd-boot -s 512 ada5
ada5p1 added
root@vmbsd:/usr/home/pete # gpart add -t freebsd-zfs -s 40G -l boot ada5
ada5p2 added
root@vmbsd:/usr/home/pete # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada5
partcode written to ada5p1
bootcode written to ada5
zpool create -o cachefile=/tmp/zpool.cache zroot40 gpt/boot
root@vmbsd:/usr/home/pete # gpart show ada5
=> 40 156301408 ada5 GPT (75G)
40 512 1 freebsd-boot (256K)
552 83886080 2 freebsd-zfs (40G)
83886632 72414816 - free - (35G)
root@vmbsd:/usr/home/pete # zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
storage 476G 358G 118G - - 9% 75% 1.00x ONLINE -
zroot 56.5G 8.68G 47.8G - - 16% 15% 1.00x ONLINE -
zroot40 39.5G 678K 39.5G - - 0% 0% 1.00x ONLINE -
root@vmbsd:/usr/home/pete # zfs snapshot -r zroot@backup
root@vmbsd:/usr/home/pete # zfs send -vR zroot@backup | zfs receive -vFud zroot40
IT SHOWED EVERYTHING TRANSFERING NO ERRORS
Code:
root@vmbsd:/usr/home/pete # zfs destroy -r zroot@backup
root@vmbsd:/usr/home/pete # zpool set bootfs=zroot40/ROOT/default zroot40
root@vmbsd:/usr/home/pete # cp /tmp/zpool.cache /tmp/zroot40.cache
root@vmbsd:/usr/home/pete # zpool export zroot40
root@vmbsd:/usr/home/pete # zpool import -c /tmp/zroot40.cache -R /mnt/usb zroot40
At this point var, usr, tmp and zroot40 appear under /mnt/usb
Code:
root@vmbsd:/usr/home/pete # zfs set mountpoint=/ zroot40/ROOT
Now var, usr, tmp and zroot40 have disappeared from /mnt/usb
Code:
root@vmbsd:/usr/home/pete # cp /tmp/zroot40.cache /mnt/usb/boot/zfs/zpool.cache
zpool list shows: zroot40 is mounted at /mnt/usb
zfs list shows it there also
As you probably can tell, I am new to this, I have done searches and cannot figure out what I am doing wrong.
If you can help, please be specific like you are explaining to a child.
Thanks
Last edited: