Rename a shared folder?

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
I want to rename one of my shared folders on FreeNAS, because it has a space in the name, and fstab in linux baulks at that .
Or is there a way of fstab accepting the space in the name so it can be mounted.

I have tried mv to rename the folder, but FreeNAS says the new name is not a Directory.
I should add that the said folder is part of or a dataset
Thanks
 
Last edited:
Joined
Jan 7, 2015
Messages
1,155
"Wrap your entire path in quotes"
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
In my fstab file, I have //my ipaddress/thisfolder "/mnt/path/to/this folder"

Mounts thisfolder, but does not mount any content
 
Joined
Jan 7, 2015
Messages
1,155
Can I see your fstab?
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
As requested:

UUID=ed3c0ff2-02bc-43d9-b676-4bdf1577d172 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
//192.168.0.22/OldPhotos "/mnt/WinShare/Media/Old Photos" cifs credentials=/home/rob/.smbclient
UUID=bbfaeb41-32e9-415e-97a1-7524004d31cb /home ext4 defaults 0 2
UUID=ed3c0ff2-02bc-43d9-b676-4bdf1577d172 /backups ext4 defaults 0 2
 
Joined
Jan 7, 2015
Messages
1,155
As requested:

UUID=ed3c0ff2-02bc-43d9-b676-4bdf1577d172 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
//192.168.0.22/OldPhotos "/mnt/WinShare/Media/Old Photos" cifs credentials=/home/rob/.smbclient
UUID=bbfaeb41-32e9-415e-97a1-7524004d31cb /home ext4 defaults 0 2
UUID=ed3c0ff2-02bc-43d9-b676-4bdf1577d172 /backups ext4 defaults 0 2

Is 192.168.0.22 a remote machine or the local NAS?
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
It's to my FreeNAS server.
 
Joined
Jan 7, 2015
Messages
1,155
You are trying to mount this "OldPhotos" from the FreeNAS host to a freenas jail? The same machine?
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
No , sorry for lack of information.
I am trying to mount the said folder, Old Photos on the NAS server, to a local ubuntu computer. This so I can view the files from any local linux computer
 
Joined
Jan 7, 2015
Messages
1,155
So on the linux machine does it mount properly from the cli with
Code:

sudo mount -t cifs //192.168.0.22/OldPhotos/ "/mnt/WinShare/Media/Old Photos/" -o user=rob
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
You may also try:
//192.168.0.22/OldPhotos /mnt/WinShare/Media/Old\040Photos cifs credentials=/home/rob/.smbclient
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
rob@rob-Z97:~$ sudo mount -t cifs //192.168.0.22/OldPhotos/ "/mnt/WinShare/Media/Old Photos" -o user=rob
[sudo] password for rob:
Couldn't chdir to /mnt/WinShare/Media/Old Photos: No such file or directory

The directory is there:
/mnt/WinShare/Media/Old Photos

If it wasn't there I wouldn't want to mount it!!!

rob@rob-Z97:~$ //192.168.0.22/OldPhotos /mnt/WinShare/Media/Old\040Photos cifs credentials=/home/rob/.smbclient
bash: //192.168.0.22/OldPhotos: No such file or directory
 
Last edited:

rvassar

Guru
Joined
May 2, 2018
Messages
972
rob@rob-Z97:~$ //192.168.0.22/OldPhotos /mnt/WinShare/Media/Old\040Photos cifs credentials=/home/rob/.smbclient
bash: //192.168.0.22/OldPhotos: No such file or directory

That was the line from your fstab with a space embedded as an escaped character. It's not executable as a command.
 
Joined
Jan 7, 2015
Messages
1,155
Also I meant to say you can rename the zfs "Old Photos" dataset with the zfs rename command if you want to get rid of the space. Just remember to change it everywhere that dataset is specified in sharing, replication, snapshots etc.

rob@rob-Z97:~$ sudo mount -t cifs //192.168.0.22/OldPhotos/ "/mnt/WinShare/Media/Old Photos" -o user=rob
[sudo] password for rob:
Couldn't chdir to /mnt/WinShare/Media/Old Films: No such file or directory

The directory is there:
/mnt/WinShare/Media/Old Photos

If it wasn't there I wouldn't want to mount it!!!

Couldn't chdir to /mnt/WinShare/Media/Old Films: No such file or directory
Where did "Old Films" come from? That is saying the directory doesnt exist. So if you type this on Ubuntu cd "/mnt/WinShare/Media/Old Photos" You are in this directory, on the Ubuntu machine?
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
I issued the said line in a terminal on my ubuntu machine, so if it is not executable as a command, where should I use it.
 

avalon60

Guru
Joined
Jan 15, 2014
Messages
597
Also I meant to say you can rename the zfs "Old Photos" dataset with the zfs rename command if you want to get rid of the space. Just remember to change it everywhere that dataset is specified in sharing, replication, snapshots etc.




Where did "Old Films" come from? That is saying the directory doesnt exist. So if you type this on Ubuntu cd "/mnt/WinShare/Media/Old Photos" You are in this directory, on the Ubuntu machine?

No, I'm not in that directory on my ubuntu machine, as I issued the command in a terminal.

Oops yes wrong line.
rob@rob-Z97:~$ sudo mount -t cifs //192.168.0.22/OldPhotos/ "/mnt/WinShare/Media/Old Photos" -o user=rob
Couldn't chdir to /mnt/WinShare/Media/Old Photos: No such file or directory

Where in FreeNAS should I rename the zfs "OldPhotos" dataset with the zfs rename command... a shell?

I have just tried mv in a shell:
[root@freenas /mnt/WinShare/Media]# mv Old Films OldFilms
mv: OldFilms is not a directory

I must be doing something wrong, I guess
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
As requested:

UUID=ed3c0ff2-02bc-43d9-b676-4bdf1577d172 / ext4 errors=remount-ro 0 1
/swapfile none swap sw 0 0
//192.168.0.22/OldPhotos "/mnt/WinShare/Media/Old Photos" cifs credentials=/home/rob/.smbclient
UUID=bbfaeb41-32e9-415e-97a1-7524004d31cb /home ext4 defaults 0 2
UUID=ed3c0ff2-02bc-43d9-b676-4bdf1577d172 /backups ext4 defaults 0 2

I edited the "//192.168.0.22" line in your fstab to insert an escaped space. You stick the "\040" where the space is in the mount point field.
 
Joined
Jan 7, 2015
Messages
1,155
Im very confused. This "/mnt/WinShare/Media/Old Photos" is a directory on the Ubuntu machine you will be mounting //192.168.0.22/OldPhotos/ to. They are not both directories on the FreeNAS host. Also any time you want to use a space in Unix you have to escape the character "/040" or wrap it in quotes mv "Old Films" OldFilms
 

rvassar

Guru
Joined
May 2, 2018
Messages
972
Im very confused. This "/mnt/WinShare/Media/Old Photos" is a directory on the Ubuntu machine you will be mounting //192.168.0.22/OldPhotos/ to. They are not both directories on the FreeNAS host. Also any time you want to use a space in Unix you have to escape the character "/040" or wrap it in quotes mv "Old Films" OldFilms

I'm not sure the quotes will work in /etc/fstab. And note, it \040 not /040...
 
Joined
Jan 7, 2015
Messages
1,155
I avoid spaces, learned that a long time ago. My advice now is to create the directory on Ubuntu from an Ubuntu terminal sudo mkdir -p /media/old_photos then mount the directory from FreeNAS to this directory using sudo mount -t cifs //192.168.0.22/OldPhotos/ /media/old_photos -o user=rob
 
Top