LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-16-2014, 09:55 PM   #1
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Rep: Reputation: 7
Can't access mounted Windows shared containing space


Hey all, I'm trying to automate a process for copying some Windows files to a Linux server. I can mount the share, and I can access all folders in the share except one -- the folder with a space in the name. Here are my mount and copy lines:

Code:
mount -t cifs //192.168.2.29/shares -o username=Name,password=Pass /mnt/Windows
cp -r "/mnt/Windows/Not Shared/*" /mnt/raid1/WinStuff/NotShared
I tried getting into the share and here's that error:

Code:
root@srvBackup:/mnt/Windows# cd "Not Shared"
root@srvBackup:/mnt/Windows/Not Shared# ls -l
ls: reading directory .: Permission denied
total 0
root@srvBackup:/mnt/Windows/Not Shared#
Permissions are set the same in all folders. In my cp line I've tried different ways of using the quote marks but no joy. Anyone have any ideas on what I'm doing wrong? Can this even be done?

Thanks,

Joe B
 
Old 01-17-2014, 02:55 PM   #2
RootMason
Member
 
Registered: Oct 2012
Location: Tucson, AZ
Distribution: Debian/CentOS
Posts: 124

Rep: Reputation: 5
Hey buddy!

Not sure I have an exact answer here, but the first idea I have off the top of my head would be to use the \ escape character in your cp line.

cp -r "/mnt/Windows/Not\ Shared/*" /mnt/raid1/WinStuff/NotShared

Steve
 
Old 01-17-2014, 03:11 PM   #3
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Hey RootMason, I gave it a try but my server doesn't like that combination:

Code:
root@srvBackup:/home/jobee/bin# cp -r "/mnt/Windows/Not\ Shared/*.*" /mnt/raid1/WinStuff/NotShared
cp: cannot stat `/mnt/Windows/Not\\ Shared/*.*': Invalid argument
root@srvBackup:/home/jobee/bin#
I tried it again by just using quote marks around Not Shared but still no joy. Any other ideas?

Thanks,

Joe B
 
Old 01-18-2014, 01:01 AM   #4
RootMason
Member
 
Registered: Oct 2012
Location: Tucson, AZ
Distribution: Debian/CentOS
Posts: 124

Rep: Reputation: 5
It looks like we may have made a bit of progress, at least we got it to recognize the path! The Invalid Argument should have something to do with your -r. Can you try a cp -R instead, or have you already tried that? There's plenty of debate over the difference, but it *should* be that -r will recursively copy files, and -R should recursively copy directories.

What OS are you using?
 
Old 01-18-2014, 01:05 AM   #5
RootMason
Member
 
Registered: Oct 2012
Location: Tucson, AZ
Distribution: Debian/CentOS
Posts: 124

Rep: Reputation: 5
Oh, and is it possible to just change the Windows directory to be camel-case instead of having the space? That would certainly expedite trying to track down the source of the problem, though I'm fairly sure there must be a reason you haven't already.
 
Old 01-18-2014, 10:00 AM   #6
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
RootMason, using -R didn't help:

Code:
root@srvBackup:/home/jobee/bin# cp -R "/mnt/Windows/Not Shared/*.*" /mnt/raid1/WinStuff/NotShared
cp: cannot stat `/mnt/Windows/Not Shared/*.*': No such file or directory
root@srvBackup:/home/jobee/bin# cp -R "/mnt/Windows/Not\ Shared/*.*" /mnt/raid1/WinStuff/NotShared
cp: cannot stat `/mnt/Windows/Not\\ Shared/*.*': Invalid argument
root@srvBackup:/home/jobee/bin# cp -R "/mnt/Windows/Not\ Shared/*" /mnt/raid1/WinStuff/NotShared
cp: cannot stat `/mnt/Windows/Not\\ Shared/*': Invalid argument
root@srvBackup:/home/jobee/bin# cp -R /mnt/Windows/"Not\ Shared"/* /mnt/raid1/WinStuff/NotShared
cp: cannot stat `/mnt/Windows/Not\\ Shared/*': Invalid argument
root@srvBackup:/home/jobee/bin#
I even tried moving the quote marks again just in case.

As to using CamelCase, I inherited this system so I'm not keen on making any changes like that; I don't know what is out there that it might break. I have thought about it a few times, and maybe down the road I'll just dive in and do it.

Thanks,

Joe B
 
Old 01-18-2014, 12:20 PM   #7
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
you have a \\ instead of a single \ that is your problem. remove the second \ and it should work.
 
Old 01-30-2014, 11:15 PM   #8
jbruyet
Member
 
Registered: Feb 2011
Location: North Central Washington
Distribution: Debian, OpenSUSE, Kali, Ubuntu
Posts: 178

Original Poster
Rep: Reputation: 7
Hi lleb, the second whack is only showing up in the error message. If you look again you'll see that in the command I'm only using one whack.

Thanks,

Joe B
 
Old 01-31-2014, 09:56 AM   #9
r41d3n
Member
 
Registered: Mar 2013
Distribution: Debian
Posts: 42

Rep: Reputation: Disabled
Try again without the quotes ("") but only with \ before the space, like this:

/mnt/Windows/Not\ Shared/*
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't access mounted windows share hawk__0 Linux - Networking 1 01-06-2010 04:35 PM
write access on mounted windows parition jaymoney Ubuntu 14 07-29-2006 08:15 PM
Access to Windows shared CD-RW sixerjman Linux - Hardware 5 07-25-2006 06:57 PM
NFS access to mounted windows harddrives uswong Linux - Networking 1 02-17-2004 01:01 PM
changing access to mounted shared drive shycalais Linux - Newbie 4 11-11-2003 04:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration