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

rebuildfstab question



Dear Klaus et al,

This pertains to /usr/sbin/rebuildfstab "Jul 2010" as in v6.4.4.

Until recently, Knoppix only added lines to fstab for devices that were
not already listed.  This behavior seemed intentional and I was making
good use of it.

I am studying this script because, unfortunately, this is no longer the
case.  My question pertains to the test which determines the mode of
operation:

### We now have two operation modes:
### A) do what udev tells us (add/remove partition entries) if DEVNAME and
ACTION is set
### B) scan and add entries automatically

For my empty cdrom drive, udev calls rebuildfstab with DEVNAME='/dev/sr0'
ACTION='change'

DEVNAME and ACTION are set, so I expect mode "A", but, the actual test is:

if [ -n "$DEVNAME" -a -n "$ID_FS_USAGE" -a -n "$ACTION" ]; then

Therefore, because ID_FS_USAGE is not set, it's mode "B" for the cdrom
drive.  This does not seem correct.

When I insert a disk, udev calls rebuildfstab again; this time with
ID_FS_USAGE set, and the drive gets mode "A".  When I remove the disk, the
udev event is handled mode "B".

I tried eliminating ID_FS_USAGE from the test, so that it agrees with the
description in your comment.  It seems to work (See fstab entries below.).

So, which is the case: (a) detection of blank/absent media/media removal
is a udev event and is supposed to be handled mode "A" and this is an
error in the script, (b) should be mode "A", but ID_FS_USAGE should be
set, so this is an error with udev or my drive, (c) this hybrid behavior
is intended?

Regards,
Andrew

New script, old behavior:  empty drive, mode "B".
/dev/sr0 /media/sr0 auto ro,noauto,users,exec 0 0

With media, things are different:
Old script: /dev/sr0 /media/sr0 auto ro,noauto,users,exec 0 0
New script: /dev/sr0 /media/sr0 iso9660 noauto,users,exec 0 0

Edited script: mode "A" for empty drive/blank media udev event:
/dev/sr0 /media/sr0 auto noauto,users,exec 0 0


Reply to: