Migrate Jails to a new volume on new hard drives

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
I have a question about Jails data migration.
Currently, I have 6 HDDs connected (max) and they create two volumes, one containing 5HDD (Vol1) with and the other 1HDD (Vol2) with only Jails.
I need to replace the VOL1 disks because I am running out of space and I want to mount 6 disks in this place to create a new VOL1. I also need to disconnect VOL2, but I would like Jails to somehow be transferred to the new six-disk VOL1. Is that possible? I can connect the old VOL2 via USB to the updated 6-drive Truenas, but how can I transfer the entire jails from this drive to the new volume?
Of course, the target USB drive will not be connected and will only serve as a Jails data donor for the new volume.
I also have the data from VOL1 copied (backup).
Is there any way to make a Jails backup?
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
@John Digital
My problem is a little different than the one in the link.
I will replace all six disks: five data disks (raid) VOL1 and one jails disk (VOL2) at same time. In the new version I will have 6 disks as now but only one volume (VOL1).
I won't be able to keep the disk connected to jails together with the new volume because I only have 6 sata posts available. I have only usb connecton available for interface usb - sata and i can connect old VOL2 volume temporary for migration.
Is it possible to make a copy or snapshot of the VOL 2 disk to a file, e.g. on a Windows 10 PC connected via LAN, and then restore this snapshot (image) to a new location?
 
Last edited:
Joined
Jan 7, 2015
Messages
1,155
Yeah i suppose that's a bit different. So in my mind there's only one thing to do. Temporarily or permanently add a HBA and a set of sff to sata (possibly power splitters) cables to get you 8 (or 6) extra ports. I have a bunch of these laying around if you want to buy or borrow one if you decide to go this way. Then you connect all disks to the NAS and do the steps from the post I cited. This does require a free PCIe port to plug the HBA into.

How you propose to do it wouldn't really work using windows. However a large external USB disk probably would. Youd have to set it up as a single disk stripe do the steps from above to the USB disk, disconnect the old disks and install the new ones, then do it again from the USB to the new disks.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
@John Digital

I have a free PCIE slot but no such card. I'm waiting for the 10 SATA port card to arrive. Your solution seems good, I will think about another solution. As I understand it is not possible to copy directly, e.g.; using MC the entire contents of the old disk from JAILS to the new location and changing the path through the GUI?
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
I did the migration and everything seems ok, but I have this inaccuracy and I would like to fix it.
First of all, I got rid of the physical volume "Extra_space" and did not create such a volume on any disk, and yet I have the same effect as in the photos. The "Extra_space" volume is the volume that existed before the jails relocation operation. Now he is physically gone.
I would like to somehow move these two directories from "Extra_space" to "Archiwum" so that "Extra_space" is no longer visible in the system. How i can this repair?
 

Attachments

  • Bez tytułu.jpg
    Bez tytułu.jpg
    170.4 KB · Views: 70
  • Bez tytułu1.jpg
    Bez tytułu1.jpg
    21.5 KB · Views: 55
Last edited:
Joined
Jan 7, 2015
Messages
1,155
Those directories look to be old warden plugin directories and can likely be removed all together. Does extra space exist in /mnt ?
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
Unfortunately, I do not have additional disks to create additional /mnt mount points.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
How can I safely remove these directories from the virtual mount point?
 
Joined
Jan 7, 2015
Messages
1,155
Youl likely need to destroy these defunct warden datasets. Its done in the format zfs destroy POOLNAME/dataset in a host SSH session. Locate them, its going to be somewhere in say /mnt/Extra_Space/jails or /mnt/Archiwum/jails. Doing zfs list will show you, and from there you can locate the offending datasets and destroy them, once your sure.

You need to be absolutely sure what you are doing here as this could be and is dangerous to unleash on the wrong dataset, poof gone.

See this post, its very similar to what you need to be doing.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
root@TrueNas:~ # zfs list
NAME USED AVAIL REFER MOUNTPOINT
Archiwum 12.2T 66.1T 243K /mnt/Archiwum
Archiwum/.system 33.1M 66.1T 179K legacy
Archiwum/.system/configs-a421eaccddb44c098d96b72146b5211d 658K 66.1T 658K legacy
Archiwum/.system/cores 153K 1024M 153K legacy
Archiwum/.system/rrd-a421eaccddb44c098d96b72146b5211d 31.0M 66.1T 31.0M legacy
Archiwum/.system/samba4 754K 66.1T 562K legacy
Archiwum/.system/services 153K 66.1T 153K legacy
Archiwum/.system/syslog-a421eaccddb44c098d96b72146b5211d 153K 66.1T 153K legacy
Archiwum/.system/webui 153K 66.1T 153K legacy
Archiwum/Download 1005G 66.1T 1005G /mnt/Archiwum/Download
Archiwum/Music 101G 66.1T 101G /mnt/Archiwum/Music
Archiwum/Photos 25.3G 66.1T 25.3G /mnt/Archiwum/Photos
Archiwum/Video 5.96T 66.1T 5.96T /mnt/Archiwum/Video
Archiwum/iocage 61.3G 66.1T 14.4M /mnt/Archiwum/iocage
Archiwum/iocage/download 1.08G 66.1T 141K /mnt/Archiwum/iocage/download
Archiwum/iocage/download/11.2-RELEASE 141K 66.1T 141K /mnt/Archiwum/iocage/download/11.2-RELEASE
Archiwum/iocage/download/11.3-RELEASE 141K 66.1T 141K /mnt/Archiwum/iocage/download/11.3-RELEASE
Archiwum/iocage/download/11.4-RELEASE 141K 66.1T 141K /mnt/Archiwum/iocage/download/11.4-RELEASE
Archiwum/iocage/download/12.1-RELEASE 371M 66.1T 371M /mnt/Archiwum/iocage/download/12.1-RELEASE
Archiwum/iocage/download/12.2-RELEASE 238M 66.1T 238M /mnt/Archiwum/iocage/download/12.2-RELEASE
Archiwum/iocage/download/12.3-RELEASE 238M 66.1T 238M /mnt/Archiwum/iocage/download/12.3-RELEASE
Archiwum/iocage/download/13.2-RELEASE 256M 66.1T 256M /mnt/Archiwum/iocage/download/13.2-RELEASE
Archiwum/iocage/images 141K 66.1T 141K /mnt/Archiwum/iocage/images
Archiwum/iocage/jails 53.2G 66.1T 153K /mnt/Archiwum/iocage/jails
Archiwum/iocage/jails/Joomla 4.26G 66.1T 173K /mnt/Archiwum/iocage/jails/Joomla
Archiwum/iocage/jails/Joomla/root 4.26G 66.1T 4.28G /mnt/Archiwum/iocage/jails/Joomla/root
Archiwum/iocage/jails/MineOs_Minecraft_Server 9.71G 66.1T 160K /mnt/Archiwum/iocage/jails/MineOs_Minecraft_Server
Archiwum/iocage/jails/MineOs_Minecraft_Server/root 9.71G 66.1T 9.87G /mnt/Archiwum/iocage/jails/MineOs_Minecraft_Server/root
Archiwum/iocage/jails/Plex 14.7G 66.1T 192K /mnt/Archiwum/iocage/jails/Plex
Archiwum/iocage/jails/Plex/root 14.7G 66.1T 14.8G /mnt/Archiwum/iocage/jails/Plex/root
Archiwum/iocage/jails/Transmission 6.18G 66.1T 192K /mnt/Archiwum/iocage/jails/Transmission
Archiwum/iocage/jails/Transmission/root 6.18G 66.1T 6.58G /mnt/Archiwum/iocage/jails/Transmission/root
Archiwum/iocage/jails/WordPress 4.49G 66.1T 173K /mnt/Archiwum/iocage/jails/WordPress
Archiwum/iocage/jails/WordPress/root 4.49G 66.1T 4.52G /mnt/Archiwum/iocage/jails/WordPress/root
Archiwum/iocage/jails/miniDLNA 8.07G 66.1T 179K /mnt/Archiwum/iocage/jails/miniDLNA
Archiwum/iocage/jails/miniDLNA/root 8.07G 66.1T 8.48G /mnt/Archiwum/iocage/jails/miniDLNA/root
Archiwum/iocage/log 351K 66.1T 351K /mnt/Archiwum/iocage/log
Archiwum/iocage/releases 7.00G 66.1T 141K /mnt/Archiwum/iocage/releases
Archiwum/iocage/releases/11.2-RELEASE 1.30G 66.1T 141K /mnt/Archiwum/iocage/releases/11.2-RELEASE
Archiwum/iocage/releases/11.2-RELEASE/root 1.30G 66.1T 1.30G /mnt/Archiwum/iocage/releases/11.2-RELEASE/root
Archiwum/iocage/releases/11.3-RELEASE 1.34G 66.1T 141K /mnt/Archiwum/iocage/releases/11.3-RELEASE
Archiwum/iocage/releases/11.3-RELEASE/root 1.34G 66.1T 1.34G /mnt/Archiwum/iocage/releases/11.3-RELEASE/root
Archiwum/iocage/releases/11.4-RELEASE 567M 66.1T 141K /mnt/Archiwum/iocage/releases/11.4-RELEASE
Archiwum/iocage/releases/11.4-RELEASE/root 567M 66.1T 567M /mnt/Archiwum/iocage/releases/11.4-RELEASE/root
Archiwum/iocage/releases/12.1-RELEASE 1.70G 66.1T 153K /mnt/Archiwum/iocage/releases/12.1-RELEASE
Archiwum/iocage/releases/12.1-RELEASE/root 1.70G 66.1T 1.68G /mnt/Archiwum/iocage/releases/12.1-RELEASE/root
Archiwum/iocage/releases/12.2-RELEASE 797M 66.1T 153K /mnt/Archiwum/iocage/releases/12.2-RELEASE
Archiwum/iocage/releases/12.2-RELEASE/root 797M 66.1T 795M /mnt/Archiwum/iocage/releases/12.2-RELEASE/root
Archiwum/iocage/releases/12.3-RELEASE 662M 66.1T 153K /mnt/Archiwum/iocage/releases/12.3-RELEASE
Archiwum/iocage/releases/12.3-RELEASE/root 662M 66.1T 660M /mnt/Archiwum/iocage/releases/12.3-RELEASE/root
Archiwum/iocage/releases/13.2-RELEASE 704M 66.1T 153K /mnt/Archiwum/iocage/releases/13.2-RELEASE
Archiwum/iocage/releases/13.2-RELEASE/root 704M 66.1T 704M /mnt/Archiwum/iocage/releases/13.2-RELEASE/root
Archiwum/iocage/templates 141K 66.1T 141K /mnt/Archiwum/iocage/templates
Archiwum/jails 18.0M 66.1T 204K /mnt/Archiwum/jails
Archiwum/jails/.warden-template-pluginjail-11.0-x64 3.56M 66.1T 3.56M /mnt/Archiwum/jails/.warden-template-pluginjail-11.0-x64
Archiwum/jails/.warden-template-pluginjail-11.0-x64-20180509111607 3.56M 66.1T 3.56M /mnt/Archiwum/jails/.warden-template-pluginjail-11.0-x64-20180509111607
Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031212808 3.56M 66.1T 3.56M /mnt/Extra_space/jails/.warden-template-pluginjail-11.0-x64-20181031212808
Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031222022 3.56M 66.1T 3.56M /mnt/Extra_space/jails/.warden-template-pluginjail-11.0-x64-20181031222022
Archiwum/jails/.warden-template-standard-11.0-x64 3.58M 66.1T 3.58M /mnt/Archiwum/jails/.warden-template-standard-11.0-x64
boot-pool 4.43G 9.62G 96K none
boot-pool/ROOT 4.41G 9.62G 96K none
boot-pool/ROOT/13.0-U5.2 280K 9.62G 1.51G /
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
This are the all my pools.
I look for this:
Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031212808 3.56M 66.1T 3.56M /mnt/Extra_space/jails/.warden-template-pluginjail-11.0-x64-20181031212808
Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031222022 3.56M 66.1T 3.56M /mnt/Extra_space/jails/.warden-template-pluginjail-11.0-x64-20181031222022

I looked through the thread but I don't know what to do next.
 
Last edited:
Joined
Jan 7, 2015
Messages
1,155
ok so plug those found datasets like so..

zfs destroy Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031212808
zfs destroy Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031222022
 
Joined
Jan 7, 2015
Messages
1,155
In my estimation you could probably destroy all .warden datasets, but go easy. You could probably also start purging some of the 11.x and 12.x series iocage datasets too, but one step at a time. Those will require the -r flag in the zfs destroy command. And looking a bit closer at your zfs list, you could likely just destroy the dataset Archiwum/jails dataset with the -r flag like so. Just be right careful here, and ask if not sure. Config backups, manual snapshots, etc, before you start doing things like this are always a good idea.

zfs destroy -r Archiwum/jails as all thats even in it are old defunct warden templates.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
Thank you for the clarification. Yes, I am determined to clean up unnecessary warden elements, but I would like to do it safely, without any mistakes, and with the possibility of recovering them. I would also like to somehow check whether everything works as it should after deleting it. So please give me instructions, preferably step by step, on how to do it. Thank you
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
Unfortunately, I do not have such experience in programming or knowledge of Unix, so I am asking you to present the steps to remove unnecessary .warden files and directories. Please let me know how to make a copy of these directories in advance in case they need to be restored. Finally, please provide instructions on how to check whether the deleted directories will no longer be required by the system. If it turns out that they are required, please indicate how they can be restored.
Thank you for your patience.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
I destroyed resources:
zfs destroy Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031212808
zfs destroy Archiwum/jails/.warden-template-pluginjail-11.0-x64-20181031222022
My mounting point has disappeared:
Extra_space/jails
What should I do next?
I don't really know

How can I safely clear the rest of .warden?
 
Joined
Jan 7, 2015
Messages
1,155
I think you got it cleared out right those were the offending two you wanted gone. You can repeat the commands until zfs list no longer shows any .warden datasets.
 

Jedrek

Explorer
Joined
May 25, 2017
Messages
71
I took a snapshot of the Archivum/jails and then deleted zfs with the -r attribute and everything was deleted without any problems. Now how can I check whether the deleted resources were not needed for something?

I no longer have any .warden resources
 
Joined
Jan 7, 2015
Messages
1,155
.warden stuff is dead and not needed as related to current truenas. All jails use iocage and have for some time now. Retain your backups and snapshots awhile just in case.
 
Top