Make HAL Add DIsk to /etc/fstab

Klaus-Peter Schrage kpschrage
Sun Jan 23 05:57:34 PST 2005


Kurt Wall wrote:
> The first of probably many FC3 questions:
> 
> How do I make HAL add /dev/hdb to /etc/fstab? Obviously, I can add it 
> myself, but what's The Right Way To Do It (c)? If I add it manually, 
> fstab-sync will wipe out the entry the next time I boot my system, 
> right? Thanks.

You can't/shouldn't run fstab-sync manually, it's invoked by the 
haldaemon which thusly should be a running service ...

I guess that your /dev/hdb is a cd-writer. I have one on hdd, and the 
corresponding fstab entry, obviously created by the fstab-sync (as can 
be seen from the 'managed' option):

/dev/hdd /media/cdrecorder auto 
\pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed \0 0

HAL is an interesting feature with respect to removable devices. I have 
several usb storage stuff (camera, stick, CF reader, iriver mp3 player), 
and all of them are managed in a similar way:

* before I plug in anything, there's no corresponding fstab entry

* after plugging in the iriver, for example, the following events happen

1. of course, a dmesg message like
...
   usb 1-1: new high speed USB device using address 6
scsi1 : SCSI emulation for USB Mass Storage devices
   Vendor: TOSHIBA   Model: MK4004GAH         Rev: JC00
   Type:   Direct-Access                      ANSI SCSI revision: 02
SCSI device sda: 78126048 512-byte hdwr sectors (40001 MB)
sda: assuming drive cache: write through
  sda: sda1
...

2. a new line in /etc/fstab comes up:
/dev/sda1 /media/IHP100 vfat 
\pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed \0 0

3. a mount point is created in /media:
drwxr-xr-x  2 root root 4096 23. Jan 10:52 IHP100

* after plugging out the device, dmesg gives me a corresponding message:
usb 1-1: USB disconnect, address 6

and the entries mentioned in 2. and 3. above are gone.

This all worked out of the fc3 box for me. For one or two times, I had 
to restart the haldaemon to keep it going.

Apart from that, I didn't do any tweaking, and I guess the average 
user/admin is supposed not to do so, as the docs and many configuration 
files (xml) are as obscure as the freedesktop.org website mentioned in 
man fstab-sync.

Klaus



More information about the Linux-users mailing list