Mount Windows partition with read-write permission if possible

4

0

I'm looking for equivalent of -errors={continue|remount-ro|panic} option which is available for i.a. mount.nfs4 but not for the mount.ntfs.

I need it to mount Windows 10 partition (via /etc/fstab) which sometimes is available with read-write permissions and sometimes is limited to read-only (depending whether Windows was hibernated or fully shut down).

You can find more details about this problem in mount.ntfs manpage:

Windows hibernation and fast restarting

On computers which can be dual-booted into Windows or Linux, Windows has to be fully shut down before booting into Linux, otherwise the NTFS file systems on internal disks may be left in an inconsistent state and changes made by Linux may be ignored by Windows.

So, Windows may not be left in hibernation when starting Linux, in order to avoid inconsistencies. Moreover, the fast restart feature available on recent Windows systems has to be disabled. This can be achieved by issuing as an Administrator the Windows command which disables both hibernation and fast restarting :

    powercfg /h off

patryk.beza

Posted 2015-09-06T18:24:44.280

Reputation: 1 131

2I'm not sure exactly what this question is asking. Are you trying to mount a locked (Hibernated) Windows partition from a Linux OS? Are you trying to mount an unlocked (Full shutdown) Windows partition? I'm not sure, but I'm fairly certain that the most recent versions of Ubuntu automatically mount NTFS partitions with R-W access (When windows is fully shutdown). – Ulincsys – 2015-10-09T04:03:15.970

There are many credible sources that say that a Windows partition should only be mounted as read-only, or you risk losing your Windows installation. You don't need us to find this - a simple google query is enough. Please explain what you really want. – harrymc – 2015-10-12T18:04:12.873

I want to mount Windows 10 partition in read-write mode if possible with fallback to read-only mount. Note that there are two primary NTFS drivers for Linux - NTFS-3g and kernel implementation. I guess that you refer to kernel's NTFS implementation that supports limited write operation.

– patryk.beza – 2015-12-29T15:55:50.467

Answers

3

You could use 2 lines in your fstab:

1) with the options: norecover,nobootwait

2) with the options: ro,norecover,nobootwait

If windows was shut down properly, the first will succeed, you get a rw mount, and the second line will fail, but your system should continue to boot.

If windows was hibernated, the first one fails, and falls through to the second, and you get a ro mount.

You may need to take additional steps to ensure continued system booting if one fstab line fails. Systemd users might need to add "nofail" to the options.

Haven't tested this exact scenario, but something like this should work for you or may inspire somebody else to a better answer.

Alex Stragies

Posted 2015-09-06T18:24:44.280

Reputation: 1 320