21

On a clean Ubuntu 11.04 (Natty Narwhal) installation, I used just a single partition for everything. The line that got added in the fstab file is this

UUID=xxx     /      ext4    errors=remount-ro    0    1

Shouldn't there be a 'defaults' in there?

I've bumped into this while trying to move the home folder to a different partition. I've done it, and everything is working fine. I've added only errors=remount-ro in the fstab line for /home.

Now I'm in the process of 'securing' it, and choosing those options more wisely (like adding nodev and nosuid). So, do I need to add 'defaults' or not? Why is it not added?

Which specific options are the 'defaults' anyway in Natty Narwhal?

Do I need to add

UUID=xxx /home ext4 nodev,nosuid,errors=remount-ro 0 2

or

UUID=xxx /home ext4 defaults,nodev,nosuid,error=remount-ro 0 2

or something else?

Also, I've seen that relatime is in the defaults for Natty Narwhal. But are the defaults running if there is no mention of the defaults keyword in fstab and the 'mount' output?

1 Answer 1

20

As per man mount (if you use the option defaults):

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

When you use contradicting options (like defaults,noexec), the later will take precedence.

If you don't state any options, the default options in Ubuntu are rw,relatime.

5
  • 3
    So, to understand it better: When an entry has just errors=remount-ro does this translate to rw,relatime, errors=remount-ro or rw,suid,dev,exec,auto,nouser,async,errors=remount-ro? I was starting to get the impression that if 'defaults' is not explicitly mentioned, it is implied anyway, and it was removed from the fstab default configuration because of redundancy if other options exist.
    – george_k
    Commented Aug 1, 2011 at 14:20
  • 1
    The former, i.e. rw,relatime,errors=remount-ro. When you mount something, you can check its mount options by issuing the command mount or cat /proc/mounts.
    – arrange
    Commented Aug 1, 2011 at 18:14
  • 3
    Something is not right. I just tested it: When my fstab has nodev,nosuid,errors=remount-ro for /home, then cat /proc/mounts returns rw,nosuid,nodev,relatime,errors=remount-ro,barrier=1,data=ordered as options. If I edit the fstab and add the defaults keyword, so it is defaults,nodev,nosuid,errors=remount-ro then after a reboot, cat /proc/mounts returns exactly the same as the previously. The defaults when added to fstab changes nothing, at least in /proc/mounts. What is going on?
    – george_k
    Commented Aug 1, 2011 at 19:45
  • 2
    Hmm, you're right. As per man mount again: Some of these options could be enabled or disabled by default in the system kernel. To check the current setting see the options in /proc/mounts. It's better to list the desired options one by one and check its availability.
    – arrange
    Commented Aug 1, 2011 at 20:55
  • 1
    Also man 8 mount says for the error attribute available for ext2 that The default is set in the filesystem superblock, and can be changed using tune2fs(8) Commented Dec 25, 2013 at 6:44

You must log in to answer this question.

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