Bert-Jan51
Posts: 4
Joined: Mon Apr 11, 2016 9:32 am

Space in NAS folder name

Mon Apr 11, 2016 9:48 am

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

User avatar
karrika
Posts: 1125
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Space in NAS folder name

Mon Apr 11, 2016 10:45 am

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.

Bert-Jan51
Posts: 4
Joined: Mon Apr 11, 2016 9:32 am

Re: Space in NAS folder name

Mon Apr 11, 2016 11:39 am

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.
Last edited by Bert-Jan51 on Mon Apr 11, 2016 11:47 am, edited 1 time in total.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Space in NAS folder name

Mon Apr 11, 2016 11:41 am

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,.....

Bert-Jan51
Posts: 4
Joined: Mon Apr 11, 2016 9:32 am

Re: Space in NAS folder name

Mon Apr 11, 2016 11:52 am

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

Return to “Troubleshooting”