How to mount a cifs drive in fstab. mount error(22)

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
dallinatorX

How to mount a cifs drive in fstab. mount error(22)

Post by dallinatorX »

So, I have been trying to mount a drive from my NAS to install steam games on.
I have tried a bunch of things from other posts but it always comes back to error 22.
This is the line I currently have in the fstab. The "*" ate there to respent my password.

Code: Select all

//192.168.0.115/test  /media/Network_Drive/   cifs  uid=0,guid=0,rw,username=dallinatorx,password=******   0   0
All I get back is

Code: Select all

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: How to mount a cifs drive in fstab. mount error(22)

Post by altair4 »

It would make life so much easier if the damn error message would tell the user what argument it found invalid.

My guess is it's guid=0 since there is no such thing as guid. Change it to gid=0 .

Not sure why you would want to mount it with root as owner and group but maybe you have your reasons.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
dallinatorX

Re: How to mount a cifs drive in fstab. mount error(22)

Post by dallinatorX »

Sorry, I am still fairly new to this. I would like to mount it just for my user not for root. So if I need to change it to do that just tell me what to do. Also, I am at school I will test when I get home.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: How to mount a cifs drive in fstab. mount error(22)

Post by altair4 »

Code: Select all

//192.168.0.115/test  /media/Network_Drive/   cifs  uid=altair,rw,username=dallinatorx,password=******   0   0
Change "altair" to your own linux user name and it will mount with you as owner.

Note: NAS devices are a real pain because some are state of the art and some belong with Win98 so you may need some other options:

If your NAS is running an antique version of Samba you may need to add: sec=ntlm
And depending on how it's set up you may even need something like: nounix

Code: Select all

//192.168.0.115/test  /media/Network_Drive/   cifs  uid=altair,rw,username=dallinatorx,password=******,sec=ntlm,nounix   0   0
It's a trial end error process to get the right set of options.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
dallinatorX

Re: How to mount a cifs drive in fstab. mount error(22)

Post by dallinatorX »

Good News. It is mounting like it should.
So I have been trying to use this to store my steam games. But I still get the error that I need execute permissions. Would you have any clue why? I am using FreeNAS. So would I need to change something in there or on my computer? If the former I will go try on the FreeNAS forums.
fstab

Code: Select all

//192.168.0.115/test  /media/Network_Drive   cifs  rw,username=dallinatorx,password=********,exec,users,uid=dallinatorx   0   0
I also have changed me to the owner with chown and change permissions with chmod to 700.
Thanks
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: How to mount a cifs drive in fstab. mount error(22)

Post by altair4 »

What I would do first is remove the exec and users options. You don't need either and besides the "users" option turns off the "exec" option.

Code: Select all

//192.168.0.115/test  /media/Network_Drive   cifs  rw,username=dallinatorx,password=********,uid=dallinatorx   0   0
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: How to mount a cifs drive in fstab. mount error(22)

Post by altair4 »

Did a quick search and found something interesting on the Arch wiki: https://wiki.archlinux.org/index.php/St ... leshooting
Steam client issues
Cannot add library folder because of missing execute permissions

If you add another Steam library folder on another drive, you might get the error message:
New Steam library folder must be on a filesystem mounted with execute permissions
Make sure you are mounting the filesystem with the correct flags in your /etc/fstab, usually by adding exec to the list of mount parameter. The parameter must occur after any user or users parameter since these can imply noexec.

This error might also occur if your library folder does not contain a steamapps directory. Previous versions used SteamApps instead, so ensure the name is fully lowercase.
It's talking about another internal partition not a samba share but you might want to take more control of the mount with something like this:

Code: Select all

//192.168.0.115/test  /media/Network_Drive/   cifs  uid=dallinatorx,username=dallinatorx,password=******,dir_mode=0777,file_mode=0777,nounix   0   0
I can't comment on this part of the quote but maybe it means something to you:
This error might also occur if your library folder does not contain a steamapps directory. Previous versions used SteamApps instead, so ensure the name is fully lowercase.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Locked

Return to “Other topics”