mount on busybox: invalid argument when trying to mount smb share

4

0

I am trying to mount a smb share on my embedded Linux running on ARM (3.6.9) with busybox 1.21

mount -t cifs //192.168.0.12/mydata /mnt/myData 

results in an invalid argument error:

mount: mounting /192.168.0.12/mydata/ on /mnt/myData failed: Invalid argument

CIFS support is definetly installed and the directories exist. Is there any syntax difference in busybox's mount command? Thank in advance!

tzippy

Posted 2013-06-24T07:09:00.470

Reputation: 404

2Just double checking that CIFS support is installed, does the file /sbin/mount.cifs exist? – Cristian Ciupitu – 2014-06-29T00:08:25.027

Can you please give the exact error message? And where is the user option mentioned in the question title in your command? Oh, and where do you give the username/password for this share? – mpy – 2013-06-24T07:12:53.780

Sorry, I messed up. Wrote the title when I still had a different error message. – tzippy – 2013-06-24T07:16:05.203

With busybox v1.1.3 this command succeeds: mount -t cifs //192.168.1.11/Files /mnt/files -o username=windows_user,password=windows_pwd, so obviously no general problem. Does the mount command with increased verbosity -vvv give some more hints? – mpy – 2013-06-24T19:16:06.660

Answers

1

The clue is in the output:

mount: mounting /192.168.0.12/mydata/ on /mnt/myData failed: Invalid argument

Shares are not referenced starting with a single /.

For CIFS shares you need to use backslashes. You then need to double up these to escape them, otherwise the shell thinks they have a special meaning.

Try:

mount -t cifs \\\\192.168.0.12\\mydata /mnt/myData

deed02392

Posted 2013-06-24T07:09:00.470

Reputation: 2 662

1

In order to mount CIFS volumes, the mount command needs to prepare a bit of extra information for the kernel, which is why you have to use a special mount.cifs command for that. The regular mount command will automatically defer to that as long as it is installed, so you don't normally see that.

Simon Richter

Posted 2013-06-24T07:09:00.470

Reputation: 2 384

0

As mpy commented to the original question,

mount -t cifs //192.168.1.11/Files /mnt/files -o username=windows_user,password=windows_pwd

is doing the job. Just append the -o part to your command.

BusyBox v1.8.1

I also wanted to mention, that on my embedded system there is no mount.cifs available and anyway it works.

catweazle

Posted 2013-06-24T07:09:00.470

Reputation: 1

-1

Just put some quotes around the directory to escape the slashes. Also handy if there are spaces in directory names.

mount -t cifs '//192.168.1.123/Mateo Disk'  /dev/myData -o username=alison,password=monkey

Mreider

Posted 2013-06-24T07:09:00.470

Reputation: 1

Slash / is not a special character for shell. It does not need to be escaped. (Space is a special character.) – pabouk – 2015-05-31T09:31:56.523