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



Post new topic Reply to topic  [ 13 posts ] 
No ntfs-3g commands to mount partition read/write work 
Author Message

Joined: Sun Jun 08, 2014 17:17
Posts: 7
Post No ntfs-3g commands to mount partition read/write work
Hi everyone,

I have an x64 Windows 8.1 pro install which won’t boot at all after a crash. No recovery disks or USB’s will boot either. The only things that boot are Linux based media and I have managed to run Ubuntu 14.04 from a live USB stick. I am trying to use ntfs-3g to repair Windows but I cannot mount it read/write, only read using 'ro' in disks.

When I click the Windows partition on the hard drive I get the following message,

Quote:
Error mounting /dev/sda4 at /media/ubuntu/Windows: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999,dmas k=0077,fmask=0177" "/dev/sda4" "/media/ubuntu/Windows"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda4': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.


Know I know most people say, go back into Windows and disable hybrid shutdown but I cannot get into Windows! I think because of the crash when I power on it’s trying to resume something corrupted which is why it won’t boot.

I want to remove the hibernation flag on the Windows parition and also delete the hiberfil.sys file. When I type the following into the terminal,

Quote:
sudo ntfs-3g /dev/sda4 /mnt/windows


I get the same error saying the NTFS parition in an unsafe state. I am aware of this and do not mind the potential data loss. All various commands I have tried (including those with remove_hiberfile) have not worked.

Could someone help explain what command I need to enter to force mount this partition read/write and also delete the hiberfile.

Thank you.


Sun Jun 08, 2014 17:31
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: No ntfs-3g commands to mount partition read/write work
Hi,

Quote:
I want to remove the hibernation flag on the Windows parition and also delete the hiberfil.sys file. When I type the following into the terminal,

Windows 8.1 cannot have crashed while it was hibernated. Hibernation states and hiberfil.sys have probably nothing to do with what you experience.
Quote:
I get the same error saying the NTFS parition in an unsafe state. I am aware of this and do not mind the potential data loss.

If Windows 8.1 has crashed, it has left inconsistencies in the partition, so it is marked dirty, and ntfs-3g plays safe by refusing to mount.
Quote:
Could someone help explain what command I need to enter to force mount this partition read/write and also delete the hiberfile.

Usually ntfsfix can restore a partition to a mountable state, but this depends on actual damages. Also the partition may become mountable, but still not bootable.
Code:
# First do a "dry run" :
sudo ntfsfix -nd  /dev/sda4
# if failed, please post what was output
# if successful do a real fix :
sudo ntfsfix -d  /dev/sda4

As ntfsfix only checks and fixes what is needed to reach a mountable state, do not forget to do a chkdsk as soon as you can mount on Windows.

Regards

Jean-Pierre


Sun Jun 08, 2014 21:47
Profile

Joined: Sun Jun 08, 2014 17:17
Posts: 7
Post Re: No ntfs-3g commands to mount partition read/write work
Thank you for the reply and your assitance Jean-Pierre,

Windows was doing an update when it hard crashed and had to be manually powered off. When doing this I believe the hard crash state was saved to the hiberfile (because of fast boot) which means that everytime I now turn it on it's stuck in a 'resuming windows' state trying to load something which is in a crashed state. As I result I cannot boot windows, any Windows recovery media or anything which is WinPE based.

In order to simulate a full shutdown I need to stop Windows believing its waking from a hibernated state. The only way to do this is remove the hibernation flag on the partitions and also remove the hiberfil.sys. Hopefully Windows will then boot, even if it need repairing.

I understand that ntfs-g plays it safe with read only and this is enough for most users under normal conditions but I need read/write because Windows is already not booting so this can't hurt the situation further.

On a side note I tried using the Avira Rescue System USB which is actually built on ntfs-g. It automates the process of removing the hibernation flag and deleting the hiberfile through a graphical gui but I could not use it because it detected no partitions at all, possibly because it is using an older version of ntfs-3g.

I will try your suggestion of ntfsfix and post back the results. I am not sure that the Windows partition itself is damaged though, it might just be that the hiberfile is corrupted.


Sun Jun 08, 2014 23:33
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: No ntfs-3g commands to mount partition read/write work
Hi,

Quote:
When doing this I believe the hard crash state was saved to the hiberfile (because of fast boot)

I never heard of such behavior before (but this might be a new feature in Windows 8.1).
Quote:
The only way to do this is remove the hibernation flag on the partitions and also remove the hiberfil.sys

ntfsfix does not remove the hiberfil.sys and could end in "Remount failed". Please report if you get such error. In such situation, the file will be removed when subsequently mounting rw with ntfs-3g with option "remove_hiberfile" :
Code:
sudo ntfs-3g -o remove_hiberfile /dev/sda4 /mnt/windows

Regards

Jean-Pierre


Mon Jun 09, 2014 08:36
Profile

Joined: Sun Jun 08, 2014 17:17
Posts: 7
Post Re: No ntfs-3g commands to mount partition read/write work
I ran the ntfsfix commands and again it came back with a similar message,

Image

Just for reference this my systems drive in gparted,

Image

What command should I try next?


Mon Jun 09, 2014 13:33
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: No ntfs-3g commands to mount partition read/write work
Hi,

The "Failed to sync device /dev/sda4" error looks like a hardware error. There is another abnormal condition in that $MFTMirr initially matched $MFT (as it should be), but did not so later any more. This could mean either that deleting the journal has damaged either $MFT or $MFTMirr as a consequence of inconsistent layout of files, or it could just be another effect of a hardware error.

