LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   pros and cons of ext4 versus ext2? (https://www.linuxquestions.org/questions/slackware-14/pros-and-cons-of-ext4-versus-ext2-4175443341/)

stf92 12-29-2012 02:59 AM

pros and cons of ext4 versus ext2?
 
Hi:
I am about to install slackware 14.0 64-bit and have to choose between ext2 and ext4 (more precisely between journaling and non journaling). The last time I installed 14.0 (it was the 32-bit version) I chose ext4, and soon I regretted, but I do not remember why. What are the possible disadvantages of ext4/ext3 as compared with ext2?

sycamorex 12-29-2012 03:22 AM

Here's a comparison of those filesystems:
http://www.thegeekstuff.com/2011/05/ext2-ext3-ext4/

If you're working with SSD drives, ext4 would be recommended due to its Trim support. Additionally, with older SSD drives journaling was not recommended:
https://wiki.archlinux.org/index.php...the_filesystem
It looks like it's not a problem any more.

stf92 12-29-2012 03:51 AM

Thank you. I looked at wikipedia, articles ext2, ext3, ext4 but I could not find the disadvantage I had found earlier.

manwichmakesameal 12-29-2012 08:48 AM

I'm not sure what made you regret using ext4. The only time I regretted using a filesystem was years ago, I was using ReiserFS and it deleted a bunch of files and killed my family.

kikinovak 12-29-2012 08:50 AM

I'm using ext2 only on a small 100 MB /boot partition, where a journaled filesystem is of no use. For the rest, it's ext4, always.

jefro 12-29-2012 10:35 AM

Older slower machine used for fun should use ext2. Any fast system used for needed data ought to have ext4.

There is little risk of using ext2 even on big systems if proper backup rules are followed. It has been used for decades.

BlackRider 12-29-2012 10:57 AM

"The only time I regretted using a filesystem was years ago, I was using ReiserFS and it deleted a bunch of files and killed my family."

Hell, I hope this is sarcasm only.

Last time I had to set a server up for non critical data, I used ext2. This filesystem has survived some power supply shutdowns with no critical data loss.

Ext4 is nice, but you have to be careful with the options. Barrirers, journal mode if any, delayed allocation etc. can cause data loss if set wrong. Don't assume defaults are sane! If you have to use Ext4, you'd better know how to do so. I have had to recover from backups some times precisely because a "performance feature" of an ext4 filesystem was enabled when it would have been better to shut it down...

stf92 12-29-2012 01:24 PM

Thank you very much. Well, after all, I didn't do it so bad.

gnashley 12-29-2012 01:47 PM

I still use ext3 for dependable journalling. But I still might use ext2 for any read-only needs.

stf92 12-29-2012 02:36 PM

Thanks, gnashley.

syg00 12-29-2012 04:13 PM

I have found ext4 eminently reliable and flexible. No worse than earlier offerings - from Ted or anyone else.
But then I've also been using btrfs for years ... :p

Note my sigline.

storkus 12-30-2012 07:46 PM

One thing no one here has mentioned is that ext4 is an add-on (with, hopefully, more efficient and reliable code) to ext3, and ditto for ext3 to ext2 (more or less just journalling in that case). In the kernel, there is an option (which I think is the default on Pat's kernels) for the ext4 driver to also be used for any ext3/2 filesystems.

I mention this because you can tune ext4 to do anything you want with the proper options, including acting just like ext3 and 2. Likewise, if absolute data integrity is your goal, ext4 has some non-default settings (because you'll take a performance hit). Check out the tune2fs(8) man age: in particular, the mount option "journal_data_ordered" is the default, but "journal_data" (no suffix) is is the slowest, but safest (if memory from reading discussions on the subject serves correctly). If you're really paranoid, you can also turn off TRIM support (no "discard" entry or even "^discard" if you're exceptionally paranoid).

Btrfs and zfs have even more data-integrity options (block FEC if I recall correctly?), but btrfs had some regressions recently and still underperforms ext4 (but getting ever closer).

Personally, I've been using ext4 for years now on my laptop, and I haven't had a data loss yet even running the battery down to the point where the BIOS forces hard-shutdown!
(Of course, it's just a laptop, not a server...)

Hope this helps, Mike


All times are GMT -5. The time now is 04:02 PM.