Kernel 2.6.34 does not add my external disk to /etc/mtab???

Jeremy Henty onepoint at starurchin.org
Sat Jun 12 03:16:56 PDT 2010


I have  an external  USB disk that  I mount  with a custom  udev rule.
This has worked perfectly for ages, through many kernel versions.  But
since I upgraded my LFS 6.5  system to 2.6.34 the disk does not appear
in /etc/mtab, and  therefore not in the output  of mount either (which
is annoying since it breaks my backup script).  The disk definitely is
mounted; I can  see its contents in the mount point  and it appears in
/proc/mounts.  What on earth has changed in this kernel version?

Here's the udev rule:

# cat /etc/udev/rules.d/01-local-external-disk.rules
KERNEL=="sd?1", SUBSYSTEMS=="usb", ATTRS{product}=="Seagate External Drive", ATTRS{serial}==" SW063611533", RUN+="/sbin/udev_local_external_disk"


And here's the mount script that rule runs:

# cat /sbin/udev_local_external_disk
#!/bin/sh

mount -t ext3 -o nodev,noexec,nosuid,ro "$DEVNAME" /media/disk/number/0


The weird  thing is that  if I unmount  the device and run  the script
manually:

# DEVNAME=/dev/sdd1 /sbin/udev_local_external_disk


...then the device does appear in /etc/mtab and the mount output.  Now
SysV must  be running  the script at  boot time, otherwise  the device
would not  mount at  all.  Why does  the script behave  differently at
boot time rather than afterwards?

Any ideas?  I'm stumped.

Regards,

Jeremy Henty



More information about the lfs-support mailing list