There is however a possibility that the journal could be partially cleared, thus telling Windows there is nothing to recover. Might be worth trying.

Otherwise, I would mount read-only and try to save important files, then reinstall Windows (the installer is supposed to skip bad sectors).

If you have very important files, I can diagnose further if you can make available a copy of the metadata (a few GB with no user data)
Code:
# better copy+paste, spaces are important
sudo ntfsclone -mst -O - /dev/sda4 | gzip > metadata.gz


Regards

Jean-Pierre


Mon Jun 09, 2014 18:19
Profile

Joined: Sun Jun 08, 2014 17:17
Posts: 7
Post Re: No ntfs-3g commands to mount partition read/write work
Thanks for the reply,

If its hardware I shouldn't really be able to read all the contents on the partition when I mount it read only. It would be a big coincidence that the hardware broke the same time as a software update.

I have already backed up everything I need using read only. I cannot reinstall Windows because no WinPE install media will boot (the most confusing thing about all of this), probably because it’s stuck in resuming windows state rather than a cold boot state.

I can do the NTFS metadata copy but would it work on a live Ubuntu USB? Could I create it on the desktop and then place it in cloud storage to get it off the device? Also is there no other force command I can try?


Mon Jun 09, 2014 19:26
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: No ntfs-3g commands to mount partition read/write work
Hi,

Quote:
If its hardware I shouldn't really be able to read all the contents on the partition when I mount it read only. It would be a big coincidence that the hardware broke the same time as a software update.

Doing a software update may have put stress on mechanical parts. Can you write on other partitions, to exclude some loose connector ?
Quote:
I can do the NTFS metadata copy but would it work on a live Ubuntu USB?

Should not be a problem. If you had ntfsfix, you probably also have ntfsclone (a recent version is best, of course).
Quote:
Could I create it on the desktop and then place it in cloud storage to get it off the device?

Yes, this is the way to go. You have to have enough spare space on another partition (or on an USB key, if you need to upload the image from another computer, and also reduce stress to the hard disk).
Quote:
Also is there no other force command I can try?

Oh yes, you need -f (to ignore the partition to be dirty), --rescue (to not stop on read error), and --ignore-fs-check (to be tolerant on consistency checks).
To recap :
Quote:
sudo ntfsclone --rescue --ignore-fs-check -fmst -O - /dev/sda4 | gzip > metadata.gz

Regards

Jean-Pierre


Mon Jun 09, 2014 21:21
Profile

Joined: Sun Jun 08, 2014 17:17
Posts: 7
Post Re: No ntfs-3g commands to mount partition read/write work
Hi Jean-Pierre,

Unfortunately I cannot send the metadata file as it contains filenames and there is business information on it I cannot give out.

Is there a command to force read/write on the partition regardless? I thought that was the point of the NTFS-3G terminal commands (it is very powerful).


Wed Jun 11, 2014 12:18
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: No ntfs-3g commands to mount partition read/write work
Hi,

Quote:
Unfortunately I cannot send the metadata file as it contains filenames and there is business information on it I cannot give out.

Too bad. You should not put user (or business) data on a system partition...
Quote:
Is there a command to force read/write on the partition regardless? I thought that was the point of the NTFS-3G terminal commands (it is very powerful).

This was the purpose of the ntfsfix command, and ntfsfix issued write commands which were accepted by lower layer levels (which queued the write request), but when the actual write was requested in a sync, it failed... And Windows failed in the first place, so, unless proved wrong, I have to blame the hardware.

I have no much more to suggest apart from plugging the disk as a secondary one in another computer and starting chkdsk and/or a vendor-provided device test.

Regards

Jean-Pierre


Wed Jun 11, 2014 14:11
Profile

Joined: Sun Jun 08, 2014 17:17
Posts: 7
Post Re: No ntfs-3g commands to mount partition read/write work
I had a read about some ntfs-3g commands.

What about a forced command like this?

sudo mkdir /media/windows
sudo ntfs-3g -o force,rw /dev/sda4 /media/windows


I cannot remove the SSD (sealed device). Even if a command does not fix Windows I at least need to get in to delete all information.

Quote:
Too bad. You should not put user (or business) data on a system partition...


But this partition is the normal Windows partition where everyones documents and files are normally stored.


Wed Jun 11, 2014 15:22
Profile

Joined: Sun Jun 08, 2014 17:17
Posts: 7
Post Re: No ntfs-3g commands to mount partition read/write work
Reading back your post again,

Do you mean you want the metadata from the SYSTEM partion (sda2) or the Windows partion (sda4)?


Wed Jun 11, 2014 15:35
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: No ntfs-3g commands to mount partition read/write work
Hi,

Quote:
sudo ntfs-3g -o force,rw /dev/sda4 /media/windows

There is no such force option in the driver. Repairing should be done by external tools, and if ntfsfix cannot write, ntfs-3g will not either.
Quote:
I cannot remove the SSD (sealed device)

Bad news. You may have to get your computer examined by a hardware expert.
Quote:
Do you mean you want the metadata from the SYSTEM partion (sda2) or the Windows partion (sda4)?

I really meant sda4, the sda2 is a fat32 partition only used for the first booting stages. The sda4 holds the OS, and the users' home partition (this is probably the "C:" promoted both as a system partition and a data partition).

Regards

Jean-Pierre


Wed Jun 11, 2014 17:06
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 


Who is online

Users browsing this forum: No registered users and 5 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.