Skip to content

Filesystem types#

There are some core file system types you're going to see during your day-to-day operations:

  • EXT2, EXT3 and EXT4
  • XFS (rare)
  • NFS (Windows)

The most common you're going to see in use is EXT3 and EXT4.

If we look at a default Ubuntu 20.04 server in AWS, we have the following filesystems mounted: mount

1
2
~$ mount
/dev/xvda1 on / type ext4 (rw,relatime,discard)

If you run the mount command on your system you'll get loads of results. I've stripped these out and I'm only focusing on actual filesystems and not the temporary file systems that do special things, things we can ignore for now.

I have a single device attached to my server called xvda1 (/dev/ is the location of the device.) Technically the device is xvda and the 1 represents the first partition on the device. We'll cover that later.

My device, xvda1 is mounted at the following location on the filesystem: /, or the root. This one drive represents the entire Linux filesystem on my Ubuntu server. You would say that / is being backed by the xvda1 partition on the xvda device.

This will give us a tree like structure:

Linux filesystem tree

Linux filesystem tree
(Dhanusha Dhananjaya, CC BY-SA 4.0, via Wikimedia Commons)

This is a very minimal example. In reality you'll have tens of thousands of files and directories on a default, minimal Ubuntu installation.

Note

The / being "root" and having a directory called /root can be confusing, but the / is the literal, somewhat "physical" root and /root is the home directory of the root user.

In the diagram, each item "under" / is just a directory. It's possible, however, that /var (or some other location) can also be a mount point and backed by a different device or partition on the same device. You'd do this for various reasons, reasons we'll explore in "ITOps Level Two".

Finally we can see that this file system is of type ext4 (type ext4). This all means a disk drive was attached to the Linux system and given the label (by the kernel) xvda. It was then partitioned to provide just one partition, giving us xvda1. This partition ws then formatted and the EXT4 filesystem was written to the partition. This filesystem was then mounted to /, giving us (the end user) access to the underlaying disk in a user friendly manner.

Without filesystems, we'd have to manually read/write data from/to the disk and keep track of where files where (which are made up of blocks... it gets complicated, fast.)