1

On a Linux system, I used the following command to mount a Windows Share folder:

mount.cifs -o user=xxxx,pass=xxxx '//host/folder' /mnt  

Above command finished without giving any errors or output at all. I could see files in /mnt, which means the mount was successful. Then I ran command mount, and the 1st line of the output says:

[mntent]: line 14 in /etc/mtab is bad  

And the share folder I just mounted doesn't appear in the output.

Then I checked the content of /etc/mtab and found that there are a whole lot of options for the just mounted share. like this:
enter image description here

While on another Linux Machine running the same OS(SLE 11SP3), I did the exact same thing(but using a different share on a different Windows machine), but the content in /etc/mtab is very simple, like this(and mount shows the mounted share correctly and doesn't say mtab is bad):

//server/folder /mnt cifs rw 0 0 

So the question is, on the 1st machine:
1. why are there so many option for this windows share in /etc/mtab?
2. why does the mount command say "mtab is bad"?

4
  • No idea why the same mount on identical OSs would give different mtab entries, but it looks like in the first case mount is complaining because the blank in the folder name is making it miscount the fields on that line. Apr 27, 2016 at 7:17
  • Thanks for comment. the black in the folder name appears in option unc=\\xxx\xxx. I definitely didn't specify such an option, no idea why it's there. In the 1st field of line 14 of mtab, the blank is replaced by \040. Apr 27, 2016 at 7:21
  • 1
    that image is unreadable due to tiny tiny fonts. please don't post images, copy and paste the text.
    – cas
    Apr 27, 2016 at 8:22
  • Is there an entry in /etc/fstab that also mounts /mnt or something under it? Apr 27, 2016 at 17:11

1 Answer 1

0

Someone added a lot of option for that share or that entry was created automatically. It is saying "mtab is bad" because one or some of the options is not correct.
For instance, the option unc=\\...\abc abc contains a space character, you should quote that value. Options are separated by comma, a space in one of the values will end the "options" field.
You can try to replace that line from mtab with just :

//server/folder /mnt cifs rw,user=xxxx,pass=xxxx 0 0
1
  • Someone added a lot of option for that share., how? mtab in generated by the system on the fly, not sure If it should be manually edited but my guess is NO. Apr 27, 2016 at 7:22

You must log in to answer this question.

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