how to move jails

Status
Not open for further replies.

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
Hi there,

how do i move jails from one DataSet to another?

Would be a nice option like with the system dataset.
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Hi, have you tried the Configuration section in the Jails tab?

upload_2017-8-7_9-30-24.png
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Hi, have you tried the Configuration section in the Jails tab?
That will tell the system to look in a different place, but will not move any existing jails. @dirkme, to move existing jails, you'll need to move the files over--ZFS replication is probably the best way to do that.
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
That will tell the system to look in a different place, but will not move any existing jails. @dirkme, to move existing jails, you'll need to move the files over--ZFS replication is probably the best way to do that.
Is it possible to first move the jails from the shell with a mv command and then point the GUI to the new location?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is it possible to first move the jails from the shell with a mv command and then point the GUI to the new location?
I'd expect so, though I haven't tried.
 

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
That will tell the system to look in a different place, but will not move any existing jails. @dirkme, to move existing jails, you'll need to move the files over--ZFS replication is probably the best way to do that.

Can I move the jails with Midnight Commander?
 

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
That will tell the system to look in a different place, but will not move any existing jails. @dirkme, to move existing jails, you'll need to move the files over--ZFS replication is probably the best way to do that.

Can I move the jails with Midnight Commander?
 

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
Last edited:

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
Hi again, I need some1 to have a look over this before I start my attempt.

and what does @relocate do, is this a zfs option?

whereby trust2 is the spource and trust is the destination:

1 Command: [PANEL]zfs snapshot -r /mnt/trust2/pluginjail@relocate
2 Command: zfs send -R /mnt/trust2/pluginjail@relocate | zfs receive -v /mnt/trust/pluginjail
3 Command: zfs get -rH -o name -s received mountpoint /mnt/trust/pluginjail | xargs -I {} sh -c "zfs set mountpoint=/{} {}; zfs mount {};"[/PANEL]
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
No, it's simply the name of the snapshot. It could be anything.

Does the [PANEL] to be there too? And what does it do?

So, it creates a snapshot from my jail which will be called " pluginjail@relocate " and then zfs copies it to the destination, while the other part changes the system config to announce the new destination for the jail dataset, right?

Does this look alright to you (the 3 commands)?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Does the [PANEL] to be there too?
No; I expect that was intended to be a formatting marker that didn't do what was expected.
So, it creates a snapshot from my jail which will be called " pluginjail@relocate " and then zfs copies it to the destination,
Correct.
while the other part changes the system config to announce the new destination for the jail dataset, right?
I guess so--I think that's what that last line is intended to do, but I couldn't say if it's correct.
 

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
hmmm that is what i get back??

Code:
root@voyager:~ # zfs snapshot -r /mnt/trust2/pluginjail
usage:
   snapshot|snap [-r] [-o property=value] ... <filesystem|volume>@<snap> ...

For the property list, run: zfs set|get

For the delegated permission list, run: zfs allow|unallow
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Two things there. First, of course, trust2 was the pool name used in that example, which probably isn't the same as yours. Second, there is an error in those commands, as they operate on the dataset name, not the filesystem path. The first two should read like this:
Code:
zfs snapshot -r trust2/pluginjail@relocate
zfs send -R trust2/pluginjail@relocate | zfs receive -v trust/pluginjail
 

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
Two things there. First, of course, trust2 was the pool name used in that example, which probably isn't the same as yours. Second, there is an error in those commands, as they operate on the dataset name, not the filesystem path. The first two should read like this:
Code:
zfs snapshot -r trust2/pluginjail@relocate
zfs send -R trust2/pluginjail@relocate | zfs receive -v trust/pluginjail

You Sir are a SuperStar again, thanks a lot for your help.

It seems to work just fine, yeah!
 

dirkme

Contributor
Joined
Jul 19, 2017
Messages
162
Rebooted, installed a new plugin and jail and all is well and at the right dataset.

FreeNas!!! Best community and NAS software.
 

Artion

Patron
Joined
Feb 12, 2016
Messages
331
Is this thread solved? Could you please mark it as Solved? You can find how here or here.
 
Status
Not open for further replies.
Top