Windows – Mount Windows partition with read-write permission if possible

mountntfsread-onlywindows

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

Best Answer

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.

Related Question