FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Fri Apr 03, 2020 20:29



Post new topic Reply to topic  [ 5 posts ] 
remove_hiberfile problems on Windows 7 and Vista 
Author Message

Joined: Tue Oct 25, 2011 19:39
Posts: 2
Post remove_hiberfile problems on Windows 7 and Vista
Hello, we are using lowntfs-3g version "2011.4.12AR.7 external FUSE 28" to mount various Windows system drives.

These are the options we are using (xxx is the proper device name):

lowntfs-3g -o show_sys_files,ignore_case,remove_hiberfile /dev/xxx /drives/windows_mount

The remove_hiberfile option is trigger different behavior on different versions of Windows as follows:

Windows XP: hiberfil.sys is automatically removed and there are no errors on reboot.
Windows Vista: hiberfil.sys is automatically removed but there is a Windows error recovery message on reboot.
Windows 7: hiberfil.sys is NOT automatically removed and upon reboot the system resumes from hibernation. Manually removing hiberfil.sys after mounting it results in the same error as Vista on reboot.

It appears that the desired behavior is only effective on XP.

Any tips? Thanks.


Tue Oct 25, 2011 21:13
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: remove_hiberfile problems on Windows 7 and Vista
Hi,

Quote:
Windows 7: hiberfil.sys is NOT automatically removed

I do not have Windows 7 and I cannot check. What is the exact (case-sensitive) name on Windows 7 ?
Quote:
It appears that the desired behavior is only effective on XP.
Any tips? Thanks

When hibernating, Windows stores its current state in the hibernation file. There is only one such file on the system volume, and it contains information about open files and directories on all mounted volumes (not sure about the pluggable ones). When mounting on Linux a volume used by a hibernated Windows, you use a possibly inconsistent volume, and Windows, when restarting uses the hibernated information instead of the state left by Linux.

So, what behavior do you want ?

Did you try to mount (as a non-system volume) on Windows 7 a system volume left hibernated by Vista ?

I would say the only safe procedure is to never mount on Linux a volume left by a hibernated Windows. Note that the presence of a hiberfil.sys does not mean that Windows was hibernated, and that there is no hiberfil.sys on non-system volume event if Windows was hibernated. Such a non-system volume may have its state saved in a hiberfil.sys stored on a non-mounted volume.

Regards

Jean-Pierre


Wed Oct 26, 2011 09:06
Profile

Joined: Tue Oct 25, 2011 19:39
Posts: 2
Post Re: remove_hiberfile problems on Windows 7 and Vista
Hello Jean-Pierre,

"I do not have Windows 7 and I cannot check. What is the exact (case-sensitive) name on Windows 7 ?"

It's the same case sensitive name across all three types of Windows we tested: hiberfil.sys

On Windows 7 mounted:

% ls -l hiberfil.sys
-rwxrwxrwx 1 root root 796655616 Oct 26 08:45 hiberfil.sys

"So, what behavior do you want ?"

Upon mounting a Windows drive, we want to be able to wipe away the hibernation state with the "remove_hiberfil" option and make local changes so that once the system reboots, it will reboot cleanly without any error messages. Essentially the current behavior on Windows XP only.

"Did you try to mount (as a non-system volume) on Windows 7 a system volume left hibernated by Vista ?"

Nope. We tried on freshly installed systems a hibernation on Win XP, Vista, and Win 7 for the purposes of reporting this bug.

Thanks for your help.


Wed Oct 26, 2011 16:19
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: remove_hiberfile problems on Windows 7 and Vista
Hi,

Quote:
It's the same case sensitive name across all three types of Windows we tested: hiberfil.sys

The current code assumes there is a hibernated Windows when the first four bytes in the file hiberfil.sys are "hibr". Maybe this is different on Windows 7.

With an hibernated Windows 7, what is the output of
Code:
head -c 32 MOUNTPOINT/hiberfil.sys | od -t x1

(sorry, I have no Windows 7 to try myself).
Quote:
Upon mounting a Windows drive, we want to be able to wipe away the hibernation state with the "remove_hiberfil" option

Ok, you have been warned.
Quote:
make local changes so that once the system reboots, it will reboot cleanly without any error messages. Essentially the current behavior on Windows XP only.

If you find out a way to get Windows 7 to ignore the hiberfile without issuing an error, I may integrate it in future versions. The options I would try are :
1) truncate the hiberfil.sys to size zero,
2) overwrite a few zeroes at the beginning of file
3) make the file a sparse file with original size and no contents
etc.

Regards

Jean-Pierre


Wed Oct 26, 2011 18:31
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: remove_hiberfile problems on Windows 7 and Vista
Hi,

Quote:
The current code assumes there is a hibernated Windows when the first four bytes in the file hiberfil.sys are "hibr". Maybe this is different on Windows 7.

Apparently, Windows 7 inserts "HIBR" in the hibernation file when hibernating.

Can you check whether the hibernation state is recognized with the attached patch ?

Regards

Jean-Pierre


Attachments:
volume.c.patch25.gz [270 Bytes]
Downloaded 676 times
Mon Nov 21, 2011 16:26
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.