22

I'm maintaining a heterogeneous network of mac and linux so I decided to create a little perl script to unify mounting strategies across machines.

The current implementation in linux is in /etc/fstab works fine:

//myserverhere.com/cifs_share /mnt/cifs_share cifs user,uid=65001,rw,workgroup=DEV,credentials=/root/.cifs 0 0

and /root/.cifs contains

username=ouruser
password=ourpassword

I tried translating that to a non-fstab format as follows:

mount.cifs //myserverhere.com/cifs_share /mnt/cifs_share user,uid=65001,rw,workgroup=DEV,credentials=/root/.cifs

But it doesn't seem to work.

Can someone point out what I'm doing wrong please?

Thanks in advance.

Ismael Casimpan :)

0

3 Answers 3

28

Syntax of mount.cifs:

mount.cifs {service} {mount-point} [-o options] 

You need to pass the options after the "-o". For example, with your given options, your command should be:

mount.cifs //myserverhere.com/cifs_share /mnt/cifs_share \
    -o user,uid=65001,rw,workgroup=DEV,credentials=/root/.cifs

(I didn't test the options you gave.)

2
  • the '-o' was the one I forgot. Thanks for pointing out. I tried it and it now works. Thank you so much :)
    – icasimpan
    Mar 9, 2012 at 8:15
  • Also make sure that the credentials text file does NOT contain a byte order mark (BOM) when using UTF-8. Otherwise you will get a strange "Credential formatted incorrectly" message from mount/mount.cifs. Jan 10, 2018 at 10:23
0

-o vers=1.0 option with mount fixed my issue. After an upgrade of RHEL from 7.4 to 7.7, looks like the SMB protocol version changed. Specify the version to match with the cifs server version.

1
  • Version 1.0 means classic CIFS/SMBv1 protocol which is used by Windows versions older than Windows 7 or Windows Server 2008. I guess RHEL/Samba tried to stop you from using it after an update. Update your Windows!!!1!
    – thomas
    Dec 3, 2021 at 19:35
0

The error I got was this one: mount error(5): Input/output error Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

-o vers=3.0 option with mount fixed my issue. I didn't upgrade my server, but my client did and did not inform me about.

-o vers=1.0 option works too as I tested right now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .