WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] Help with NTFS mount  (Read 8241 times)

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
[Solved] Help with NTFS mount
« on: December 16, 2019, 11:17:16 AM »
Hi all,
I know this question has already been asked many times, but I have already searched and tried the possible solutions to my problem, with no result.

The problem is: I am not able to mount my Windows (NTFS) partition on write. This is what I do, along with the output:

Code: [Select]
# mount -t ntfs -o rw /dev/nvme0n1p2 /mnt/nvme0n1p2
# ls -l /mnt/
total 12
drwxr-xr-x    2 root     root            40 Dec 16 15:44 nvme0n1p1
dr-x------    1 root     root          8192 Dec 14 12:39 nvme0n1p2   <--- it is however read only
drwxr-xr-x    2 root     root            40 Dec 16 15:44 nvme0n1p3
drwxr-xr-x    8 root     root          4096 Dec  3 10:30 sda1

If I try this other way:
Code: [Select]
# mount -t ntfs-3g -o rw /dev/nvme0n1p2 /mnt/nvme0n1p2

Windows is hibernated, refused to mount.
Failed to mount '/dev/nvme0n1p2': 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.
mount: mounting /dev/nvme0n1p2 on /mnt/nvme0n1p2 failed: No such device

The same if I try with the recover, umask=000 or force options. Despite the warning message, I am sure Windows has been shut down in a clean way and the "fast startup" ( = "hibernate") option is disabled.

I have also tried to ntfsfix the partition, but it didn't work.

How can I manage to mount the partition in write mode? Any ideas?

Thanks in advance :)

    [EDIT]: Changed  tt  tags to  code  tags.  Rich
« Last Edit: December 17, 2019, 12:06:24 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Help with NTFS mount
« Reply #1 on: December 16, 2019, 12:04:07 PM »
Hi core.dump
Welcome to the forum. Post the results from the following commands:
Code: [Select]
ls -l /dev/nv*
busybox fdisk -l
Please use code tags when posting the results.

On those rare occasions I need to mount an NTFS drive I use this syntax:
Code: [Select]
sudo ntfs-3g /dev/nvme0n1p2 /mnt/nvme0n1p2

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Help with NTFS mount
« Reply #2 on: December 16, 2019, 12:34:36 PM »
Hi core.dump
... On those rare occasions I need to mount an NTFS drive I use this syntax:
Code: [Select]
sudo ntfs-3g /dev/nvme0n1p2 /mnt/nvme0n1p2
Just wanted to add, this is the result:
Code: [Select]
tc@E310:~$ tail -n 1 /proc/mounts
/dev/sdh5 /mnt/sdh5 fuseblk rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096 0 0
tc@E310:~$

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Help with NTFS mount
« Reply #3 on: December 16, 2019, 12:43:06 PM »
Hi Rich,
first of all, thank you for replying.

this is what you requested:

Code: (bash) [Select]
$ ls -l /dev/nv*

crw-------    1 root     root      246,   0 Dec 16 17:30 /dev/nvme0
brw-rw----    1 root     staff     259,   0 Dec 16 17:30 /dev/nvme0n1
brw-rw----    1 root     staff     259,   1 Dec 16 17:30 /dev/nvme0n1p1
brw-rw----    1 root     staff     259,   2 Dec 16 17:30 /dev/nvme0n1p2
brw-rw----    1 root     staff     259,   3 Dec 16 17:30 /dev/nvme0n1p3
crw-r-----    1 root     staff      10, 144 Dec 16 17:30 /dev/nvram


Code: (bash) [Select]
$ busybox fdisk -l

Disk /dev/nvme0n1: 238 GB, 256060514304 bytes, 500118192 sectors
244198 cylinders, 64 heads, 32 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device       Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/nvme0n1p1 *  0,32,33     70,29,23          2048    1126399    1124352  549M  7 HPFS/NTFS
/dev/nvme0n1p2    70,29,24    1023,254,63    1126400  499038603  497912204  237G  7 HPFS/NTFS
/dev/nvme0n1p3    1023,254,63 1023,254,63  499040256  500113407    1073152  524M 27 Unknown
Disk /dev/sda: 466 GB, 500107862016 bytes, 976773168 sectors
60801 cylinders, 255 heads, 63 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1 *  0,1,1       1023,254,63         63  976773167  976773105  465G 83 Linux


Code: (bash) [Select]
$ sudo ntfs-3g /dev/nvme0n1p2 /mnt/nvme0n1p2

Windows is hibernated, refused to mount.
Failed to mount '/dev/nvme0n1p2': 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.

