Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to modify/redefine linux mount defaults option?

For example, having a fstab like this:

# / was on /dev/sda8 during installation
UUID=669cb10d /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda7 during installation
UUID=43e81f24 /home           ext4    defaults        0       2

Is it possible to redefine the "defaults" option?

I know that it's usually defined like this:

defaults: rw, suid, dev, exec, auto, nouser, and async. see man mount

share|improve this question

migrated from stackoverflow.com Nov 8 '12 at 15:49

This question came from our site for professional and enthusiast programmers.

2 Answers 2

There seems to be some support for setting default mount options for ext4 using tune2fs.

The syntax is something like tune2fs -E mount_opts=.. device

More info here http://en.wikipedia.org/wiki/Fstab and in man tune2fs

share|improve this answer
1  
Yes, something like this is what I was looking for. Although it's not enough for my need... "superblock setting is only honored in 2.6.35+ kernels; and not at all by the ext2 and ext3 file system drivers." –  kikeenrique Jun 24 '13 at 8:15

You can define options for mounting block devices in /etc/fstab.

for example:

# /etc/fstab: static file system information.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#

#                           

LABEL=geee      /       ext4        relatime    0 1
LABEL=usr       /usr        ext4        relatime    0 2
LABEL=var       /var        ext4        relatime    0 2
LABEL=portage       /usr/portage    reiserfs    noatime     0 0
#LABEL=it2901       /it2901     ext4        relatime    0 2
LABEL=home      /home       ext4        relatime    0 2
LABEL=boot      /boot       ext3        noatime     0 2
/dev/sda1       /mnt/win    ntfs-3g uid=1512,umask=0022     0 0
/dev/sda3       /mnt/media  ntfs-3g uid=1512,umask=0022 0 0
/mnt/media/media    /media      none        bind        0 0
/dev/sda6       none        swap        sw      0 0

#/dev/sda5      /mnt/ubuntu     ext3        noatime     0 0
#/mnt/ubuntu/boot   /boot       none        bind        0 0
/mnt/media/root-extension/usr/share/doc /usr/share/doc none bind    0 0

genja.lan:/R/tmp        /R/tmp      nfs         noauto,nfsvers=3,soft,intr 0 0
#genja.lan:/R/es2       /R/es2      nfs         noauto,soft,intr 0 0
#genja.lan:/R/mirror    /R/mirror   nfs         noauto,soft,intr 0 0
##raptor.lan:/usr/portage /usr/portage  nfs         noauto,soft,intr 0 0
tryggve.lan:/R/tb   /R/tb       nfs         noauto,nfsvers=3,soft,intr 0 0
#tryggve.lan:/R/audio   /R/audio    nfs         noauto,soft,intr 0 0

tmpfs           /tmp        tmpfs size=200M,nodev,nosuid,noexec 0 0
shm         /dev/shm    tmpfs       nodev,nosuid,noexec 0 0

gentoo fstab

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.