[CentOS] Udev Rules for mounting usb disks

Rainer Traut tr.ml at gmx.de
Tue Jan 20 13:17:40 UTC 2009


Hi,

Sys: C5.2, X86_64

my plan is to automatically mount five same brand usb disks in five 
different directories.

I have written the following udev rule;
Problem is, it does not mount them on boot, only when I plug them in.

KERNEL=="sd*", SYSFS{serial}=="57442D574341554830303133323337", 
SYSFS{product}=="My Book", SYMLINK+="usbdisc0", ACTION=="add", 
RUN+="/bin/mount -o noatime /dev/usbdisc0 /mnt/woche1"
KERNEL=="sd*", SYSFS{serial}=="57442D574341554631383831303534", 
SYSFS{product}=="My Book", SYMLINK+="usbdisc1", ACTION=="add", 
RUN+="/bin/mount -o noatime /dev/usbdisc1 /mnt/woche2"
KERNEL=="sd*", SYSFS{serial}=="57442D574341554631383831343136", 
SYSFS{product}=="My Book", SYMLINK+="usbdisc2", ACTION=="add", 
RUN+="/bin/mount -o noatime /dev/usbdisc2 /mnt/woche3"
KERNEL=="sd*", SYSFS{serial}=="57442D574341554631383831303930", 
SYSFS{product}=="My Book", SYMLINK+="usbdisc3", ACTION=="add", 
RUN+="/bin/mount -o noatime /dev/usbdisc3 /mnt/woche4"
KERNEL=="sd*", SYSFS{serial}=="57442D574341554B30303239303435", 
SYSFS{product}=="My Book", SYMLINK+="usbdisc4", ACTION=="add", 
RUN+="/bin/mount -o noatime /dev/usbdisc4 /mnt/woche5"

How can I make them mount on boot?

Thx
Rainer



More information about the CentOS mailing list