Of course, it still refuses to mount in rw mode... :(

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Help with NTFS mount
« Reply #4 on: December 16, 2019, 12:50:01 PM »
Hi core.dump
My next recommendation is to heed what that message is telling you. Reboot into Windows and do a normal shutdown. Then try
mounting again.

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: Help with NTFS mount
« Reply #5 on: December 16, 2019, 02:03:41 PM »
Hi, core.dump. I have an external USB hard drive formatted with ntfs (why ntfs? It's a long story...) and I can mount it rw without doing anything special. The ntfs-3g.tcz extension is required.

Code: [Select]
$ tce-load -wi ntfs-3g
$ sudo mkdir /mnt/usb
$ sudo mount -t ntfs-3g /dev/sdb1 /mnt/usb

After the above, I can create new files at the mount point (as regular user) without any issues.

Rich is usually right ;) Try again after a normal Windows shutdown.
« Last Edit: December 16, 2019, 02:15:18 PM by GNUser »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Help with NTFS mount
« Reply #6 on: December 17, 2019, 04:10:51 AM »
Google says Windows 8 to 10 act that way if they have ever been hibernated... "-o remove_hiberfile" to mount will let you use ntfs-3g in rw mode, but at the cost of removing whatever Windows is storing there. You have been warned.
The only barriers that can stop you are the ones you create yourself.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Help with NTFS mount
« Reply #7 on: December 17, 2019, 06:44:48 AM »
Hi core.dump
My next recommendation is to heed what that message is telling you. Reboot into Windows and do a normal shutdown. Then try
mounting again.

Hi,
yes I tried, but nothing changes, it still refuses to mount rw, stating "Windows is hibernated" but, as I said, I don't use the hibernate mode when shutting down Windows (I have explicitly deactivated that feature).

Could it depend on the fact the unit is a M.2 SSD? Even though it sounds stupid... there is no reason why it should make any differences :(

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Help with NTFS mount
« Reply #8 on: December 17, 2019, 10:05:56 AM »
Hi core.dump
According to Microsoft (emphasis is mine) :
Quote
The Hiberfil.sys hidden system file is located in the root folder of the drive where the operating system is installed. The Windows Kernel Power Manager reserves this file when you install Windows. The size of this file is approximately equal to how much random access memory (RAM) is installed on the computer. ...
Even if you never used hibernation mode, windows places the file there during installation.

Disable hibernation mode:
Quote
To make hibernation unavailable, follow these steps:

    1. Press the Windows button on the keyboard to open Start menu or Start screen.
    2. Search for cmd. In the search results list, right-click Command Prompt, and then click Run as Administrator.
    3. When you are prompted by User Account Control, click Continue.
    4. At the command prompt, type powercfg.exe /hibernate off, and then press Enter.
    5. Type exit, and then press Enter to close the Command Prompt window.

Information was found here:
https://support.microsoft.com/en-us/help/920730/how-to-disable-and-re-enable-hibernation-on-a-computer-that-is-running

While it's not mentioned in the above link, other sources state the file is removed when disabling hibernation via the command line.

Offline core.dump

  • Jr. Member
  • **
  • Posts: 50
Re: Help with NTFS mount
« Reply #9 on: December 17, 2019, 11:44:02 AM »
Hi core.dump
According to Microsoft (emphasis is mine) :
Quote
The Hiberfil.sys hidden system file is located in the root folder of the drive where the operating system is installed. The Windows Kernel Power Manager reserves this file when you install Windows. The size of this file is approximately equal to how much random access memory (RAM) is installed on the computer. ...
Even if you never used hibernation mode, windows places the file there during installation.

Disable hibernation mode:
Quote
To make hibernation unavailable, follow these steps:

    1. Press the Windows button on the keyboard to open Start menu or Start screen.
    2. Search for cmd. In the search results list, right-click Command Prompt, and then click Run as Administrator.
    3. When you are prompted by User Account Control, click Continue.
    4. At the command prompt, type powercfg.exe /hibernate off, and then press Enter.
    5. Type exit, and then press Enter to close the Command Prompt window.

Information was found here:
https://support.microsoft.com/en-us/help/920730/how-to-disable-and-re-enable-hibernation-on-a-computer-that-is-running

While it's not mentioned in the above link, other sources state the file is removed when disabling hibernation via the command line.

Thanks a lot, Rich!
By following these steps it works perfectly, now I'm able to mount the Windows patrition in rw mode.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11694
Re: Help with NTFS mount
« Reply #10 on: December 17, 2019, 12:03:17 PM »
Hi core.dump
You are welcome. Thank you for confirming it worked. I will mark this as solved.