Ubuntu – Do I use ext4 for all partitions (such as / and /boot)? What are the other formats used for

12.04ext4installationpartitioningssd

I'm installing ubuntu onto a new laptop with 24gb SSD and a 500gb HDD. I wanted to put / and swap onto the SSD and /home onto the HDD. Is there anything I shouldn't use ext4 for?

I do not ever intend to dual boot. Ubuntu only.

Best Answer

Swap space doesn't use a filesystem at all. For regular filesystem partitions, my thoughts are:

  • Ext2fs -- This is the major surviving non-journaled Linux-native filesystem, and as such it has limited utility. I'd only recommend it on a small partition (such as a separate /boot partition or possibly a small USB flash drive), where the journal will be more of a detriment than an advantage.
  • Ext3fs -- This is ext2fs plus a journal, which reduces disk-check times after a power failure or system crash. Ext3fs used to be a decent choice, but it's been pretty well eclipsed by ext4fs these days....
  • Ext4fs -- This is ext3fs plus some new features that improve performance and enable use on larger disks. It's probably the best general-purpose filesystem for Linux these days; certainly it's the one that most distributions favor by default.
  • ReiserFS -- This filesystem is roughly comparable to ext3fs in features. Its main standout point is that it's especially good at handling small files (as in a few kilobytes, or even under a kilobyte). If you happen to be storing lots of dinky files, it's still worth considering. OTOH, it's not a "hot" filesystem, so development is slow, and ReiserFS lacks the advanced features found in ext4fs and the later filesystems on this list. A variant, Reiser4, promises such features but has been very slow in materializing as an actual in-kernel filesystem. I'm not holding my breath on Reiser4 becoming viable.
  • XFS -- Favored by system administrators on big disks (over a few terabytes), XFS has some moderately advanced features, and has a good reputation for handling large files. XFS partitions can't be shrunk, though, which can be a problem if you're not sure how big to make your partitions.
  • JFS -- Similar in many ways to XFS, JFS has never been as popular. A few years ago, it wasn't as reliable, but I'm not sure that's the case any more. I can't think of any good reasons to favor it today on a Linux-only system, although there may be some specialized cases where it would perform better than other filesystems.
  • Btrfs -- This is the newest Linux-native filesystem, and it includes advanced features like the ability to span a filesystem across multiple disks and to take snapshots. It's still experimental, though, so it's not really recommended for use in production environments.

ph0t0nix mentioned ZFS, but that's not really Linux-native. (It was developed by Sun, and has been ported to some of the BSDs, but licensing issues prevent moving that code into the Linux kernel.) There are two ZFS implementations for Linux, one of which can be built into the kernel and the other of which is a userspace driver accessed via FUSE. The kernel ZFS driver isn't part of the standard Linux kernel, though, which is a big drawback in my view; IMHO, a driver for your main filesystem should be a standard part of the kernel, not an add-on package that might not work if you upgrade your kernel.

Overall, then, and IMHO, the best general-purpose options at the moment are ext4fs and XFS. Of the two, I give the nod to ext4fs because it's more popular and it can be shrunk. Ext2fs is OK on small partitions (say, under 1GB or so), ReiserFS can be good if you store lots of very small files, and Btrfs is good if you need advanced bleeding-edge features and don't mind the risk. I don't happen to have benchmark data handy on these filesystems, and such data can be difficult to interpret because so many factors can influence performance (disk type, file sizes, system load, etc.). You could try looking up such data if speed or system load is particularly important to you.

There are of course non-native filesystems, too -- NTFS, FAT, HFS+, etc. You can't use these as the filesystem for your main Linux installation. (I suppose you might be able to use HFS+ for that purpose, but I've never tried it, and it certainly isn't supported by the Ubuntu installer!) You'd use these for interoperability on dual-boot computers or on removable disks.