Execute command before auto mounting a disk drive
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
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.
terminal hard-disk automounting
add a comment |Â
up vote
2
down vote
favorite
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.
terminal hard-disk automounting
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
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.
terminal hard-disk automounting
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.
terminal hard-disk automounting
asked Jan 13 at 23:10
Jamie Hutber
1001212
1001212
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
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", ENVID_FS_TYPE=="ntfs", RUN+="/bin/ntfsfix /dev/%k"
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 byfsck
then a mount would fail. Maybe the device name could be something which the automounter ignores and be changed after thefsck
run is finished.
â Hauke Laging
Jan 14 at 11:25
add a comment |Â
up vote
1
down vote
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
.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
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", ENVID_FS_TYPE=="ntfs", RUN+="/bin/ntfsfix /dev/%k"
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 byfsck
then a mount would fail. Maybe the device name could be something which the automounter ignores and be changed after thefsck
run is finished.
â Hauke Laging
Jan 14 at 11:25
add a comment |Â
up vote
1
down vote
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", ENVID_FS_TYPE=="ntfs", RUN+="/bin/ntfsfix /dev/%k"
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 byfsck
then a mount would fail. Maybe the device name could be something which the automounter ignores and be changed after thefsck
run is finished.
â Hauke Laging
Jan 14 at 11:25
add a comment |Â
up vote
1
down vote
up vote
1
down vote
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", ENVID_FS_TYPE=="ntfs", RUN+="/bin/ntfsfix /dev/%k"
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", ENVID_FS_TYPE=="ntfs", RUN+="/bin/ntfsfix /dev/%k"
answered Jan 14 at 4:19
gdahlm
50136
50136
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 byfsck
then a mount would fail. Maybe the device name could be something which the automounter ignores and be changed after thefsck
run is finished.
â Hauke Laging
Jan 14 at 11:25
add a comment |Â
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 byfsck
then a mount would fail. Maybe the device name could be something which the automounter ignores and be changed after thefsck
run is finished.
â Hauke Laging
Jan 14 at 11:25
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 at 11:25
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 at 11:25
add a comment |Â
up vote
1
down vote
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
.
add a comment |Â
up vote
1
down vote
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
.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
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
.
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
.
answered Jan 14 at 7:57
telcoM
10.8k11132
10.8k11132
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f416932%2fexecute-command-before-auto-mounting-a-disk-drive%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password