SOLVED How can I transfer a Jail to another disk.

Status
Not open for further replies.

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
Hey guys,

I installed some Jails, but unfortunately I installed them on the wrong disk and I already configured them.

Is there a way to move the Jails to a other disk, and If, do they still work right then?
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,477
How are your disks setup? So you want to move the jails from one vdev to another? Or do you want to move the jails to a completely different pool?
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
How are your disks setup? So you want to move the jails from one vdev to another? Or do you want to move the jails to a completely different pool?

IMG_5107.JPG


So I installed the Jails to the pool "NAS". And I want to move the Jails to the pool "Jails".
 

nojohnny101

Wizard
Joined
Dec 3, 2015
Messages
1,477
The command zfs send | zfs receive would seem to be the easiest and most obvious to me. Search for details (sorry on my mobile).

You might have to change mount points though in the GUI. Did you manually install the jails through the CLI or were they plugins. And what jails are we talking here?
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
The command zfs send | zfs receive would seem to be the easiest and most obvious to me. Search for details (sorry on my mobile).

You might have to change mount points though in the GUI. Did you manually install the jails through the CLI or were they plugins. And what jails are we talking here?

I installed them myself. So I setup two Jails. One Jail named "Teamspeak" for obviously Teamspeak and one for Emby called "Emby".

Ok, I will search later for some details about the zfs commands, Im currently on my mobil as well.




Gesendet von iPhone mit Tapatalk
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Take a snapshot of the jail dataset you want to move. Then zfs send snapshot | zfs recv destdataset. Then update your jail root in the GUI. Reboot and everything should be running. Delete old jail dataset.

Sent from my Nexus 5X using Tapatalk
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
So I did this

Code:
[root@freenas ~]# zfs snapshot NAS/jails/Emby@emby
[root@freenas ~]# zfs send NSA/jails/Emby@Emby | zfs recv Jails/Emby
[root@freenas ~]# zfs snapshot NAS/jails/Teamspeak@ts
[root@freenas ~]# zfs send NAS/jails/Teamspeak@ts | zfs recv Jails/Teamspeak
[root@freenas ~]# zfs list                                                                                                        
NAME                                                            USED  AVAIL  REFER  MOUNTPOINT                                    
Jails                                                          3.25G   220G    19K  /mnt/Jails                                    
Jails/Emby                                                     2.15G   220G  2.15G  /mnt/Jails/Emby                                
Jails/Teamspeak                                                1.10G   220G  1.10G  /mnt/Jails/Teamspeak                          
NAS                                                             978G   370G   973G  /mnt/NAS                                      
NAS/.system                                                    15.2M   370G   128K  legacy                                        
NAS/.system/configs-aaf6f5054c9543438f7fc5cea38127c7           1.91M   370G  1.91M  legacy                                        
NAS/.system/cores                                               848K   370G   848K  legacy                                        
NAS/.system/rrd-aaf6f5054c9543438f7fc5cea38127c7               10.3M   370G  10.3M  legacy                                        
NAS/.system/samba4                                              380K   370G   380K  legacy                                        
NAS/.system/syslog-aaf6f5054c9543438f7fc5cea38127c7            1.70M   370G  1.70M  legacy                                        
NAS/jails                                                      4.94G   370G   128K  /mnt/NAS/jails                                
NAS/jails/.warden-template-standard                            1.60G   370G  1.60G  /mnt/NAS/jails/.warden-template-standard      
NAS/jails/Emby                                                 2.30G   370G  3.11G  /mnt/NAS/jails/Emby                            
NAS/jails/Teamspeak                                            1.04G   370G  1.85G  /mnt/NAS/jails/Teamspeak                      
freenas-boot                                                   4.84G  2.37G    31K  none                                          
freenas-boot/.system                                            247M  2.37G    37K  legacy                                        
freenas-boot/.system/configs-aaf6f5054c9543438f7fc5cea38127c7  93.2M  2.37G  93.2M  legacy                                        
freenas-boot/.system/cores                                     40.4M  2.37G  40.4M  legacy                                        
freenas-boot/.system/rrd-aaf6f5054c9543438f7fc5cea38127c7       105M  2.37G   105M  legacy                                        
freenas-boot/.system/samba4                                    4.21M  2.37G  4.21M  legacy                                        
freenas-boot/.system/syslog-aaf6f5054c9543438f7fc5cea38127c7   4.76M  2.37G  4.76M  legacy                                        
freenas-boot/ROOT                                              4.16G  2.37G    31K  none                                          
freenas-boot/ROOT/9.10-STABLE-201606270534                      435K  2.37G  1.18G  /                                              
freenas-boot/ROOT/9.10.1                                       4.16G  2.37G  1.22G  /                                              
freenas-boot/grub                                               427M  2.37G  10.3M  legacy                                        
                                                                                                          



Then I changed the Jail root from /mnt/NAS/Jails to /mnt/Jails and rebooted.

But now I do not see a single Jail in the WebGui --> http://puu.sh/qNkaH/288e5fe213.png

My Emby aswell my Teamspeak does not work now. Mhh. Did I something wrong?
 
Last edited:

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
zfs send NSA/jails/Emby@Emby | zfs recv Jails/Emby
You didn't mean NSA, right?

Take a snapshot of the jail dataset you want to move.
I think you should take a recursive snapshot of the entire /NAS/jails dataset and send them all, not just the specific jail datasets.
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
You didn't mean NSA, right?


I think you should take a recursive snapshot of the entire /NAS/jails dataset and send them all, not just the specific jail datasets.

Na didn't mean NSA, that would be to big :>

So now did this:
Code:
NAS/.system                                                    15.3M   370G   128K  legacy                                        
NAS/.system/configs-aaf6f5054c9543438f7fc5cea38127c7           1.91M   370G  1.91M  legacy                                        
NAS/.system/cores                                               848K   370G   848K  legacy                                        
NAS/.system/rrd-aaf6f5054c9543438f7fc5cea38127c7               10.3M   370G  10.3M  legacy                                        
NAS/.system/samba4                                              380K   370G   380K  legacy                                        
NAS/.system/syslog-aaf6f5054c9543438f7fc5cea38127c7            1.80M   370G  1.80M  legacy                                        
NAS/jails                                                      4.94G   370G   128K  /mnt/NAS/jails                                
NAS/jails/.warden-template-standard                            1.60G   370G  1.60G  /mnt/NAS/jails/.warden-template-standard      
NAS/jails/Emby                                                 2.30G   370G  3.11G  /mnt/NAS/jails/Emby                            
NAS/jails/Teamspeak                                            1.04G   370G  1.85G  /mnt/NAS/jails/Teamspeak                      
freenas-boot                                                   4.84G  2.37G    31K  none                                          
freenas-boot/.system                                            247M  2.37G    37K  legacy                                        
freenas-boot/.system/configs-aaf6f5054c9543438f7fc5cea38127c7  93.2M  2.37G  93.2M  legacy                                        
freenas-boot/.system/cores                                     40.4M  2.37G  40.4M  legacy                                        
freenas-boot/.system/rrd-aaf6f5054c9543438f7fc5cea38127c7       105M  2.37G   105M  legacy                                        
freenas-boot/.system/samba4                                    4.21M  2.37G  4.21M  legacy                                        
freenas-boot/.system/syslog-aaf6f5054c9543438f7fc5cea38127c7   4.76M  2.37G  4.76M  legacy                                        
freenas-boot/ROOT                                              4.16G  2.37G    31K  none                                          
freenas-boot/ROOT/9.10-STABLE-201606270534                      435K  2.37G  1.18G  /                                              
freenas-boot/ROOT/9.10.1                                       4.16G  2.37G  1.22G  /                                              
freenas-boot/grub                                               427M  2.37G  10.3M  legacy                                        
[root@freenas ~]# zfs snap -r NAS/jails@jails                                                                                      
[root@freenas ~]# zfs send NAS/jails@jails | zfs recv -F Jails                                                                    
[root@freenas ~]#                                                                                                                  
[root@freenas ~]# zfs list                                                                                                        
NAME                                                            USED  AVAIL  REFER  MOUNTPOINT                                    
Jails                                                           211K   223G    28K  /mnt/Jails                                    
NAS                                                             978G   370G   973G  /mnt/NAS                                      
NAS/.system                                                    15.3M   370G   128K  legacy                                        
NAS/.system/configs-aaf6f5054c9543438f7fc5cea38127c7           1.91M   370G  1.91M  legacy                                        
NAS/.system/cores                                               848K   370G   848K  legacy                                        
NAS/.system/rrd-aaf6f5054c9543438f7fc5cea38127c7               10.3M   370G  10.3M  legacy                                        
NAS/.system/samba4                                              380K   370G   380K  legacy                                        
NAS/.system/syslog-aaf6f5054c9543438f7fc5cea38127c7            1.80M   370G  1.80M  legacy                                        
NAS/jails                                                      4.94G   370G   128K  /mnt/NAS/jails                                
NAS/jails/.warden-template-standard                            1.60G   370G  1.60G  /mnt/NAS/jails/.warden-template-standard      
NAS/jails/Emby                                                 2.30G   370G  3.11G  /mnt/NAS/jails/Emby                            
NAS/jails/Teamspeak                                            1.04G   370G  1.85G  /mnt/NAS/jails/Teamspeak                      
freenas-boot                                                   4.84G  2.37G    31K  none                                          
freenas-boot/.system                                            247M  2.37G    37K  legacy                                        
freenas-boot/.system/configs-aaf6f5054c9543438f7fc5cea38127c7  93.2M  2.37G  93.2M  legacy                                        
freenas-boot/.system/cores                                     40.4M  2.37G  40.4M  legacy                                        
freenas-boot/.system/rrd-aaf6f5054c9543438f7fc5cea38127c7       105M  2.37G   105M  legacy                                        
freenas-boot/.system/samba4                                    4.21M  2.37G  4.21M  legacy                                        
freenas-boot/.system/syslog-aaf6f5054c9543438f7fc5cea38127c7   4.76M  2.37G  4.76M  legacy                                        
freenas-boot/ROOT                                              4.16G  2.37G    31K  none                                          
freenas-boot/ROOT/9.10-STABLE-201606270534                      435K  2.37G  1.18G  /                                              
freenas-boot/ROOT/9.10.1                                       4.16G  2.37G  1.22G  /                                              
freenas-boot/grub                                               427M  2.37G  10.3M  legacy                                        
[root@freenas ~]#          


