Re: umount usb stick via udev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Thu, Oct 7, 2010 at 10:18 AM, Benjamin Sambale <bsambale@xxxxxx> wrote:
>
>  Dear arch users,
>
> I managed to mount my usb stick automatically via udev rules (hal isn't running). However, if > I unplug the stick while thunar is open, the umount command hangs. After that I can't
> even reboot. But if I close thunar before unplugging the stick umount works fine.
> Here is my udev rule:
>
> SUBSYSTEMS=="usb", ATTRS{serial}=="07A10809D5B952B9", KERNEL=="sd*", SYMLINK+="unistick%n"
> SUBSYSTEMS=="usb", ATTRS{serial}=="07A10809D5B952B9", KERNEL=="sd*", ACTION=="add", RUN+="/usr/bin/sudo -u benjamin /bin/mount /media/unistick"
> SUBSYSTEMS=="usb", ATTRS{serial}=="07A10809D5B952B9", KERNEL=="sd*", ACTION=="remove", RUN+="umount /media/unistick"
>
> And here is the corresponding line of fstab:
>
> /dev/unistick1          /media/unistick vfat rw,noauto,user,utf8,noatime   0      0
>
> Thanks for any help,
> Benjamin

you could maybe look into autofs, since it can automatically unmount
the device after a period of inactivity, and automatically remount
when activity starts again.

C Anthony


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux