[fixed]unable to move jails to another pool/disk

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
Hi all,

I am running out of space on my initial jails pool and I am trying to transfer all jails to a bigger Pool/Drive
I tried using the zfs snapshot and then zfs send / receive for this.
There is something I am missing as I can't create the snapshot:
Current jails pool:
zfs list | grep Jails
Jails 35.5G 20.2G 104K /mnt/Jails
Jails/.system 181M 20.2G 104K /mnt/Jails/.system
Jails/.system/configs-17a88b624aa64e01b68939563b5fcb8c 52.6M 20.2G 52.4M /mnt/Jails/.system/configs-17a88b624aa64e01b68939563b5fcb8c
Jails/.system/cores 112K 1024M 96K /mnt/Jails/.system/cores
Jails/.system/rrd-17a88b624aa64e01b68939563b5fcb8c 118M 20.2G 34.1M /mnt/Jails/.system/rrd-17a88b624aa64e01b68939563b5fcb8c
Jails/.system/samba4 4.33M 20.2G 364K /mnt/Jails/.system/samba4
Jails/.system/services 96K 20.2G 96K /mnt/Jails/.system/services
Jails/.system/syslog-17a88b624aa64e01b68939563b5fcb8c 5.89M 20.2G 5.04M /mnt/Jails/.system/syslog-17a88b624aa64e01b68939563b5fcb8c
Jails/.system/webui 96K 20.2G 96K /mnt/Jails/.system/webui
Jails/iocage 35.2G 20.2G 12.5M /mnt/Jails/iocage
Jails/iocage/download 1012M 20.2G 104K /mnt/Jails/iocage/download
Jails/iocage/download/12.1-RELEASE 371M 20.2G 371M /mnt/Jails/iocage/download/12.1-RELEASE
Jails/iocage/download/12.2-RELEASE 402M 20.2G 402M /mnt/Jails/iocage/download/12.2-RELEASE
Jails/iocage/download/12.3-RELEASE 238M 20.2G 238M /mnt/Jails/iocage/download/12.3-RELEASE
Jails/iocage/images 160K 20.2G 96K /mnt/Jails/iocage/images
Jails/iocage/jails 28.0G 20.2G 136K /mnt/Jails/iocage/jails
Jails/iocage/jails/Skywalker 1.59G 20.2G 308K /mnt/Jails/iocage/jails/Skywalker
Jails/iocage/jails/Skywalker/root 1.59G 20.2G 1.52G /mnt/Jails/iocage/jails/Skywalker/root
Jails/iocage/jails/anakin 12.4G 20.2G 312K /mnt/Jails/iocage/jails/anakin
Jails/iocage/jails/anakin/root 12.4G 20.2G 11.3G /mnt/Jails/iocage/jails/anakin/root
Jails/iocage/jails/bespin 1.61G 20.2G 364K /mnt/Jails/iocage/jails/bespin
Jails/iocage/jails/bespin/root 1.61G 20.2G 1.57G /mnt/Jails/iocage/jails/bespin/root
Jails/iocage/jails/coruscant 3.03G 20.2G 328K /mnt/Jails/iocage/jails/coruscant
Jails/iocage/jails/coruscant/root 3.03G 20.2G 2.19G /mnt/Jails/iocage/jails/coruscant/root
Jails/iocage/jails/geonosis 9.41G 20.2G 300K /mnt/Jails/iocage/jails/geonosis
Jails/iocage/jails/geonosis/root 9.41G 20.2G 6.76G /mnt/Jails/iocage/jails/geonosis/root
Jails/iocage/log 484K 20.2G 180K /mnt/Jails/iocage/log
Jails/iocage/releases 6.23G 20.2G 104K /mnt/Jails/iocage/releases
Jails/iocage/releases/12.1-RELEASE 2.89G 20.2G 96K /mnt/Jails/iocage/releases/12.1-RELEASE
Jails/iocage/releases/12.1-RELEASE/root 2.89G 20.2G 1.46G /mnt/Jails/iocage/releases/12.1-RELEASE/root
Jails/iocage/releases/12.2-RELEASE 2.68G 20.2G 96K /mnt/Jails/iocage/releases/12.2-RELEASE
Jails/iocage/releases/12.2-RELEASE/root 2.68G 20.2G 1.37G /mnt/Jails/iocage/releases/12.2-RELEASE/root
Jails/iocage/releases/12.3-RELEASE 672M 20.2G 96K /mnt/Jails/iocage/releases/12.3-RELEASE
Jails/iocage/releases/12.3-RELEASE/root 672M 20.2G 672M /mnt/Jails/iocage/releases/12.3-RELEASE/root
Jails/iocage/templates 96K 20.2G 96K /mnt/Jails/iocage/templates
root@Tatooine[~]#

created snapshot
zfs snapshot Jails/iocage/jails@test1-snap
snapshot created:
zfs list -t snapshot | grep test1-snap
Jails/iocage/jails@test1-snap 0B - 136K -
send the snapshot to the new pool called Jail
zfs send -R Jails/iocage/jails@test1-snap | zfs receive -v -F Jail
cannot send Jails/iocage/jails@test1-snap recursively: snapshot Jails/iocage/jails/coruscant@test1-snap does not exist
warning: cannot send 'Jails/iocage/jails@test1-snap': backup failed
cannot receive: failed to read from stream

What am I missing?
thank you
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
my bad. I was missing the bkp name. I fixed it by changing zfs send Jails/iocage/jails@test1-snap with Jails@test1-snap
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
can be closed or deleted. problem fixed.
 
Joined
Jan 27, 2020
Messages
577
I'd like to add a step-by-step guide that help me to do that. I it found over at lawrencesystems.com

I wanted to move jails from bluePool to ssdPool


  • logged out from the UI (don’t know if it played a part, thought to be safe)
  • iocage stop ALL
  • zfs unmount -f bluePool/iocage
  • zfs snapshot -r bluePool/iocage@migration
  • zfs send -R bluePool/iocage@migration | zfs receive -v ssdPool/iocage
  • iocage clean -a
  • zfs destroy -rf bluePool/iocage
  • iocage activate ssdPool
  • zfs destroy -r ssdPool/iocage@migration
  • zfs set mountpoint=none ssdPool/iocage/download
  • zfs set mountpoint=/ssdPool/iocage/download ssdPool/iocage/download

Last couple of commands were needed because when I issued
iocage list
I got
Please set a mountpoint on ssdPool/iocage/download
and I could not set the mountpoint just using the second command, I had to clean it up first (can’t tell if it was “locked” somehow by the previous setup, don’t know that much about FreeBSD).


Then I had to manually edit all the fstab for my jails
iocage fstab -e jail_name
and replace bluePool/iocage with ssdPool/iocage


That’s all. I logged in to the UI, started my jails/plugins and everything worked fine.
 
Top