How to stop mounts on /media when inserting a USB device. (SD, Flash, etc.)
Hi group,
I thought I had posted this questions before but I can't find it if I did. I need to stop my Linux system from mounting USB drives as /media/xxxn. My problem is I am attempting to create a script that I can use to build a file system on an SD card. When I use fdisk and create the partition, the kernel will use the old partition configuration until it is 'ejected' or a system reboot. I can do an 'eject' then I must re-plug the card and then the system does the mounts. I don't want it to do this! Or is there a way to re-read the partition tables so that I don't need to eject and re-plug? Thanks for your time. |
Take a look at the files in /etc/udev/rules.d/.
You will probably have to configure the UDEV rules. |
instead of doing an "eject" just
Code:
umount /media/xxxn |
You should probably use partprobe. Just install parted, it should come with it.
See: http://www.cyberciti.biz/tips/re-rea...ux-system.html http://linux.die.net/man/8/partprobe |
Must use eject and not umount
Quote:
|
That works
Quote:
It does modify the kernel's partition table. Thanks. |
Quote:
|
for me a combination of umount /media/XXX and partprobe does the trick.
|
This depends largely on what is performing the automount. Many distros set up the desktop environment to perform the automount, in which case, you would need to find the setting in that environment to disable automounting. Some use backend scripts to perform the mount (ie, I've use a combination of udev,pmount, and kludges to make things work my way before).
What distro and what desktop environment are you using? |
Quote:
|
Quote:
|
Quote:
Anyway: http://www.google.com/search?q=ubunt...vent+automount Here are good clues: http://ubuntuforums.org/showthread.php?t=13692 Quote:
Quote:
|
[SOLVED] It is a Gnome thing on my system
Thanks for all of your responses. The one that I found useful was:
System->Preferences->Hardware->Removable DevicesThanks again for your time. |
I hate FC10, what a POS!
Quote:
|
durned fedora 10
|
All times are GMT -5. The time now is 01:37 PM. |