Debian Configuration :: Automount External USB HD Using Udev
Jan 23, 2011
I have a problem copying my udev rules from other distro to another pc running debian. My box is running debian without any DE and I want my USB disks to be automounted based on the label; I believe udev is the nicest way to do this task.
Anyways : my rules are (copied from archlinux wiki btw)
cat /etc/udev/rules.d/92-my-media-automount.rules
# vim:enc=utf-8:nu:ai:si:et:ts=4:sw=4:ft=udevrules:
# /etc/udev/rules.d/92-my-media-automount.rules
# Only work on sd*
KERNEL!="sd[a-z]*", GOTO="my_media_automount_end"
ACTION=="add", PROGRAM!="/sbin/blkid %N", GOTO="my_media_automount_end" .....
I notice the directory is made successfully up inserting the usb HD, but the mount doesn't succeed. If I manually execute above command, the mount goes ok.
I'm running Debian 8.2 and trying to set up so I can plug in a couple of external hard drives that will be used to sync data between systems using rsync.
I've got the rsync bit working how I want, thats not a issue. But what I can't seem to get to work properly is when I plug the devices in, they don't mount automatically.
I've tried various methods to no avail so far, systemd.automount in fstab doesn't seem to want to work, for some reason it gives a I/O error. I've tried setting up udev rules and they don't work either, so I'm a bit of a loss now.
Not sure what info to provide that would be relevant at this time, but can add logs as required easy enough.
This machine is headless, so command line only suggestions would be best. I can access X via the network if I have to, but I'd rather do it by cli for ease of access.
My fstab file
Code: Select all# /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=9b4e9dae-ea53-439a-a7fe-87c371c03803 / xfs defaults 0 1 # /home was on /dev/sda9 during installation
im using Debian (lenny) with 2.6.26 kernel, I'm trying to write udev rules in order to automount my usb pendrive, so I added this rules in udev:
SUBSYSTEM=="block", SUBSYSTEMS=="scsi",ATTRS{vendor}=="OTi ", ATTRS{model}=="Flash Disk ", NAME="penna128M",RUN="/usr/bin/ pmount /dev/penna128M"
I use pmount to install the device as normal user If i connect my device to the usb port I don't see nothing in /media/penna128M, BUT giving at the prompt cat /etc/mtab the last line is:
I have SSD drives without SCT support, because of this I want to tune /sys/block/device-name/device/timeout in order to force mdadm put these drives offline. So, I can see my drive like this:
Where can I tune /sys/block/device-name/device/timeout from 30 to 7 sec only for these drive? I don't want to use rc.local.
Can I create right udev rules for it in /etc/udev/rules.d?
I want to avoid any conflict with /lib/udev/rules.d.
Code: Select all# udevadm monitor --environment --udev monitor will print the received events for: UDEV - the event which udev sends out after rule processing
I'm trying to allow non-root account to use avrdude to program mucrocontrollers. There are many articles online about how to do that, but it seems not to work for me. Every time i try to execute avrdude it says "permission denied". Here's "$ udevadm info --name=/dev/bus/usb/002/011 --attribute-walk" says looking at device '/devices/pci0000:00/0000:00:1d.1/usb2/2-1':
However, after restarting udev, replugging the device, even rebooting the computer I still get "permission denied". The Vendor and Product match, so what's the problem?
I have a small issue where an USB harddisk is not automounting. CD's, USB pens etc. are automounting without issues, so it is a little bit strange.I am mounting it with UUID, because I want the mount point to be the same everytime.As you can see from the fstab, it is NTFS.
dmesg [92.388083] usb 1-1: new high speed USB device using ehci_hcd and address 4 [93.079778] usb 1-1: New USB device found, idVendor=0bc2, idProduct=0502
I have just bought a DVB-T usb dongle to watch some TV. The software I'm using is vdr, which has to be started through the /etc/init.d/vdr service. I have created a udev script that executes the service on device insertion. It works nicely, however now when I boot up the computer it takes ages to get to desktop. I believe it is because of the WAIT_FOR part. But without this part, the service starts too soon because the usb dongle has been inserted but the firmware has not finished loading. Can someone point out an alternative way to do it? The script is here [URL].
After yesterdays upgrade of Squeeze, my Synaptics touchpad's udev configuration is ignored on my EeePC. It was working fine before. Are there any changes in how it is supposed to be configured or is it just broken?
I've just installed 'Testing' on a VMware server and after I completed the install with no problems, the system booted into the kernel and I noticed the following start up process error:
startpar: service(s) returned failure: udev...failure!
I have not seen this before and am not sure if it's related to the fact that this is a virtual machine and not a physical server or something else.
How to hardcode/fix a udev roule for /dev/input/event0?For example my touchscreen device jumped after restart, sometimes will be recognized as input3 and sometimes as input0.
I have installed a minimal system with openbox window decorator. (without any window manager) when i insert a flash disk to my computer, system doesn't mount it automaticly. i must mount it to a folder to use it.
I'm running Debian sid and currently have xfce 4.8.0 installed. I have the thunar-volman package and it is configured to automount everything (cdrom & usb). I have hal, udev, gamin and autofs installed as well.For some reason though, automount just isn't working. It's starting to annoy me.I can mount the devices manually.I looked around already but most posts just advise you to install hal or something.
I am using a 3rd party kernel driver that does not support udev properly. When I was using wheezy I placed the required device files in /lib/udev/devices.
The udev in jessie does not appear to support this. Is there any way to have udev create these device files or will I have to create then using a script at boot-up?
I have a trayless SATA hotswap bay that is really terrific for quickly attaching and removing SATA hard drives. I'm trying to write a udev rule to create a symbolic link to the device node for the drive that is attached through the hotswap bay (/dev/bay -> /dev/sdX). This eliminates any ambiguity when performing destructive tasks (fdisk, etc). I'm running squeeze amd64. I've read through several tutorials and have it working somewhat. Here's the output of udevadm info for a drive attached via the hotswap bay.
Here is my udev rule DEVPATH=="/devices/pci0000:00/0000:00:11.0/host7/*", SUBSYSTEM=="block", SYMLINK+="bay%n"
This produces the desired behavior and gives me an fdisk-able device node. The problem I am having is that the "host" component of the DEVPATH varies from bootup to bootup. I'm just using on onboard SATA, host2-7, specifically host7. There is also onboard PATA, host0-1. It seems to just be random which "host"s are assigned to which controller. For example, the next time I boot the system, the onboard SATA will be host0-5 and the onboard PATA will be host6-7. In this simple case, I could just write 2 rules, one for each possibility and it would still be correct because of the different PCI addresses of the two controllers. But on systems with more SCSI (uh... libata, actually) controllers, a "host" file can point to different physical ports between bootstraps. This would be bad. Does anyone know of a way to write a rule to tie a device node to a specific physical SATA port on the motherboard/hba?
If you want, skip straight to the 'QUESTION' at the end of my post & refer to the 'EXPLANATION' later. EXPLANATION: Using Debian 6.01 Squeeze 64-bit. Just put together a brand new 3.3Ghz 6-core AMD. I had a nightmare with my Highpoint 640 raid controller, apparently because Debian Squeeze now handles raid through sysfs rather than /proc/scsi. The solution to this, of course, is to recompile the kernel with the appropriate module for /proc/scsi support. So I thought "screw that" and I've yanked out the raid card & went with Debians software raid. This allowed me to basically complete my mission. The raid is totally up and running, except for one final step... I can't get the raid to automount at boot.
My hardware setup; - Debian is running totally on a 64Gb SSD. (sda) - I have 3x 2Tb hard drives used for storage on a raid 1 array (sdc,sdd,sde)
After some weeks of use and occasional unplugging-when-busy, my 500GB external USB hard drive no longer will automatically mount when I plug it in. The blue light lights up when I plug it in, but there is no automounting behavior. Also, when I type
Code: tom@zeppelin:~$ sudo mount -a nothing happens. The result of fdisk:
Code: tom@zeppelin:~$ sudo fdisk -l Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xed1f86f7 .....
On my debian lenny OS I have an external usb hard disk I would like to automount it at boot. So I edited the /etc/fstab file in order to automount /dev/sdb1. It worked without problem. Then I recompiled the kernel and, as consequence, /dev/sdb1 changed to /dev/sdc1. I started playing with udev in order to match the now called /dev/sdc1 and to change its name in /dev/maxtor (being maxtor the brand of the hard disk). Obviously I edited also /etc/fstab: /dev/sdb1 is now /dev/maxtor.
The boot automount doesn't work anymore. On the boot sequence I can read the message "Mounting local filesystem...mount: special device /dev/maxtor does not exist FAILED". But when I log into the system I can run the command "mount /dev/maxtor /mnt/maxtor" and it works! So, IMHO, my udev rule is correct otherwise also the manual mount wouldn't work, right? I have to tell to udev to create /dev/maxtor BEFORE the boot automount process.
I tried to delete my udev rule and to edit /etc/fstab changing /dev/maxtor in /dev/sdc1 (the name udev gave to my hard disk after kernel recompile, before was /dev/sdb1) and it didn't work: on boot process I always see the "Mounting local filesystem...mount: special device /dev/sdc1 does not exist Failed". Then I tried to change /dev/sdc1 in /dev/sdb1 in /etc/fstab and to reboot with the old original kernel and int this way it works. With my compiled kernel, the OS seems to have lost the capacity to detect my device node correctly.
Everyone seems to what to know how to automount an external USB drive. I'm trying to stop 9.10 from automounting it. Normally I use fstab to mount an external drive where I prefer it to be mounted. But after the last software update karmic (9.10) is now automounting my drive and screwing up the fstab mount. Some how the drive is showing up as /dev/hdd1 and /dev/hde1. I could just shutoff automount but I like it for USB sticks and cameras and MP3 players. How do you stop automount from mounting just an exteral USB drive??
I'm trying to setup my media streaming server, and everytying is going quite well, but there's one thing I don't understand. Can you have ubuntu automatically pick up and mount your external USB drive when you switch it on? I don't like leaving the hard drive running, and I only need to have it on when I want to stream something, but it seems to lose the mount when I switch it off and on again. Anyway to make it automatically detect that it's on and mount it back onto my mount point?
My external HD where everything I backed up from my previous install will not mount. It shows up in lsusb, but when I do dmesg:
Code: [20801.408614] usb 1-3: USB disconnect, address 36 [20804.190095] usb 1-3: new high speed USB device using ehci_hcd and address 38 [20804.343675] usb 1-3: string descriptor 0 malformed (err = -61), defaulting to 0x0409 [20804.345100] usb 1-3: configuration #1 chosen from 1 choice
Also of note, my main filesystem is reiserfs, so there isn't a problem of not having reiser installed.
I have an external harddisk (actually removed from a laptop) and I want do some analysis and data recovery on it. I bought a sata-to-usb adapter. Now the problem is: if I deselect media_automount "media_automount_open" and I select "media_autorun_never", the external sata driver is not recognised and I have no /dev/sdb1 to manually mount. Not a hint of a newly plugged drive in dmesg.
Then I re-enabled automount and then I remounted the drives as read-only. Afterward I starter cloning the hd with dd.After some three hours, the f*ck*ng laptop remounted the partition rw and the dd process went into io error. So the question is: how can I safely work with a usb device with manual operations?
i have two centos systems one automounts the external usb hard drive and other doesn't what do you think could be missing in the system that is not automounting the external usb drive.
11.3 in use with KDE. When I plug in an USB stick or my HTC phone into the USB connector the device is recognised but can't be opened in dolphin. This is the error message:
Code: org.freedesktop.Hal.Device.PermissionDeniedByPolicy: org.freedesktop.hal.storage.mount-removable auth_admin_keep_always <-- (action, result) but the device is shown in dolphin as a removable device and
Code: # lsusb Bus 001 Device 005: ID 0bb4:0ff9 High Tech Computer Corp.
When I plug my USB drive in, the kernel sees it and I can mount it manually. However, it won't automount. I've done plenty of google searches but nothing I've tried has worked for 'GNOME, SUSE 11.3.' I am not sure if it is a permissions problem, configuration problem, a kernel automount, HID, or USB problem.
uname -a (stock SUSE desktop kernel): Code: Linux linux-hez9 2.6.34.7-0.7-desktop #1 SMP PREEMPT 2010-12-13 11:13:53 +0100 i686 i686 i386 GNU/Linux
Here is the output from /var/log/messages: Code: Feb 14 15:47:09 linux-hez9 kernel: [16258.620213] usb 1-1: new high speed USB device using ehci_hcd and address 6 Feb 14 15:47:09 linux-hez9 kernel: [16258.749549] usb 1-1: New USB device found, idVendor=1058, idProduct=1023 Feb 14 15:47:09 linux-hez9 kernel: [16258.749553] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 .....
I have a luks-encrypted external drive with lvm on top. When I plug it in xfce prompts me (twice as usual) for the encryption phrase. Then, unlike when I have a regular file system on top and it automounts, I need to activate the volumes and manually mount. Is there a way to make these steps happen automatically?
I'm trying to set up an SSD as a cache to my external HDD (which is where my installation of Debian testing/stretch is installed). My installation is using LVM 2. I'm trying to have the SSD cache the entire external HDD, and not just one of the partitions (such as the root or home partitions).
Here are the relevant outputs.
uname -a: (Yes, I'm using the Debian stable kernel with Debian testing.)
Recently (in 2015) our Debian systems started not to recognize HDDs connected via an external docking station.
On my computer I run: (uname -a)
* Linux violin 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) x86_64 GNU/Linux * If I connect to a flashdrive to the USB2 port, it is recognized as sd* (messages are also written to dmesg/syslog) * If I connect the USB3 connector of the external docking station with an 1TB WD SATA docked, to this USB2 port (the external docking station has its own power supply, so I do not expect to have a problem with the current, the drive spins up and is spinning), there is nothing in the dmesg/syslog, and no new items under /dev/sd* or lsusb or similar tools. * If I connect the same external docking station with the same disk via eSATA on a different computer it is recognized. That computer runs the same debian. If I connect through its USB2 port it does not work either. * I also tried another docking station and USB cable.
I have exim setup on squeeze to run as an "internet site". Outgoing mail works fine but it seems to just ignore incoming smtp requests on port 25. I can see the incoming connection via tcpdump but exim doesn't seem to talk. If I connect via telnet it rather quickly says connection refused. Is there something additional I need in the Exim conf?