4

I believe the question is clear. But will add some details and history. I have two systems Win10 and Manjaro Linux. After reboot from Windows to Linux, I try to mount NTFS file systems, and mount often fails with the message about unclean cache. The medicine is ntfsfix /dev/sdXX or better ntfsfix /dev/disk/by-label/my-ntfs-partition I added string to fstab:

LABEL=Media        /media/Media    ntfs   nofail         0       2

I want Linux fixes NTFS for me. So if mount fails, it should call ntfsfix, and then retry mount. Please help me to explain Linux what I want. enter image description here

1 Answer 1

1

Create a bash file containing the following and set it to run at startup.

#!/bin/bash

#delay for 10 seconds 
sleep 10

#Check to see if Media has failed to mount and carry out the fix
if ! mount | grep Media > /dev/null; then
    ntfsfix /dev/disk/by-label/my-ntfs-partition && mount -t ntfs /dev/path/to/ntfsdisk /media/Media
else
    exit
fi

Running scripts on startup varies depending on the desktop environment so I can't really comment on that. E.g. Achieving it in Gnome is different to Openbox.

2
  • Thank you for idea. But I want to add this script into system's autostart. Not user's. I already know the right way. Will add it here after test.
    – kyb
    Commented Aug 19, 2016 at 14:44
  • Ah, okey dokey. No bother Commented Aug 19, 2016 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .