[SOLVED] When to use ext3, ext4 or other file types?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
File system types have different functions in Linux/Unix. Some applications demand a particular system type, but most applications run well on ext2, ext3, ext4. If you're installing on a desktop computer, and you don't have any special programs running that have special requirements, like 'riserfs', than format your disks to run with either ext3, or ext4.
Both of them will keep a journal, and can be more easily recovered if something should go wrong. I use ext4, and it's stable and has no problems.
NFS file systems are for mounting other computers to a shared disk. And you could also create an msdos or ntfs file system if you are booting Windows.
There are many tutorials that can go into depth on the subject, google 'linux file system' and you'll find all you need.
"Stable" means that it isn't likely to corrupt your data (or crash, for that matter). A synonym for it is reliable.
A journaling filesystem keeps a "journal," which is a log of everything it's writing to the disk. If the computer were to be shut down improperly (i.e. in a crash or power outage), the hard disk can be recovered by "playing back" the journal.
If you're formatting a flash drive, I suggest going with vFAT, so Windows can read it (NTFS would work as well, but its support in Linux is not as stable).
For a partition that is only read by Linux, I recommend ext4, unless it's a flash drive (SSD or USB flash drive), in which case I'd recommend ext2 (flash drives can only be written to so many times, so a journal would shorten the life of the drive).
A lot of people also seem to like reiserfs, which, in my understanding, is optimized for a whole lot of small files. I don't have any experience with it, and therefore can't say much else about it.
By stable I mean it won't crash. It has been tested and in the majority of cases, it will stand up well under normal usage. Each new file system type goes through a period of development and could crash and cause data loss. This was the case with ext3 and ext4. Both are considered tested and stable.
The same is true with an operating system. A mature OS is considered out of development and is stable enough to be used in a production environment. It won't crash and loose data under normal circumstances.
A journaling file system keeps all writes in memory until the OS confirms that the write to disk has taken place. If a write has not been confirmed, and not deleted from memory, and a power failure occurs, the memory is written out to a journal file on disk. This all happens very quickly, micro seconds. When the system reboots, that journal file is read by the OS, and all data that could have been lost is recovered and written to disk. In ext2, there is no confirmation, and no journaling, so if a power failure occurs, any data that has not been written to disk is lost.
Each filesystem is different in terms of performance and how safe your data is. Out of all the filesystems available, I would say that XFS and JFS are the best in terms of performance, there are also benchmarks showing this: http://linuxgazette.net/122/piszcz.html http://www.t2-project.org/zine/1/
there may be new ones, but they are not comprehensive.
XFS however has a downside in that if power goes out unexpectedly, you may lose data, because data is not written immediately, but kept in RAM.
JFS does not have this problem.
There is also btrfs, but it is rather new and not considered stable.
After researching file systems I decided on JFS as the one with the most suited balance of speed and reliability. At that time there were some issues with ext4, now fixed. Reiserfs is designed more for speed and that's not important enough for me to accept the reduced reliability. JFS is not a popular choice, perhaps simply because it is not a popular choice (like "famous for being famous") but I have not yet seen any substantial criticisms of it. Inconveniently Knoppix does not have JFS support and, for GRUB users, GRUB does work with JFS so a separate /boot file system is required.
Seriously, though, I think the best thing you could do is check out the Wikipedia article for each of the file systems you are considering. By reading about each file system's features, advantages, and drawbacks you'll be be able to make your own informed decision. And, of course, you can always turn to LQ if you have any specific questions about any of them.
Do you mean literally? I gave up on reiser because I always ended up with corrupted filesystems... But that was five or six years ago, I don't know what it has become in the meantime.
One thing I like about xfs is that it is the only file system that can be defragmented (except maybe ext4). And the danger of file corruption because of power outage is greatly exaggerated considering it is mounted nobarrier by default.
I gave up on reiser because I always ended up with corrupted filesystems... But that was five or six years ago, I don't know what it has become in the meantime.
TBH, me neither. That said, I used to select it quite often many years ago and IIRC it was always a pleasant experience. Currently I just stick to ext3, though, and I'm not even sure I remember what triggered the switch in preference. A little while back I had considered moving to ext4, but I concluded it was not stable enough for me yet (I'm using a definition of stability similar to stress_junkie's).
I don't think ReiserFS is supported or developed anymore (yes, because of the "killer" part). There is Reiser4 tho, which is newer. I can't recommend either.
Also, JFS and XFS have been tested on IBM mainframes and SGI workstations respectively for quite some time, maybe even more than ext3, so the argument that ext3 has been used longer is invalid. JFS originally had defrag ability, but it has not been ported yet, so if you need defrag use XFS. It is not regular defrag tho, it is better, it does NOT move files to the beginning of the disk like a dumb defrag program, instead it defragments files sparsely so that files remain spread out (prevents fragmentation) but are still defragmented in place.
I don't think ReiserFS is supported or developed anymore (yes, because of the "killer" part).
What makes you say that? I remember Novell stopped making ReiserFS the default file system on their distro when the news about the author broke, but what you're saying makes it sound like the kernel developers stopped maintaining ReiserFS, which AFAIK isn't the case.
Buddy can you tell me about what do you mean by STABLE and JOURNALING?
Stable means two things:
it doesn't crash or loose your data
it is immutable, ie the definition doesn't change from one version to another making an FS prduced with an older version unworkable under the newer software (until upgraded)
people primarily mean the first of those, but there are circumstances in which the second can be important.
Quote:
That said, I used to select it quite often many years ago and IIRC it was always a pleasant experience. Currently I just stick to ext3, though, and I'm not even sure I remember what triggered the switch in preference. A little while back I had considered moving to ext4,
I also used to use Reiser3 (what people generally refer to as Reiser, the 3 is only necessary to distinguish from other versions) back in the day and was happy with it then. I never saw filesystem corruption (different from data loss), but it may depend on which journallling mode you selected.
I changed to ext3 along with SuSE, and I'm not quite clear why. Reiser3 was probably faster, overall (in my use case...YMMV), but ext3 may have been safer. This may just have been that the defaults changed; I didn't do any benchmarking along with this change. (Actually, the change was probably synchronous with new hardware and investing the extra speed in data security may have seemed smart.)
I tried Reiser4 briefly, and that seemed faster (on average; will vary with use case) too, but support seemed questionable.
The kernel guys probably still do support Reiser3, but its almost meaningless; allegedly any query/bug notification/request for a fix to the Reiser team, who still nominally maintain the Reiser filesystems, gets met with a 'You ought to switch to Reiser4' response. Maybe this wouldn't be such an issue if Reiser (the man) hadn't spent his years of freedom criticising and denigrating everybody else in the universe and behaving in a generally spiky manner, particularly with the kernel devs, but there was no great wellspring of affection upon which to draw. That said, the Reiser team, post Hans (which I think is one person) must be easier to get on with...
Currently, on this laptop, I'm using ext3 for /home, ext4 for everything else and i believe that I noticed a speed-up changing the root partition from ext3 to ext4. Quite happy with ext4 at this point, but it doesn't mean that the /home partition might not go BTRFS at the next upgrade.
What makes you say that? I remember Novell stopped making ReiserFS the default file system on their distro when the news about the author broke, but what you're saying makes it sound like the kernel developers stopped maintaining ReiserFS, which AFAIK isn't the case.
Well, you're right, it does NOT mean that development will stop. However, from what I've read on wiki and other places, the development of Reiser* is "uncertain". I haven't heard to much on it recently. Also, I believe Hans Reiser was the main developer, so with him "away", for sure someone needs to take his place and do a similar quality job.
Last edited by H_TeXMeX_H; 11-16-2010 at 12:58 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.