On a dual-boot laptop I have a partition /dev/nvme0n1p4 which I want to mount as ntfs partition for Ubuntu 22.04 and Windows-10. But really often this partition only mounts as read-only. The entry in the /etc/fstab is as follows:
/dev/nvme0n1p4 /media/Work/ ntfs defaults,uid=1000,gid=1000,umask=022,exec 0 0
But in many cases this partition is mounted as read-only because of some issue. When I unmount and remount I get the output
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Falling back to read-only mount because the NTFS partition is in an
unsafe state. Please resume and shutdown Windows fully (no hibernation
or fast restarting.)
Could not mount read-write, trying read-only
I really do NOT want to reboot the laptop EVERY time in windows just to shut it down!
I can fix this myself by unmounting, fix it and remount, e.g.
sudo umount /dev/nvme0n1p4
sudo ntfsfix /dev/nvme0n1p4
sudo mount -o rw /dev/nvme0n1p4 /media/Work/
But can this be done automatically? Or can the partition be fixed automatically before mounting it with fstab? Might it possible to find and solve the root cause so this issue never will show up again?