FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Wed Nov 25, 2020 09:56



Post new topic Reply to topic  [ 3 posts ] 
ntfsprogs refusing to modify a win7 filesystem 
Author Message

Joined: Wed Apr 16, 2014 03:57
Posts: 2
Post ntfsprogs refusing to modify a win7 filesystem
short form:

various ntfsprogs utilities (eg. ntfscp, ntfsfix) are refusing to modify a Win7 filesystem, claiming "Hibernated non-system partition, refused to mount." even though the host was fully shut down, not hibernated.

OS: CentOS 6.5
ntfsprogs: versions v2011.4.12 (distro provided) and v2014.2.15 (built from current sources)


longer:

I have a Win7 VM, and want to back up the C: drive using ntfsclone. Before doing this I'm trying to copy a zero-length file over each of pagefile.sys and hiberfil.sys to reduce space taken by the backup.

I shut down the VM (not hibernate) and create a loop device on the virtual HD that exposes just the C: partition. ntfsls correctly shows the contents of the C: drive, but ntfscp refuses to make any changes.

Code:
~/win7 $ sudo losetup --find --show --offset $((206848*512)) /var/lib/libvirt/images/win7.img
/dev/loop0
~/win7 $ sudo ntfsls /dev/loop0 -l
       0 Apr 15 12:31 2014 $Recycle.Bin
    6528 Apr 15 09:06 2014 bootsqm.dat
       0 Apr 15 12:31 2014 Documents and Settings
       0 Apr 14 21:17 2014 hiberfil.sys
4294545408 Apr 14 18:39 2014 pagefile.sys
       0 Apr 15 12:31 2014 PerfLogs
       0 Apr 15 12:31 2014 Program Files
       0 Apr 15 12:31 2014 Program Files (x86)
       0 Apr 15 12:31 2014 ProgramData
       0 Apr 14 20:01 2014 Recovery
       0 Apr 14 18:40 2014 System Volume Information
       0 Apr 15 12:31 2014 Users
       0 Apr 15 12:31 2014 Windows
~/win7 $ ls -lF empty.bin
-rw-r--r--. 1 jsteph jsteph 0 Aug 20  2012 empty.bin
~/win7 $ sudo ntfscp /dev/loop0 empty.bin pagefile.sys
Hibernated non-system partition, refused to mount.
Failed to mount '/dev/loop0': Operation not permitted
The NTFS partition is hibernated. Please resume Windows and turned it
off properly, so mounting could be done safely.
ERROR: couldn't mount volume: Operation not permitted
~/win7 $


Any suggestions?

(Don't bother with "shut the system down instead of hibernating it" unless Start > Shut Down and then watching the system say "Shutting Down..." is somehow doing it wrong)


Wed Apr 16, 2014 04:21
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: ntfsprogs refusing to modify a win7 filesystem
Hi,

Quote:
I have a Win7 VM, and want to back up the C: drive using ntfsclone. Before doing this I'm trying to copy a zero-length file over each of pagefile.sys and hiberfil.sys to reduce space taken by the backup.

By copying a zero-length file to hiberfil.sys you have simulated a non-system hibernated partition (file present with no contents).

Instead of clearing the contents of hiberfil.sys, I suggest you truncate it to 4K bytes, leaving the first 4K bytes unchanged ("truncate -s 4096 /Windows/hiberfil.sys"). The first 4K bytes are needed to know the state of the partition. I however do not know how Windows reacts to a truncated hiberfil.sys.

Regards

Jean-Pierre


Wed Apr 16, 2014 08:34
Profile

Joined: Wed Apr 16, 2014 03:57
Posts: 2
Post Re: ntfsprogs refusing to modify a win7 filesystem
jpa wrote:
By copying a zero-length file to hiberfil.sys you have simulated a non-system hibernated partition (file present with no contents).


Yep, that seems to be it. Although I'm confused, because I've positive I've used the exact same backup process in the past with no problems. Anyway I got rid of the zero-length hiberfil.sys and everything is now working as expected.

Thanks

JS.


Thu Apr 17, 2014 02:31
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: Google [Bot] and 10 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.