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

26,411

Solution 1

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.

Solution 2

For the setup you propose ext4 is recommended.

If you were to put /boot as a separate partition, you could use ext2 for that. For large filesystems (e.g. > 16TB I generally use xfs, as it I had some problems with ext4 there (problems when resizing the partition). And btrfs is still not recommended for production. For a server you could consider ZFS, which has been declared stable on Linux a few months ago.

Share:
26,411

Related videos on Youtube

user187248
Author by

user187248

Updated on September 18, 2022

Comments

  • user187248
    user187248 over 1 year

    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.

  • Braiam
    Braiam over 10 years
    Grub2 don't need to be ext2. Only Grub1 does.
  • Rod Smith
    Rod Smith over 10 years
    Even GRUB 1 (aka GRUB Legacy) can boot from most Linux filesystems. (I'm not sure about Btrfs, offhand.) The advantage of ext2fs on a small partition is that there's no journal file to consume disk space; on a small partition, the journal file can consume a significant amount of disk space, and the advantages of journaling on a small partition are minimal.
  • AngryWombat
    AngryWombat over 10 years
    @ph0t0nix Large Files System or do you mean large Files? XFS is a good file system when you using as a media center or DVR holding video where files are generally large.
  • AngryWombat
    AngryWombat over 10 years
    @Ho0t0nix , nice one (have a 1up), I keep that in mind next time... I got do some home work of my own in regards to BtrFS and ZFS working with large file systems. I love the idea behind thesse two FS and what they can do.
  • forest
    forest about 5 years
    While ext3 is indeed ext2 with a journal duct taped to it, I'd say that ext4 isn't really ext3 with extra features. It's a completely rewritten filesystem with totally new features and a journal integrated from the ground up. As for the use-case of JFS, the main reason it might be used is its extremely low resource requirements and its variable-sized filesystem blocks. Other than that, its performance is not ideal (in particular due to the lack of allocate-on-flush/delayed-allocation). Finally, for /boot, why not just use ext4 with the journal disabled?