Score:2

Will EXT4 offer better filesystem corruption protection than NTFS on Ubuntu?

gb flag

Somehow I ended up with an external drive that only had Windows and Mac backup software on it. Nonetheless, I backed up data from my primary HD and the drive seemed to work fine until I had a power outage and the drive would no longer mount.

After some research I was led to a solution based on the notion that it's a Windows drive that sets a header flag when there's an improper shutdown, given that Windows will see the flag on boot and run checkdsk to diagnose the disk and clear the flag.

The solution is sudo ntfsfix /dev/xxx where the mount specification is the external drive.

This has now happened multiple times and each time is a nail biter. I'm also having some machine freezing with 23.04 that hasn't been an issues since my first ubuntu, 17.10. So my instinct tells me I'm pushing my luck with this drive.

Does it seem like I'd be better off to copy up the backup files to my primary HD, reformat the external backup drive to Ext4, and then copy down the backup files from my primary HD to the external drive?

hu flag
Power outages cause problems for all filesystems. Usually, you'll need to run a filesystem check.
Raffa avatar
jp flag
Changed the title a bit to reflect actual technicality related to Ubuntu so that folks trying to close the question as "opinion based" please change their minds :) ... The issue is worth asking IMHO.
Score:2
jp flag

The decision is yours to take, but better educated than not ... So, basically one of the mechanisms a filesystem's integrity is preserved is journaling.

A journaling file system is a file system that keeps track of changes not yet committed to the file system's main part by recording the goal of such changes in a data structure known as a "journal", which is usually a circular log. In the event of a system crash or power failure, such file systems can be brought back online more quickly with a lower likelihood of becoming corrupted.

See a demonstration of how easily a non-journaling filesystem can be corrupted.

Although NTFS is a journaling file system, but on Linux, its implementation in that area relies on the kernel's driver for the NTFS filesystem.

While the newer recent kernel driver NTFS3 offers better support for NTFS native journaling than the previous kernel driver NTFS-3G, it is still not complete ... No support yet for the JBD(Journaling block device) layer of the The Linux Journalling API.

The EXT4 filesystem, on the other hand has full native journaling support in the Linux kernel.

Score:1
cn flag

My own preference would be to do as you suggest -- store the data on the drive in a temporary location and reformat it to ext4. This reduces the effort required to re-access the drive compared to ntfs.

The only exception to this would be if you anticipate a need to access the drive from a Windows machine -- Linux does a much better job of accessing ntfs than Windows does accessing ext4.

As suggested in comments to the question, you'd expect to want/need to run a file system check on any file system in any format after a power failure while mounted (never mind while writing) -- my other suggestion, then, would be to consider buying an inexpensive UPS to make power failures less of a problem. Mine is only good for about twenty minutes for my computer, but that's plenty of time to do an orderly shutdown vs. have everything just cut off. You can get these for around $60-$100 these days, and IMO it's money well spent, since the UPS does a better job of protecting your computer from power spikes than an ordinary surge protector, never mind preventing resets if your lights ficker from a nearby lightning strike.

Nick avatar
gb flag
These are all great things to know. I don't think I would have the need to mount the drive on a Windows machine. It's more like I would just use a memory stick to transfer what I needed, if that. What worries me is that Ubuntu doesn't automatically recover from this error. In light of all that it seems prudent to go with Ext4. Thanks!
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.