Cannot mount one dataset to another

Status
Not open for further replies.

AndruXO

Dabbler
Joined
Jan 24, 2016
Messages
19
Hi everyone! I'm trying to mount one dataset to another folder via ssh, but FreeNAS-9.3-STABLE-201601181840 does something it shouldn't.
There are vol1/ALL_ROOT and vol2/Downloads. I want to mount vol2/Downloads to vol1/ALL_ROOT or somewhere to the vol1, and...
I type /mnt/vol1/ALL_ROOT/Downloads as destination point, but
it transforms into /mnt/mnt/vol1/ALL_ROOT/Downloads !!!
I type it again, but it mounts to the wrong location again!

Code:
[root@freenas] ~# zfs set mountpoint=/mnt/vol1/ALL_ROOT/Downloads vol2/Downloads
[root@freenas] ~# zfs list
NAME                                                    USED  AVAIL  REFER  MOUNTPOINT
freenas-boot                                            523M  28.6G    31K  none
freenas-boot/ROOT                                       516M  28.6G    25K  none
freenas-boot/ROOT/Initial-Install                         1K  28.6G   512M  legacy
freenas-boot/ROOT/default                               516M  28.6G   513M  legacy
freenas-boot/grub                                      6.79M  28.6G  6.79M  legacy
vol1                                                   2.24M  8.42T   153K  /mnt/vol1
vol1/.system                                           1.12M  8.42T   166K  legacy
vol1/.system/configs-2fa742ae30da433ca735af52bcb65edb   153K  8.42T   153K  legacy
vol1/.system/cores                                      153K  8.42T   153K  legacy
vol1/.system/rrd-2fa742ae30da433ca735af52bcb65edb       153K  8.42T   153K  legacy
vol1/.system/samba4                                     243K  8.42T   243K  legacy
vol1/.system/syslog-2fa742ae30da433ca735af52bcb65edb    275K  8.42T   275K  legacy
vol1/ALL_ROOT                                           153K  8.42T   153K  /mnt/vol1/ALL_ROOT
vol1/MUSIC                                              153K  8.42T   153K  /mnt/mnt/vol1/ALL_ROOT/MUSIC
vol2                                                    420K   899G    96K  /mnt/vol2
vol2/Downloads                                           96K   899G    96K  /mnt/mnt/vol1/ALL_ROOT/Downloads


I did that previously on Nas4Free system and that was ok, and I believe it's not a problem for ZFS...
What's wrong with /mnt/mnt? Why FreeNas gives no error on my desire but does something wrong?
 
D

dlavigne

Guest
Yeah, FreeNAS isn't going to like you using the CLI instead of the GUI. What exactly are you trying to accomplish and can it be done from the GUI?
 

AndruXO

Dabbler
Joined
Jan 24, 2016
Messages
19
Thanks for the reply.
I'm trying to change to mountpoint of the previously created dataset without destroying it.
As far as I understand it cannot be done via GUI...
It can be done via shell easily, but under some circumstances Freenas changes mountpoint of datasets previously mounted in the correct mnt point:

Code:

[root@freenas] ~# zfs list
NAME  USED  AVAIL  REFER  MOUNTPOINT
freenas-boot  523M  28.6G  31K  none
freenas-boot/ROOT  516M  28.6G  25K  none
freenas-boot/ROOT/Initial-Install  1K  28.6G  512M  legacy
freenas-boot/ROOT/default  516M  28.6G  513M  legacy
freenas-boot/grub  6.79M  28.6G  6.79M  legacy
vol1  2.20M  8.42T  153K  /mnt/vol1
vol1/.system  1.12M  8.42T  166K  legacy
vol1/.system/configs-2fa742ae30da433ca735af52bcb65edb  153K  8.42T  153K  legacy
vol1/.system/cores  153K  8.42T  153K  legacy
vol1/.system/rrd-2fa742ae30da433ca735af52bcb65edb  153K  8.42T  153K  legacy
vol1/.system/samba4  243K  8.42T  243K  legacy
vol1/.system/syslog-2fa742ae30da433ca735af52bcb65edb  275K  8.42T  275K  legacy
vol1/ALL_ROOT  153K  8.42T  153K  /mnt/vol1/ALL_ROOT
vol1/MUSIC  153K  8.42T  153K  /mnt/vol1/MUSIC
vol2  396K  899G  96K  /mnt/vol2
vol2/Downloads  96K  899G  96K  /mnt/vol2/Downloads
[root@freenas] ~# zfs set mountpoint=/mnt/vol1/ALL_ROOT/MUSIC vol1/MUSIC
[root@freenas] ~# zfs list
NAME  USED  AVAIL  REFER  MOUNTPOINT
freenas-boot  523M  28.6G  31K  none
freenas-boot/ROOT  516M  28.6G  25K  none
freenas-boot/ROOT/Initial-Install  1K  28.6G  512M  legacy
freenas-boot/ROOT/default  516M  28.6G  513M  legacy
freenas-boot/grub  6.79M  28.6G  6.79M  legacy
vol1  2.24M  8.42T  153K  /mnt/vol1
vol1/.system  1.12M  8.42T  166K  legacy
vol1/.system/configs-2fa742ae30da433ca735af52bcb65edb  153K  8.42T  153K  legacy
vol1/.system/cores  153K  8.42T  153K  legacy
vol1/.system/rrd-2fa742ae30da433ca735af52bcb65edb  153K  8.42T  153K  legacy
vol1/.system/samba4  243K  8.42T  243K  legacy
vol1/.system/syslog-2fa742ae30da433ca735af52bcb65edb  275K  8.42T  275K  legacy
vol1/ALL_ROOT  153K  8.42T  153K  /mnt/vol1/ALL_ROOT
vol1/MUSIC  153K  8.42T  153K  /mnt/mnt/vol1/ALL_ROOT/MUSIC
vol2  396K  899G  96K  /mnt/vol2
vol2/Downloads  96K  899G  96K  /mnt/vol2/Downloads


