Archive for the tag 'file system'

SBDavid

Control mounting a file system

Control mounting a file system

You can have more control on mounting a file system like /home and /tmp partitions with some nifty options like noexec, nodev, and nosuid. This can be setup in the /etc/fstab text file. The fstab file contains descriptive information about the various file systems mount options; each line addresses one file system.

Details regarding to security options in the fstab text are:

defaults: Allow everything quota, read-write, and suid on this partition.
noquota: Do not set users quotas on this partition.
nosuid: Do not set SUID/SGID access on this partition.
nodev: Do not set character or special devices access on this partition.
noexec: Do not set execution of any binaries on this partition.
quota: Allow users quotas on this partition.
ro: Allow read-only on this partition.
rw: Allow read-write on this partition.
suid: Allow SUID/SGID access on this partition.

More information can be found in the mount(8) man pages

Disable journaling in ext3 file system

We know that EXT3 file system is nothing but EXT2 + a e. This allows faster FSCK process and avoids metadata corruption.

We can disable journaling (i.e convert EXT3 to EXT2) using tune2fs command.

tune2fs -O^has_journal /dev/xdy

Now the journaling is removed from /dev/xdy partition. The file system for this partition is know EXT2 rather than EXT3.

This is normally used when you want to re-size a partition.

If you want to convert it back to EXT3, use the following command:

tune2fs -j /dev/xdy

Note: The partition should be un-mounted before converting the file-systems. For converting EXT2 to EXT3 you can also have the partition re-mounted as read-only too, but the former is safer.