Bug #461

Latest update breaks USB Automount

Added by UniCav over 11 years ago. Updated almost 11 years ago.

Status:Closed Start date:
Priority:Normal Due date:12/31/1969
Assignee:cecil % Done:

0%

Category:- Spent time: -
Target version:7.3

Description

After running pacman last night and again this morning (7/28/09) to finish updates my external USB drives won't mount anymore. This has been working perfectly since udev was fixed but it's broken again. There are the usual entries in dmesg and messages.log that the drive is found and identified and I can manually mount the drive and play videos but it no longer even attempts to mount the drive automatically in /media

History

Updated by GregFrost over 11 years ago

One of the packages upgraded was hal. try reverting to an older hal from your cache to see if it fixes your issue and report back.

Updated by UniCav over 11 years ago

It's udev-135-5.
Rolling back hal to hal-0.5.11-4 had no effect so I rolled udev back to udev-135-4 and it worked.
Updated hal back to hal-0.5.11-5 and it is still working

Updated by jams over 11 years ago

Unfortunatly the way automount was implemented it had some nasty side effects.
For installs with new harddrives it caused the install to fail, and post install it was causing data corruption.
Because of this it was disabled.

If it was working fine for you, then I suggest making your own udev rules file and placing the rules in it.

Updated by UniCav over 11 years ago

Probably related to the problems I had with my 2nd hard drive getting mounted automatically in /media and then reverting to it randomly on reboot. I'll do some research on the udev rules and see about making my own and bring the package back up to current and use them.

Updated by Human over 11 years ago

I can confirm that there's no auto-mounting of USB mass storage in the latest ISO built from git sources.

Updated by UniCav over 11 years ago

I created a udev rule culled from several sources on the net and placed it in /etc/udev/rules.d. I posted it on the Knoppmyth General forum this morning. Here's a copy of it:

KERNEL=="sd[c-z]", SUBSYSTEMS=="usb", NAME="%k", SYMLINK+="usb%m", GROUP="users"
ACTION=="add", KERNEL=="sd[c-z][0-9]", SYMLINK+="usb%n", GROUP="users", NAME="%k"
ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mkdir -p /media/$env{ID_FS_LABEL}"
ACTION=="add", KERNEL=="sd[c-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,sync,noatime /dev/%k /media/$env{ID_FS_LABEL}"
ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/umount -l /media/$env{ID_FS_LABEL}"
ACTION=="remove", KERNEL=="sd[c-z][0-9]", RUN+="/bin/rmdir /media/$env{ID_FS_LABEL}"

The idea is it will only target usb devices and I deliberately started with sdc to skip my 2nd hard drive. It seems to mount properly by disk label and umounts and removes the directory properly but it needs testing and I'm sure could be tweaked and cleaned up.

Updated by Human over 11 years ago

I wanted to add that when I booted the installation CD, the installer mounted the USB Mass Storage device (thumb drive) I had attached and offered it as an option for the installation target. So it looks as if automounting works in the installer but fails post-install. Jams, if you had to disable it due to side-effects, should it also be disabled in the installer?

Updated by jams over 11 years ago

It's disabled in both spots.
The USB flash drive being offered as an installation target is intended behaviour. The drive was available when udev started so the drive was mounted.
It's the automounting after the system boots that causes problems.

Updated by Human over 11 years ago

Re-classified as a feature request and re-opened. It would be very nice if users could attach USB Mass Storage devices and automount them for copying media to/from them.

Updated by cecil over 11 years ago

I found a lightweight volume manager in AUR. Initial testing is going well with the following exception:

  • Doesn't seem to mount on boot (with a USB device plugged in).
  • Must restarted (although it does start on boot) in order for it to work...

Removed your usb rule (move it to /home/mythtv).

sudo sv restart hal sudo pacman -Sy skvm

Updated by Human over 11 years ago

After a 'pacman -Syu'

# pacman -Sy skvm :: Synchronizing package databases... core-testing is up to date extra-testing is up to date warning: provider package was selected (skvm-hg provides skvm) resolving dependencies... looking for inter-conflicts... Targets (1): skvm-hg-0.1-2 Total Download Size: 0.01 MB Total Installed Size: 0.08 MB Proceed with installation? [Y/n] :: Retrieving packages from core-testing... skvm-hg-0.1-2-i686 8.4K 83.0K/s 00:00:00 [#####################] 100% checking package integrity... (1/1) checking for file conflicts [#####################] 100% (1/1) installing skvm-hg [#####################] 100% adding skvm warning: skvm: unable to open supervise/ok: file does not exist error: scriptlet failed to execute correctly

Updated by cecil over 11 years ago

Found and modified a udev rule and script to take care of this bug. You can remove skvm as it isn't needed.

sudo pacman -R skvm-hg sudo killall -9 skvm-hg sudo pacman -Sy udev sudo sv restart hal

Worked w/o issue here, so please test and let me know. If your thumb drive has a label then it will mount /media/$label else /media/usb-$dev.

Updated by Human over 11 years ago

Worked great for me post-reboot. I haven't tried unplugging and plugging back in yet, though.

Updated by UniCav over 11 years ago

I'm out of the loop for a couple weeks. Will try this on my box ASAP and get back to you.

Updated by Human over 11 years ago

I removed my USB thumb drive, and now I get this behavior:

[mythtv@dragon ~]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 4.9G 2.4G 2.2G 52% / none 496M 0 496M 0% /dev/shm /dev/sda3 146G 86G 52G 63% /myth df: `/media/usb-sdb1': Input/output error [mythtv@dragon ~]$ mount /dev/sda1 on / type auto (rw,noatime) none on /dev type ramfs (rw) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /dev/pts type devpts (rw) none on /dev/shm type tmpfs (rw) /dev/sda3 on /myth type ext4 (rw,noatime) /dev/sdb1 on /media/usb-sdb1 type vfat (rw,noexec,nosuid,nodev,noatime,flush,quiet,dmask=000,fmask=111)

Looks like it's not unmounting automatically. Even if yanking it without unmounting is potentially bad for the filesystem on the USB stick, the OS should at least unmount it once it's gone, right?

Updated by cecil over 11 years ago

I've modified the rule to cleanly unmount. Works fine in testing here!

sudo pacman -Sy udev sudo sv restart hal

Also available in: Atom PDF