Tag Archives: mounting

Partitioning your Linux installation

When I bought my first SSD drive there was talk about setting it up in Linux so it may last longer. Nowadays, it doesn’t make much sense, but then it made me “properly” partition my Ubuntu install and I’ve been doing it ever since.

Here’s my fstab:

You can use

lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,UUID

to get a list of disks and UUIDs.

I mount all of the disks with noatime, telling the OS not to save file access times. noatime includes nodiratime, which is the same thing for directories.

I mount the SSDs with the discard option. This tells the SSD to use TRIM, and TRIM internally cleans disk pages. You should make sure your SSD supports it.

I mount the /tmp and /var/tmp into tmpfs. It’s a temporary file system that resides in memory or swap. It’s cleared on restart. Tried doing this with /var/log but since it’s cleared, you need to setup the logging, or create the folders yourself, or change the permissions.

I keep my /var/log and /var/www on a HDD. Tons of small files, and a lot of accesses by the web server.

All of my code is in /home/user/Workspace. I don’t like mounting the /home/user/ folder separately. It saves a lots of configuration options, which I like to dump on new installs, but would like to keep all the code I’ve been working on.

To be honest, with new SSDs you don’t have to do any of this. I have a laptop with only a SSD drive, and it works perfectly with discard,noatime.

Tagged , , , , , ,