Author Topic: Automount Mounts Even What It Should Not  (Read 1303 times)

louigi600

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
Automount Mounts Even What It Should Not
« on: December 29, 2006, 05:57:51 pm »
I hadto digg quite a little before finding what mounted it automatically.
I made a very small change to /etc/udev/scripts/mount.sh that would avoid mounting automatically entries that have noauto option in fstab.
If anyone is intrested here is the diff (unfortunately indentation has gone to hell) :

*** /etc/udev/scripts/mount.sh  1970-01-01 00:00:00.000000000 +0000
--- scripts/mount.sh    2006-08-11 15:32:30.000000000 +0000
***************
*** 61,67 ****
 
  if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
      if grep "^$DEVNAME" /etc/fstab >/dev/null ; then
!       mount $DEVNAME
        exit 0
      fi
      get_mount_dir
--- 61,67 ----
 
  if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then
      if grep "^$DEVNAME" /etc/fstab >/dev/null ; then
!       [ $(grep -v noauto /etc/fstab |grep -c "^$DEVNAME") -ge 1 ] && mount $DEVNAME
        exit 0
      fi
      get_mount_dir
« Last Edit: December 30, 2006, 07:28:59 am by louigi600 »
Regards
David

SL-c760*  pdaXrom latest
SL-c860    pdaXrom latest ;-)
SL-c1000  pdaXrom Latest
Acer Aspire One running slackware and Clash
Toshiba AC100 running ARMedslack and Clash

*with some hardware problems but good for testing