# How good is ext2fs?



## Logicien (Jul 25, 2022)

Hello,
since I use FreeBSD I have to mount ext(234) filesystems to access to my linux systems. I prefer to mount those filesystems as read only to advoid some data corruption that occurs. So, how is the support for Extended filesystems? As good than on Linux or worst? If you say it's better I will be surprise.


----------



## sidetone (Jul 25, 2022)

It works, but there's a few problems with it. One is that, it's not good to automount them, because another utility has to be used to check their filesystems, for instance if there's an improper shutdown.

I tried ext2 with the ext4 filesystem, and every so often, my files would get corrupted, or their contents destroyed, even when I was careful. i did my best to close the open files and unmount the filesystem before a reboot, and files would still get corrupted. ext3 is supposed to be better, but I expect the same problem. I don't remember if ext2 was journaled or not. UFS kept files maintained.

Thread howto-mounting-ext4-partitions-by-using-ext2fs-rw-access.84964 shows how to set it up and to check ext filesystems.

Edit: as you said, mounting those as read only could be a better but limited option for using those. ext4 wasn't worth it for me on my FreeBSD computer.

Another edit: they should rename it to extfs, since it mounts ext2, ext3 and ext4. Not that it really matters for me, as I don't prioritize using it, since my files got corrupted on it easily.


----------



## Logicien (Jul 25, 2022)

What you say go to the sense I have lived myself. On Linux the ext4 filesystem must be checked one time a week minimum or every 10 mounts. I force it with tune2fs. On FreeBSD it is programmed at every boot for the moment. Ufs seem's to need to be clean before every boot to boot properly otherwise it's stuck.

I boot and reboot poweroff a lot. I test many things so my filesystems are mounted and unmounted often.


----------



## sidetone (Jul 25, 2022)

Ext4 is worse on FreeBSD, it gets stuck more often, and FreeBSD can't automatically check it (at least not with simple settings). Then, it stops the boot process, so it has to be rebooted into single user mode, then checked. ufs is more reliable, as it needs full fsck less often than ext4 needs its tool. Ufs can be checked and cleaned from there. I don't remember the details exactly, but on FreeBSD, UFS is reliable, and quick checks are hardly noticeable. Cleaning the filesystem is easier, and data is preserved a whole lot better and for more time than ext4 on FreeBSD.

Ufs needing a quick check may be better for data preservation, and to reverse potential data loss. It's not noticeable. The filesystem is great, as I don't lose things with it. I lost every data file I had on ext4 on FreeBSD.

If someone can show a setup that offers similar performance for ext3 or ext4 to that of UFS on FreeBSD, that would be interesting. But don't put important information or files that took work to make on it.

Edit: If ext4 is autoloaded at boot time, and it's corrupted, which happens a lot with that filesystem, it stops the boot processes, and is harder to fix than UFS. Even when it's not autoloaded, it's still problematic on FreeBSD.


----------



## aragats (Jul 25, 2022)

sidetone said:


> I tried ext2 with the ext4 filesystem, and every so often, my files would get corrupted


Same here. Also I've seen dozens of corrupted symlinks with long target names (all in one directory).

I wonder why _ext2fs_ on FreeBSD is so bad? Nobody cares? But I do see some commits within the last several months: ext2fs.


----------



## Logicien (Jul 25, 2022)

Well I want all my filesystems to be clean before booting during I am in and after shutdown and reboot so, if an unclean Linux filesystem can prevent a normal boot I'll check them too before to boot.


----------



## sidetone (Jul 25, 2022)

When ext4 worked this poorly for me was in April of this year.

I don't know if it's the FreeBSD implementation or ext4, itself. It's probably the FreeBSD implementation. My msdos filesystem on flashdrive also messed up on my FreeBSD computer, but it took a lot longer for that to happen. This is from a little more recently.

Ufs runs really clean, unless there's a major power surge or harddisk damage. Files usually recover from improper shutdowns. I try to avoid those.

If someone can show a setup that gives comparable performance and checks, that would be good. Ext3 may be a better target [than ext4].


----------



## Logicien (Jul 25, 2022)

With the number of filesystems that exist I cannot say which one is the best because I have not try  all of them. On how many different filesystems can FreeBSD run? If one filesystem can be compatible with FreeBSD and Linux installations it would be great?


----------



## zirias@ (Jul 25, 2022)

There's a reason the installer only lets you pick either UFS or ZFS – those are the fully supported filesystems on FreeBSD.

With the common OpenZFS code, I don't see why you shouldn't be able to use the same ZFS pool from both FreeBSD and Linux.


----------



## hardworkingnewbie (Jul 25, 2022)

Here's an old thread about it: 








						Other - Best filesystem for a shared partition between FreeBSD and Linux
					

Hi,  i am setting up a soon to be dual-boot system which i want to run FreeBSD 13.0 and a random Linux distribution on. Partition scheme is GPT in case this matters.  I want to have a shared partition so i can access it from both systems (rw). What filesystem do you recommend? My first thought...




					forums.freebsd.org


----------



## aragats (Jul 25, 2022)

Zirias said:


> I don't see why you shouldn't be able to use the same ZFS pool from both FreeBSD and Linux.


That's what I switched to. Perfectly fits my needs.
However, the building and installation of _zfs_ module in Linux is not straight forward, that's why inexperienced users will not probably go this way. Also, it makes you scared by spitting warnings like "Danger! The license is not compatible!" (-;


----------