see? MUSIC was relocated from /mnt/vol1/ to /mnt/mnt/vol1/ ...
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
So how do you think the database gets updated with your changes from command line? There is actually a proper way to do this involving the GUI, but you need to search for renaming a pool, not mounting the data.
 

AndruXO

Dabbler
Joined
Jan 24, 2016
Messages
19
Yes, I think GUI just reads current state from the command line and displays it.
But the thing is that commands via command line get corrupted and I'd like to know why? I type my command and get the wrong result!
 

AndruXO

Dabbler
Joined
Jan 24, 2016
Messages
19
Great answer...
So is there any way to remount dataset to another folder? to another pool?
In terms of clean ZFS it is called filesystem and there is no problem to mount it to any location. But FreeNAS?..
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
I told you to search for RENAMING your pool/dataset, not mounting. I'm not going to do the work for you. There are instructions on these forums how to do it.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I know they are around here somewhere...
 

AndruXO

Dabbler
Joined
Jan 24, 2016
Messages
19
Yes, renaming is a good thing, but it works only inside one pool.
I want to gather datasets from different pools in one folder and share that folder with all my files in it (DFS analog).
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
This won't work the way you want it to. When you reboot you will lose your mount points.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Can you create a symlink (or similar) from your main shared dataset to the mountpoints of the other datasets?
 

AndruXO

Dabbler
Joined
Jan 24, 2016
Messages
19
Yes, I've created a symlink:
Code:
[root@freenas] /mnt/vol1/ALL_ROOT# ls -l
total 2
drwxr-xr-x  3 root  wheel   4 Jan 26 13:19 ./
drwxr-xr-x  3 root  wheel   3 Jan 26 12:40 ../
lrwxr-xr-x  1 root  wheel  19 Jan 26 13:19 Downloads@ -> /mnt/vol2/Downloads
drwxr-xr-x  2 root  wheel   2 Jan 26 12:40 Music/

but when I'm trying to enter the linked folder through the share I get something like "The process cannot access the file because it is being used by another process."
Maybe I'm doing somehting wrong... Please, any ideas??
 

jde

Explorer
Joined
Aug 1, 2015
Messages
93
Why not just setup the folder structure the way you want it and copy the data where you want it? Seems a lot safer than mucking around in the CLI and potentially losing your data. Don't get me wrong, I'm not trying to give you a hard time. Perhaps there is a compelling reason that I just don't understand.

@depasseg for some reason (I don't have a citation) I did not think it was possible to symlink between different pools.
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Why not just setup the folder structure the way you want it and copy the data where you want it? Seems a lot safer than mucking around in the CLI and potentially losing your data. Don't get me wrong, I'm not trying to give you a hard time. Perhaps there is a compelling reason that I just don't understand.
I'm guessing he doesn't have enough room in one pool to consolidate.

@depasseg for some reason (I don't have a citation) I did not think it was possible to symlink between different pools.
That could be true. I did a quick search prior to posting that idea. The symlink seems to be supported. I wasn't sure of the sharing. That could be the cause of the issue AndruXO experienced.
 

jde

Explorer
Joined
Aug 1, 2015
Messages
93

AndruXO

Dabbler
Joined
Jan 24, 2016
Messages
19
Thanks guys,
I googled a lot and it seems symlinks are not supported for the network shares. Client computers don't understand such links and moreover it's a potential security issue to have them working, so it's correct and by design.

As for my setup, depasseg is right, I have not enough room for all the data in one disk pool. But making a share for every pool... I find it a very strange solution
I'm trying to move from Nas4Free to FreeNas, and previously I had such a scheme there.

I even tried to share that strange folder that is automatically created: /mnt/mnt/vol1/ALL_ROOT/
But GUI won't let me share that folder:
WanKfh.png
the path to the folder is not accepted (see the figure attached).

I'm stucked, please any ideas to move forward?
 

Attachments

  • cifs_freenas.png
    cifs_freenas.png
    16.6 KB · Views: 217

jde

Explorer
Joined
Aug 1, 2015
Messages
93
Depending on how your pools are setup, and if you can temporarily move your data off of vol2, you might be able to create a new vdev from the disks vol2 currently resides upon and then stripe the new vdev with vol1 to create one large pool.

That's why I was asking how your pools are currently configured. Do you have the capability to temporarily store the contents of vol2 somewhere else?
 
Status
Not open for further replies.
Top