5 Comments

A Beautiful fstab

I know what partitions I have and like to know what is mounted and where. To do this, I keep a tidy static filesystem file (/etc/fstab).

I use labels instead of UUID’s just because they look nicer, but also because this allows me to resize them if need be. It’s hard to go wrong with UUID’s but since I know I likely won’t be putting a USB drive named ‘Windows’ or ‘Ubuntu’ in the USB port, I’m likely pretty safe. You may have noticed too that I choose not let HAL/DBUS (is it dbus that does mounting now?) handle my Windows and Storage partitions. I choose to do this for several reasons. One is because when I copy files I almost always find it much quicker from the command line (i.e. cp file1 file2 ... /mnt/Storage/backups/) rather than navigate through multiple directories in the file browser. The second reason is for security because sensitive data I don’t always want available. The third is to protect the Windows partition. If a crash were to happen, I find it a good inconvenience to have to boot Windows to be able to fix the NTFS volume.

Here it is:

# /etc/fstab: static file system information
#
# <file system>          <dir>        <type>  <options>           <dump/pass>
# Temporary file systems:
tmpfs                    /tmp         tmpfs   nodev,nosuid                0 0

# Internal hard disk (sda[2,3,5,6,7]): 
LABEL=SYSTEM\040RESERVED /mnt/SR      ntfs-3g noatime,noauto,user         0 0
LABEL=ACER               /mnt/Windows ntfs-3g noatime,noauto,user         0 0
LABEL=Arch               /            ext4    errors=remount-ro,noatime   0 1
LABEL=Home               /home        ext4    noatime                     0 2
LABEL=Swap               swap         none    defaults                    0 0

# External hard disk (sdb1)
LABEL=Backup             /mnt/Backup  ext4    noatime,noauto,user         0 3

noatime has been applied to save disk writes and unnecessary timestamps everytime the file is accessed, and the user option allows me to mount without superuser privileges. For the Windows partition to be able mounted as a regular user, the NTFS-3G driver will need to be compiled with internal FUSE support.

About these ads

About Todd Partridge (Gently)

Good times, good people, good fun.

5 comments on “A Beautiful fstab

  1. To make it even nicer you could remove the first line “proc …” as that is done unconditionally by your initramfs or init system.

  2. one day we shall see the fstab in xml.

  3. How about some instruction on how to check for and create LABELs for the various file system and drive types?

  4. The /home partition will need user,exec,dev,suid if it’s used for development and building/testing software.

    fstab in JSON FTW!

  5. mconstable :

    How about some instruction on how to check for and create LABELs for the various file system and drive types?

    Yeah, I thought about that but I use GParted which does a good job of that.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 52 other followers

%d bloggers like this: