NTFS-3G filesystem corruption (with possible cause)

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

NTFS-3G filesystem corruption (with possible cause)

Postby Antcodd on Wed Jun 29, 2011 12:18 am


I finally think I've found the cause of exactly why my LMDE keeps intermittently corrupting my Windows 7 partition (to the point I think I'm going to have to reinstall Windows as the latest time I installed updates while it was corrupted without realizing :( - it still boots once I ran a chkdisk but there are some corrupted files). I've seen a few scattered reports as well that didn't really go anywhere.

The problem seems to be that NTFS-3G is not detecting Windows 7 Hybrid Sleep hibernation (hybrid sleep does sleep and hibernate at the same time, and uses the hibernation file if power is lost). A couple of times (due to not getting around to changing the default GRUB boot option), I've accidentally booted into LMDE from hibernation but didn't think too much of it since NTFS-3G is supposed to not mount the drive after hibernation and assuming since I have made no writes the the NTFS partition it shouldn't create any inconsistencies even if it does so I immediately shutdown at the login screen.

When trying to mount the partition, rather than failing because of hibernation as it should do (and as documented in the manpage) NTFS-3G decides to 'fix' the volume. This means the very act of mounting the drive corrupts things, so no matter how fast you go 'oh crap' and hit the power button at choosing the wrong boot option it is probably too late. It seems the reason for this is, looking at my hiberfile.sys after hybrid sleep, there is no HIBR at the start of the file (which apparently is how NTFS-3G detects hibernation). Why on earth is the 'recover' option on by default anyway? It seems to me to be asking for trouble. Ext partitions don't have an auto-recovery as soon as you mount them, why should NTFS? What's worse is it clears the dirty flag so chkdisk doesn't do an automatic check so you end up resuming from hibernate with an inconsistent file system and no indication that it is inconsistent! And annoyingly with Windows 7 you can no longer get to the boot options resuming from hibernate to delete the hibernation file even if you know what's going on. The 'best' remedy I've come up with is holding down the power button just as it starts resuming, then rebooting and choosing the option to delete the hibernation file and then running a chkdisk as soon as possible afterwards, even then chkdisk usually finds errors.

I haven't come across a serious bug before that didn't already have some kind of bug report associated with it (or is distribution specific). Where's the best place to report it? The debian bug tracker for the ntfs-3g package? The Tuxera support forums? It's really shaken my faith in NTFS support on Linux - I thought it was finally pretty stable! For now I've commented out the line in /etc/fstab for mounting the NTFS partition. Speaking of which, when will Linux distros include (use I know I can download one) an easy way to configure fstab easily - surely it is a common scenario to want a Windows partition mounted on boot?


ps: I'm not the most experienced Linux user in the world
Level 1
Level 1
Posts: 1
Joined: Tue Jun 28, 2011 11:46 pm

Linux Mint is funded by ads and donations.

Return to Other Topics

Who is online

Users browsing this forum: No registered users and 2 guests