Page 1 of 1

Space in NAS folder name

Posted: Mon Apr 11, 2016 9:48 am
by Bert-Jan51
I'm new to this so I wondered if I should post here, or in the beginners forum. So if I have to relocate, please let me know.

I'm setting up a Raspberry Pi 2 with Raspbian as a download machine. For this to work I have to give it access to the folders on my NAS. I tried to mount the relevant folders; Music, Movies and TV Series.
The first two mount just fine and the content can be accessed by the Pi.
The last one does not mount. I use this line to mount the share:

//NAS/TV Series /home/pi/NAS/TV_Series cifs username=xxxx,password=xxxx,workgroup=xxxx,users,auto,user_xattr 0 0

This line gives an error telling me: 'mount: mount point Series does not exist'
I guess this has to do with the space in the 'TV Series' folder name. I can (and did) change it on the Pi, but since the NAS is tied in with other systems, it would be a pain if I had to change the name there too. Is there any way to mount this share without changing the name?

Thanks.

Bert-Jan

Re: Space in NAS folder name

Posted: Mon Apr 11, 2016 10:45 am
by karrika
There is essentially two ways to deal with spaces in names.

Escaping:
instead of /NAS/Tv and movies you escape the spaces /NAS/Tv\ and\ movies.

Parenthesis:
instead of /NAS/Tv and movies use "/NAS/Tv and movies"

I don't remember which ones work with fstab. You may need to use different quotes also like ' instead of " in some cases.

Re: Space in NAS folder name

Posted: Mon Apr 11, 2016 11:39 am
by Bert-Jan51
First of all, thanks for the quick reply. Didn't work yet, but that may be because I wrote the command in the first post incorrectly :oops: Should have been:

//192.168.1.2/TV Series /home/pi/NAS/TV_Series cifs username=xxxx,password=xxxx,workgroup=xxxx,users,auto,user_xattr 0 0

I tried the first option and replaced //192.168.1.2/TV Series with //192.168.1.2/TV\Series. Didn't work. Mounting just stops.

For the second option, being a n00b, I tried

"//192.168.1.2/TV Series"
'//192.168.1.2/TV Series'
//"192.168.1.2/TV Series"
//'192.168.1.2/TV Series'
//192.168.1.2/"TV Series"
//192.168.1.2/'TV Series'

Some of those options just returned the same error, some stopped the mounting process.
Like I said; being a n00b, it is quite possible I did something wrong. Is there anything else I could try?

Thanks.

Re: Space in NAS folder name

Posted: Mon Apr 11, 2016 11:41 am
by JimmyN
In fstab you can replace the space with "\040". So it would look like:

Code: Select all

//NAS/TV\040Series /home/pi/NAS/TV_Series cifs username=xxxx,password=xxxx,.....

Re: Space in NAS folder name

Posted: Mon Apr 11, 2016 11:52 am
by Bert-Jan51
That worked! Adding \040 resolved the error. The content of the share is now accessible in the Pi. :)
Thanks for the lightning quick replies!

Thanks,

Bert-Jan