How to disable automount of an harddrive?
I am working on a project, and for this I need to disable the aumounting of hard-drives in Ubuntu both at startup and when I plug an hard-drive.
I tried one solution with "edit-conf" disabling automount at org.gnome.desktop.media-handling but when I plug a hardrive ubuntu still mounts it an open a window even when I restart the computer in between.
There is also the fstab solution but the thing is I don't know in advance the UUID of the drive I don't want to mount automatically.
From want I understand there is the solution of editing an udev rule, but i'm not a specialist of that.
hard-drive automount udev
add a comment |
I am working on a project, and for this I need to disable the aumounting of hard-drives in Ubuntu both at startup and when I plug an hard-drive.
I tried one solution with "edit-conf" disabling automount at org.gnome.desktop.media-handling but when I plug a hardrive ubuntu still mounts it an open a window even when I restart the computer in between.
There is also the fstab solution but the thing is I don't know in advance the UUID of the drive I don't want to mount automatically.
From want I understand there is the solution of editing an udev rule, but i'm not a specialist of that.
hard-drive automount udev
add a comment |
I am working on a project, and for this I need to disable the aumounting of hard-drives in Ubuntu both at startup and when I plug an hard-drive.
I tried one solution with "edit-conf" disabling automount at org.gnome.desktop.media-handling but when I plug a hardrive ubuntu still mounts it an open a window even when I restart the computer in between.
There is also the fstab solution but the thing is I don't know in advance the UUID of the drive I don't want to mount automatically.
From want I understand there is the solution of editing an udev rule, but i'm not a specialist of that.
hard-drive automount udev
I am working on a project, and for this I need to disable the aumounting of hard-drives in Ubuntu both at startup and when I plug an hard-drive.
I tried one solution with "edit-conf" disabling automount at org.gnome.desktop.media-handling but when I plug a hardrive ubuntu still mounts it an open a window even when I restart the computer in between.
There is also the fstab solution but the thing is I don't know in advance the UUID of the drive I don't want to mount automatically.
From want I understand there is the solution of editing an udev rule, but i'm not a specialist of that.
hard-drive automount udev
hard-drive automount udev
edited Jul 15 '14 at 8:47
A J
5,889153357
5,889153357
asked Jul 15 '14 at 8:02
Didier ChavarocheDidier Chavaroche
184
184
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Run these two commands:gsettings set org.gnome.desktop.media-handling automount 'false'
gsettings set org.gnome.desktop.media-handling automount-open 'false'
Or you can try it with a udev rule:sudo nano /etc/udev/rules.d/85-no-automount.rule
Paste this line SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0"
and save the file.
Reboot the system.
It didn't work, I executed the two command then reboote, and when i plugged my hard-drive, ubuntu stills mount it.
– Didier Chavaroche
Jul 16 '14 at 9:33
You can try the udev rule I added above.
– Pabi
Jul 16 '14 at 9:37
I didn't try the rule, but I have a question before, I plug the hard drives directly onto the SATA ports of my computer, How should I translate the rule? SUBSYSTEM=="sata"?
– Didier Chavaroche
Jul 25 '14 at 9:35
add a comment |
You can try to add the module to the blacklist:
sudo gedit /etc/modprobe.d/blacklist.conf
add:
blacklist usb-storage
or
echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf
Enabling it later should just be:
sudo modprobe usb-storage
add a comment |
As Pabi wrote in his answer, run this command:
gsettings set org.gnome.desktop.media-handling automount 'false'
BUT: this will probably not be effective until the next reboot.
Lack of a reboot caused me to doubt the effectiveness of gsettings initially. I found it when being very thorough in preparation for filing a bug, which I found I didn't need to do. I've only tried this under sudo, however, so if you still have trouble, try doing it that way. I want this effective system-wide and found this does the job.
You do not need to touch automount-open because it only applies when an automount happens, and you will have disabled that.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f497958%2fhow-to-disable-automount-of-an-harddrive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Run these two commands:gsettings set org.gnome.desktop.media-handling automount 'false'
gsettings set org.gnome.desktop.media-handling automount-open 'false'
Or you can try it with a udev rule:sudo nano /etc/udev/rules.d/85-no-automount.rule
Paste this line SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0"
and save the file.
Reboot the system.
It didn't work, I executed the two command then reboote, and when i plugged my hard-drive, ubuntu stills mount it.
– Didier Chavaroche
Jul 16 '14 at 9:33
You can try the udev rule I added above.
– Pabi
Jul 16 '14 at 9:37
I didn't try the rule, but I have a question before, I plug the hard drives directly onto the SATA ports of my computer, How should I translate the rule? SUBSYSTEM=="sata"?
– Didier Chavaroche
Jul 25 '14 at 9:35
add a comment |
Run these two commands:gsettings set org.gnome.desktop.media-handling automount 'false'
gsettings set org.gnome.desktop.media-handling automount-open 'false'
Or you can try it with a udev rule:sudo nano /etc/udev/rules.d/85-no-automount.rule
Paste this line SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0"
and save the file.
Reboot the system.
It didn't work, I executed the two command then reboote, and when i plugged my hard-drive, ubuntu stills mount it.
– Didier Chavaroche
Jul 16 '14 at 9:33
You can try the udev rule I added above.
– Pabi
Jul 16 '14 at 9:37
I didn't try the rule, but I have a question before, I plug the hard drives directly onto the SATA ports of my computer, How should I translate the rule? SUBSYSTEM=="sata"?
– Didier Chavaroche
Jul 25 '14 at 9:35
add a comment |
Run these two commands:gsettings set org.gnome.desktop.media-handling automount 'false'
gsettings set org.gnome.desktop.media-handling automount-open 'false'
Or you can try it with a udev rule:sudo nano /etc/udev/rules.d/85-no-automount.rule
Paste this line SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0"
and save the file.
Reboot the system.
Run these two commands:gsettings set org.gnome.desktop.media-handling automount 'false'
gsettings set org.gnome.desktop.media-handling automount-open 'false'
Or you can try it with a udev rule:sudo nano /etc/udev/rules.d/85-no-automount.rule
Paste this line SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0"
and save the file.
Reboot the system.
edited Jul 16 '14 at 9:37
answered Jul 15 '14 at 8:07
PabiPabi
5,67433042
5,67433042
It didn't work, I executed the two command then reboote, and when i plugged my hard-drive, ubuntu stills mount it.
– Didier Chavaroche
Jul 16 '14 at 9:33
You can try the udev rule I added above.
– Pabi
Jul 16 '14 at 9:37
I didn't try the rule, but I have a question before, I plug the hard drives directly onto the SATA ports of my computer, How should I translate the rule? SUBSYSTEM=="sata"?
– Didier Chavaroche
Jul 25 '14 at 9:35
add a comment |
It didn't work, I executed the two command then reboote, and when i plugged my hard-drive, ubuntu stills mount it.
– Didier Chavaroche
Jul 16 '14 at 9:33
You can try the udev rule I added above.
– Pabi
Jul 16 '14 at 9:37
I didn't try the rule, but I have a question before, I plug the hard drives directly onto the SATA ports of my computer, How should I translate the rule? SUBSYSTEM=="sata"?
– Didier Chavaroche
Jul 25 '14 at 9:35
It didn't work, I executed the two command then reboote, and when i plugged my hard-drive, ubuntu stills mount it.
– Didier Chavaroche
Jul 16 '14 at 9:33
It didn't work, I executed the two command then reboote, and when i plugged my hard-drive, ubuntu stills mount it.
– Didier Chavaroche
Jul 16 '14 at 9:33
You can try the udev rule I added above.
– Pabi
Jul 16 '14 at 9:37
You can try the udev rule I added above.
– Pabi
Jul 16 '14 at 9:37
I didn't try the rule, but I have a question before, I plug the hard drives directly onto the SATA ports of my computer, How should I translate the rule? SUBSYSTEM=="sata"?
– Didier Chavaroche
Jul 25 '14 at 9:35
I didn't try the rule, but I have a question before, I plug the hard drives directly onto the SATA ports of my computer, How should I translate the rule? SUBSYSTEM=="sata"?
– Didier Chavaroche
Jul 25 '14 at 9:35
add a comment |
You can try to add the module to the blacklist:
sudo gedit /etc/modprobe.d/blacklist.conf
add:
blacklist usb-storage
or
echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf
Enabling it later should just be:
sudo modprobe usb-storage
add a comment |
You can try to add the module to the blacklist:
sudo gedit /etc/modprobe.d/blacklist.conf
add:
blacklist usb-storage
or
echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf
Enabling it later should just be:
sudo modprobe usb-storage
add a comment |
You can try to add the module to the blacklist:
sudo gedit /etc/modprobe.d/blacklist.conf
add:
blacklist usb-storage
or
echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf
Enabling it later should just be:
sudo modprobe usb-storage
You can try to add the module to the blacklist:
sudo gedit /etc/modprobe.d/blacklist.conf
add:
blacklist usb-storage
or
echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf
Enabling it later should just be:
sudo modprobe usb-storage
answered Jul 16 '14 at 11:01
Ruslan GerasimovRuslan Gerasimov
3,06221220
3,06221220
add a comment |
add a comment |
As Pabi wrote in his answer, run this command:
gsettings set org.gnome.desktop.media-handling automount 'false'
BUT: this will probably not be effective until the next reboot.
Lack of a reboot caused me to doubt the effectiveness of gsettings initially. I found it when being very thorough in preparation for filing a bug, which I found I didn't need to do. I've only tried this under sudo, however, so if you still have trouble, try doing it that way. I want this effective system-wide and found this does the job.
You do not need to touch automount-open because it only applies when an automount happens, and you will have disabled that.
add a comment |
As Pabi wrote in his answer, run this command:
gsettings set org.gnome.desktop.media-handling automount 'false'
BUT: this will probably not be effective until the next reboot.
Lack of a reboot caused me to doubt the effectiveness of gsettings initially. I found it when being very thorough in preparation for filing a bug, which I found I didn't need to do. I've only tried this under sudo, however, so if you still have trouble, try doing it that way. I want this effective system-wide and found this does the job.
You do not need to touch automount-open because it only applies when an automount happens, and you will have disabled that.
add a comment |
As Pabi wrote in his answer, run this command:
gsettings set org.gnome.desktop.media-handling automount 'false'
BUT: this will probably not be effective until the next reboot.
Lack of a reboot caused me to doubt the effectiveness of gsettings initially. I found it when being very thorough in preparation for filing a bug, which I found I didn't need to do. I've only tried this under sudo, however, so if you still have trouble, try doing it that way. I want this effective system-wide and found this does the job.
You do not need to touch automount-open because it only applies when an automount happens, and you will have disabled that.
As Pabi wrote in his answer, run this command:
gsettings set org.gnome.desktop.media-handling automount 'false'
BUT: this will probably not be effective until the next reboot.
Lack of a reboot caused me to doubt the effectiveness of gsettings initially. I found it when being very thorough in preparation for filing a bug, which I found I didn't need to do. I've only tried this under sudo, however, so if you still have trouble, try doing it that way. I want this effective system-wide and found this does the job.
You do not need to touch automount-open because it only applies when an automount happens, and you will have disabled that.
answered Jan 20 at 22:28
4dummies4dummies
389
389
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f497958%2fhow-to-disable-automount-of-an-harddrive%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown