2

I have many external hard drives that often I need to run sudo ntfsfix /dev/sdf2 on after coming from a windows boot.

I do shutdown windows, but still this error persists.

I would like to have this command run before the drive auto loads, thus enabling me to use the drive as normal.

2

This usually happens if you have Fast Startup enabled in Windows (as it is by default in Windows 8 and 10).

When shutting down with Fast Startup enabled, Windows does not really perform the complete shut-down procedure. Instead, it ends the user session, minimizes its memory footprint and essentially hibernates. What it does not do, is the equivalent of properly unmounting any local filesystems. If Windows is the only OS on the system, that's not a problem; but if you're dual-booting, it causes the exact problem you seem to be having.

Disabling Fast Startup should elimenate the requirement to routinely run ntfsfix.

1

While not a simple answer,you can add udev rules to accomplish this.

I looked around and couldn't find any NTFS disks to write an example, but the ceph project uses this for auto-mounting disks.

Their needs are far broader than yours but look through these files.

https://github.com/ceph/ceph/tree/master/udev

With the caveat that I am unable to test, the rule you will need to add will look similar to this.

ACTION=="add", ENV{ID_FS_TYPE}=="ntfs", RUN+="/bin/ntfsfix /dev/%k"
1
  • That was my idea, too, but I see the problem that the automounting has to be delayed somehow. I guess if the block device is opened by fsck then a mount would fail. Maybe the device name could be something which the automounter ignores and be changed after the fsck run is finished. – Hauke Laging Jan 14 '18 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.