Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Currently my distribution of choice (ArchLinux) has an automounting script like this:

KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"

But that will automount only partitions up to sdX9. I do have USB drives with 6 or more partitions (that is, starting from 5, up to 12, 13, 19).

All partitions have VFAT on them and have labels (the label is used for naming the mountpoint).

I have tried to modify it to:

KERNEL!="sd[a-z][0-9]+", GOTO="media_by_label_auto_mount_end"

but that doesn't work.

So how to make it work for sdb5, sdb42 or sdb31337 likewise?

Thanks.

Addendum

I've just tried the \d+? method, udevadm monitor says:

KERNEL[1295719513.473653] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb (block)
KERNEL[1295719513.473687] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb1 (block)
KERNEL[1295719513.473706] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb5 (block)
KERNEL[1295719513.473725] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb6 (block)
KERNEL[1295719513.473743] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb7 (block)
KERNEL[1295719513.473761] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb8 (block)
KERNEL[1295719513.473791] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb9 (block)
KERNEL[1295719513.473811] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb10 (block)
KERNEL[1295719513.473830] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb11 (block)
KERNEL[1295719513.473848] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb12 (block)

UDEV  [1295719513.593213] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb (block)
UDEV  [1295719514.959983] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb5 (block)
UDEV  [1295719514.960053] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb1 (block)
UDEV  [1295719514.961528] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb6 (block)
UDEV  [1295719514.963793] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb9 (block)
UDEV  [1295719514.964930] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb10 (block)
UDEV  [1295719514.965794] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb12 (block)
UDEV  [1295719514.967418] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb8 (block)
UDEV  [1295719514.968466] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb7 (block)
UDEV  [1295719514.973757] add      /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb11 (block)

But it doesn't work either. If I leave the default rule, sdb5-9 are mounted properly.

share|improve this question

1 Answer 1

KERNEL!="sd[a-z]\d+?", GOTO="media_by_label_auto_mount_end"

share|improve this answer
    
Unfortunately it doesn't work. I'm using udevd version 165. See the addendum in my question for details. –  Flavius A Jan 22 '11 at 18:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.