What are the default mount settings for mount / fstab?

Posted by John Craick on Ask Ubuntu See other posts from Ask Ubuntu or by John Craick
Published on 2012-08-31T15:38:09Z Indexed on 2012/08/31 15:52 UTC
Read the original article Hit count: 355

Filed under:
|
|

What are the default mounting options for a non root partition ?

The man entry for mount says ...

defaults - use default options: rw, suid, dev, exec, auto, nouser, and async.

... so that might be what we expect to see. But, unless I'm missing something, that's not what happens.

I have an ext3 partition labelled "NewHome20G" which is seen as /dev/sdc6 by the system. This we can see from ...

root@john-pc1204:~# blkid | grep NewHome20G
/dev/sdc6: LABEL="NewHome20G" UUID="d024bad5-906c-46c0-b7d4-812daf2c9628" TYPE="ext3" 

I have an entry in fstab as follows ...

root@john-pc1204:~# cat /etc/fstab | grep NewHome
LABEL=NewHome20G        /media/NewHome20G        ext3         rw,nosuid,nodev,exec,users     0  2

Note the option settings that are specified in that fstab line.

Now I look at how the partition is actually mounted after boot up ...

root@john-pc1204:~# mount -l | grep sdc6
/dev/sdc6 on /media/NewHome20G type ext3 (rw,noexec,nosuid,nodev) [NewHome20G]

... so, when the filesystem gets mounted the exec & users options I specified seem to have been ignored.

Just to be sure, I unmount sdc6, remount it and look at the mount options again ...

root@john-pc1204:~# umount /dev/sdc6
root@john-pc1204:~# mount /dev/sdc6
root@john-pc1204:~# mount -l | grep sdc6
/dev/sdc6 on /media/NewHome20G type ext3 (rw,noexec,nosuid,nodev) [NewHome20G]

.... same result

Now I unmount the partition again, remount it specifying the exec option and look at the result ...

root@john-pc1204:~# umount /dev/sdc6
root@john-pc1204:~# mount /dev/sdc6 -o exec
root@john-pc1204:~# mount -l | grep sdc6
/dev/sdc6 on /media/NewHome20G type ext3 (rw,nosuid,nodev) [NewHome20G]

... and here the exec option has finally taken effect and the noexec setting has vanished.

Just for interest, I re-mount the partition with the defaults option

root@john-pc1204:~# umount /dev/sdc6
root@john-pc1204:~# mount /dev/sdc6 -o defaults
root@john-pc1204:~# mount -l | grep sdc6
/dev/sdc6 on /media/NewHome20G type ext3 (rw,noexec,nosuid,nodev) [NewHome20G]

The noexec is back, so it looks very like rw,noexec,nosuid,nodev are the default options which is NOT what man says.

Why does this matter ?

I have a folder full of useful scripts stored on a data disk. Because that disk is mounted noexec those scripts won't run, even though they have all been set with chmod 777. I can work round this in several ways but it's disappointing that the man entry seems to be wrong.

Have I missed something obvious here or have the default options in Ubuntu changed from what they were a few versions ago ?

© Ask Ubuntu or respective owner

Related posts about mount

  • 12.10 update breaks NFS mount

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I've just upgraded to the latest 12.10 beta. Rebooted twice. The problem is with the NFS folders not mounting, here's a verbose log. # mount -v myserver:/nfs_shared/tools /tools/ mount: no type was given - I'll assume nfs because of the colon mount.nfs: timeout set for Mon Oct 1 11:42:28 2012 mount… >>> More

  • Mount SMB / AFP 13.10

    as seen on Ask Ubuntu - Search for 'Ask Ubuntu'
    I cannot seem to get Ubuntu to mount a mac share via SMB or AFP. I've tried the following... AFP: apt-get install afpfs-ng-utils mount_afp afp://user:password@localip/share /mnt/share Error given: "Could not connect, never got a reponse to getstatus, Connection timed out". Which is odd as I can… >>> More

  • Mount Return Code for CIFS mount

    as seen on Server Fault - Search for 'Server Fault'
    When I run the following command (as root or via sudo) from a bash script I get an exit status (or return code in mount man page parlance) of 1: mount -v -t cifs //nasbox/volume /tmpdir/ --verbose -o credentials=/root/cifsid & /tmp/mylog It outputs the following into the myflog file: parsing… >>> More

  • Disable raid member check upon mount to mount damaged nvidia raid1 member

    as seen on Server Fault - Search for 'Server Fault'
    Hi, A friend of mine destroyed his Nvidia RAID1 array somehow and in trying to fix it, he ended up with a non-working array. Because of the RAID metadata, the actual disk data was stored at an offset from the beginning. I was able to identify this offset with dd and a hexeditor and then I used losetup… >>> More

  • Network shares do not mount.

    as seen on Super User - Search for 'Super User'
    My network shares were mounting fine yesterday.. suddenly they are not. They were mounting fine for the last two weeks or however long since I added them. When I run sudo mount -a I get the following error: topsy@monolyth:~$ sudo mount -a mount error(12): Cannot allocate memory Refer to the mount… >>> More

Related posts about fstab