I set then the Jail root from /mnt/NAS/Jails to /mnt/Jails and rebooted again.

Now I can see my Jails again in the WebGui. And the Jails are running. But I couldn't connect to my TS or my Emby.

And If I connect to the pool Jails I see just 80MB. And on the pool NAS it has a few GB.

Something is wrong here --> http://puu.sh/qNn7d/3a73a027ba.png

But I can see some files on the pool Jails --> http://puu.sh/qNnfu/3bc12bcfc4.png
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Now I can see my Jails again in the WebGui. And the Jails are running. But I couldn't connect to my TS or my Emby.
And If I connect to the pool Jails I see just 80MB. And on the pool NAS it has a few GB.
The Jails/Emby and Jails/Teamserver datasets don't exist, which is why they are so small? Did you use the recursive option to send and recv child datasets?

It's a lot easier to just paste the image directly into the post.
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
The Jails/Emby and Jails/Teamserver datasets don't exist, which is why they are so small? Did you use the recursive option to send and recv child datasets?


It's a lot easier to just paste the image directly into the post.

I did a recursive snap with: snap -r. After that I just zfs send NAS/jails@jails | zfs recv -F Jails.

In the original location they have a few GB.

Could I just copy and paste the data via Windows Explorer.

Would that work then?
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
The send isn't recursive and I believe the -F wiped out the originals, so I would replicate emby and ts and then reboot.
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
So I need to do zfs send -r NAS/jails@jails? The -F is for overwrite the files at Jails. I'll try it out.
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
Mhh..

Code:
[root@freenas ~]# zfs send -r NAS/jails@jails | zfs recv -r Jails                                                                   
invalid option 'r'                                                                                                                 
usage:                                                                                                                             
        send [-DnPpRvLe] [-[iI] snapshot] <snapshot>                                                                               
        send [-Le] [-i snapshot|bookmark] <filesystem|volume|snapshot>                                                             
        send [-nvPe] -t <receive_resume_token>                                                                                     
                                                                                                                                   
For the property list, run: zfs set|get                                                                                             
                                                                                                                                   
For the delegated permission list, run: zfs allow|unallow                                                                           
invalid option 'r'                                                                                                                 
usage:                                                                                                                             
        receive|recv [-vnsFu] <filesystem|volume|snapshot>                                                                         
        receive|recv [-vnsFu] [-o origin=<snapshot>] [-d | -e] <filesystem>                                                         
        receive|recv -A <filesystem|volume>                                                                                         
                                                                                                                                   
For the property list, run: zfs set|get                                                                                             
                                                                                                                                   
For the delegated permission list, run: zfs allow|unallow                                                                           
[root@freenas ~]#                                                                                                                   
                                    
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Just send each individually like you did at the beginning.

Sent from my Nexus 9 using Tapatalk
 

Anda

Explorer
Joined
Aug 12, 2015
Messages
63
These following steps worked perfectly for me:
1. I turned off all plugins and jails.
2. I performed these commands via WebGUI:
zfs snapshot -r NAS/jails@relocate
zfs send -R NAS/jails@relocate | zfs receive -v -f Jails
zfs get -rH -o name -s received mountpoint Jails | xargs -I {} sh -c "zfs set mountpoint=/{} {}; zfs mount {};"
3. Then changed the Jail Root to /mnt/Jails/

Thanks for the help :>
 
Last edited by a moderator:

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
These steps work - but with one change:
"zfs send -R NAS/jails@relocate | zfs receive -v -f Jails" should be
"zfs send -R NAS/jails@relocate | zfs receive -v -F Jails" (note the capital -F)

Here are the steps, where NAS is the old volume and JAILS is the new volume (replace NAS and JAILS with your volume names)
1. Turn off all plugins and jails.
2. Run these commands via the WebGUI Shell:
zfs snapshot -r NAS/jails@relocate
zfs send -R NAS/jails@relocate | zfs receive -v -F Jails
zfs get -rH -o name -s received mountpoint Jails | xargs -I {} sh -c "zfs set mountpoint=/{} {}; zfs mount {};"
3. Then change the Jail Root to /mnt/Jails/
4. Reboot
5. Restart jails then restart plugins
 
Last edited:
Status
Not open for further replies.
Top