# Automount dbus hal udev... questions

## mhornnt

ok, well i just finished upgrading to gnome 2.12, and am now working to get automounting of usb devices setup. I've been reading all the posts i can find, but seem at this point to only be confusing myself more as to exactly what i need. I've got the latest udev, hal, dbus, gnome-volume-manager and ivman installed and running. First of all, is ivman even neccesary? prior to installing it, usb devices would show up in nautilus but would not mount. Now they mount, but when I try to access them i get a permissions error unless i'm logged in as root. this is all with a usb flashdrive. What exactly is and isnt needed?

On a related note, I had this working for the most part with gnome 2.10, except for my usb DVD burner in an external enclosure. That I could never get to even show up in nautilus. looking at the logs, when plugged in it was recognized as the correct NEC model, lsusb showed the enclosure, but it would not automount, and i could not mount manually as i could not find where the device was located.

Any help on either issue would be much appreciated

Thanks

Mike

----------

## _loki_

you need ivman if you like to have devices automaticly mounted when you plug them. I don't use gnome and nautilus so I don't know how it works there but I*'m pretty sure devices are mounted when you click on them in nautilus?! At least thats what rox does.. Therefore I think automounting is not nessecary, but whatever you like..! Regarding the permission errors: What does your fstab look like? Do you have a "users" in your list for flash devices? Something like:

"/dev/sda1               /mnt/usb        vfat            users,noauto,rw         0 0"

should do it.. 

You also don't need sbus and hal for that (but I atill think those programmes are a step in the right direction, so if you have any use for them just a play)

For udev configaration have a look on http://gentoo-wiki.com/UDEV that  can help you if you have different plugable deveices you like to assingn different names to..

----------

## PeterH

I don't think ivman is neccesary if your using gnome-volume-manager. 

That said, I have the same problem you do. Devices are found but not automatically mounted.

This has worked for me before. I think the problem is with hal-0.5.5.1

----------

## Pandor

 *mhornnt wrote:*   

> ok, well i just finished upgrading to gnome 2.12, and am now working to get automounting of usb devices setup. I've been reading all the posts i can find, but seem at this point to only be confusing myself more as to exactly what i need. I've got the latest udev, hal, dbus, gnome-volume-manager and ivman installed and running. First of all, is ivman even neccesary? ..

 

If you look at the gnome-volume-manager you'll see that it only lists hal, dbus and pmount as a dependency, so no, ivman is not neccesary.

Ivman is even obsolete. Because ivman is an automounter so they would conflict as gnome-volume-manager is a (auto?)mounter too.

off topic:

thx to _loki_ for pointing out that rox can mout devices upon entry. Didn't know that. that should save me some time   :Very Happy: 

----------

## lovedaddy

 *Pandor wrote:*   

>  *mhornnt wrote:*   ok, well i just finished upgrading to gnome 2.12, and am now working to get automounting of usb devices setup. I've been reading all the posts i can find, but seem at this point to only be confusing myself more as to exactly what i need. I've got the latest udev, hal, dbus, gnome-volume-manager and ivman installed and running. First of all, is ivman even neccesary? .. 
> 
> If you look at the gnome-volume-manager you'll see that it only lists hal, dbus and pmount as a dependency, so no, ivman is not neccesary.
> 
> Ivman is even obsolete. Because ivman is an automounter so they would conflict as gnome-volume-manager is a (auto?)mounter too.
> ...

 

Does nobody else feel that making IVMan obsolete is a really really bad thing?  Wouldn't the desktop developers time be better spent making a universal auto mount solution, that can be used in Gnome, KDE etc as well as the CLI?  Ie build upon IVMan rather than building their own auto mount solution into their desktop and reinventing the wheel over and over?

----------

## PeterH

Well, HAL 0.5.6 was just released. With lots of volume related fixes.

Pretty hefty requirements though. It'll probably be a while before we see this in portage.

```
Changes from HAL 0.5.5.1

 - new volume_id from udev upstream (Kay Sievers)

 - listen to udev via a socket (Kay Sievers)

 - Another USB card reader common theme (Pozsar Balazs)

 - volume_id version 55 to fix strange FAT detection issues (Kay Sievers)

 - Sony Ericsson mobile phones with Memory Stick (Pro Duo) fdi (Danny Kukawka)

 - Samsung Yepp YP-ST5 fdi (Davide Ferrari)

 - Use hash table for calculated charge rate (Danny Kukawka)

 - Add checks to power management scripts (Danny Kukawka)

 - Move scripts to $(datadir)/hal/scripts (Danny Kukawka)

 - Fix for refreshing battery values on AC adapter transition (Richard Hughes)

 - Add power_management.[can_suspend,can_hibernate] and remove the

   power_management.is_enabled keys (Richard Hughes)

 - Use the new poll-able /proc/mounts file from 2.6.15 (Kay Sievers)

 - Allow strlists to be passed to method calls (Kay Sievers)

 - Add Mount, Unmount, Eject methods to the new org.freedesktop.Hal.Device.

   Volume interface (Kay Sievers)

 - Update driver prop on physical device if class device binds (Kay Sievers)

 - Force 'rate' to be zero if battery is neither charging nor 

   discharging (Ryan Lortie)

 - Fix our DTD file and add validation for fdi files (Artem Kachitchkine)

 - Add Shutdown() and Reboot() methods (Richard Hughes)

 - Add HAL_METHOD_INVOKED_BY_UID to method call environment (Kay Sievers)

 - Switch from xattr to .create-by-hal-file at mount point to determine

   if a mount point is created by HAL's Mount() method (Kay Sievers)

 - Remove HAL-created mount points at startup (Kay Sievers)

 - SCSI generic device recognizition (Kay Sievers)

 - Restrict org.freedesktop.Hal.Device.Volume to the console user (Kay Sievers)

 - Set drive_type to 'disk' for new TYPE_RBC (Firewire) devices (Danny Kukawka)

 - Added TEAC CD-R55S to list of broken CD/DVD burner (Danny Kukawka)

 - Move uid_export to root scope to avoid corruption (Aaron Bockover)

 - Introduce volume.mount.valid_options and generalize mount 

   script (David Zeuthen)

 - Remove dead code in lshal (Danny Kukawka)

 - Add neeeded NULL termination of an array (Chris Spiegel, fd.o #5279)

 - Also let uid 0 invoke methods restricted to console user (Richard Hughes)

 - Fix more vulnerabilities in script for Mount(), Unmount(), Eject()

   (Kay Sievers, David Zeuthen)

 - Add battery.reporting.* to UPS'es (David Zeuthen)

 - Fixup a few compiler warnings (Danny Kukawka)

 - UK translations (Ivan Petrouchtchak)

 - V4L and DVB device recognizition (Kay Sievers)

 - Match on info.capabilities, not info.category (John Palmieri)

 - Sony PSP music player fdi file (James Henstridge, fd.o #5137)

 - Fix incorrect reporting of volume.fsuage in libhal-storage (David Zeuthen)

 - Introduce volume.ignore property, document it, make it available

   in libhal-storage and make our Mount() script respect it (David Zeuthen)

 - Add optical disc write speeds (Ryan Lortie, Danny Kukuwka)

 - Use D-BUS calls for powersaved backend (Holger Macht)

Requirements for HAL 0.5.6 "Leave the gun. Take the cannoli."

 - Linux kernel  >= 2.6.15

 - util-linux    >= 2.13

 - bash          >= 2.0

 - udev          >= 078       (using udevsend as hotplug multiplexer)

 - dbus          >= 0.60      (with glib bindings)

 - glib          >= 2.6.0

 - expat         >= 1.95.8

 - popt          >= 1.10.2    (optional)

 - libusb        >= 0 0.1.10a (optional)

 - dmidecode     >= 2.7       (optional)
```

----------

## mhornnt

Alright, thanks everyone for the replies. I got rid of ivman, and have got the flashdrive mounting fine and am able to access it as a user now. havent been able to make any progress with the dvd drive thought, so suggestions in that direction would be great.

----------

## _loki_

I never used a external dvd, but your logger should tell you which device is created when pluged. If there is no device created you cannot mount it and my guess would be that you're missing something in the kernel. For debugging you could boot gentoo life cd having the thing pluged and copare the loaded modules to the one that are loaded without having it pluged..

----------

## mhornnt

hey, thanks for the continuing help _loki_

heres the log sections from when each is plugged in:

flashdrive

```
Jan 18 15:04:02 laptop usb 1-1: new high speed USB device using ehci_hcd and address 3

Jan 18 15:04:02 laptop scsi1 : SCSI emulation for USB Mass Storage devices

Jan 18 15:04:02 laptop usb-storage: device found at 3

Jan 18 15:04:02 laptop usb-storage: waiting for device to settle before scanningJan 18 15:04:07 laptop Vendor: LEXAR     Model: JUMPDRIVE PRO     Rev: 1000

Jan 18 15:04:07 laptop Type:   Direct-Access                      ANSI SCSI revision: 00

Jan 18 15:04:07 laptop SCSI device sda: 506880 512-byte hdwr sectors (260 MB)

Jan 18 15:04:07 laptop sda: Write Protect is off

Jan 18 15:04:07 laptop sda: Mode Sense: 43 00 00 00

Jan 18 15:04:07 laptop sda: assuming drive cache: write through

Jan 18 15:04:07 laptop SCSI device sda: 506880 512-byte hdwr sectors (260 MB)

Jan 18 15:04:07 laptop sda: Write Protect is off

Jan 18 15:04:07 laptop sda: Mode Sense: 43 00 00 00

Jan 18 15:04:07 laptop sda: assuming drive cache: write through

Jan 18 15:04:07 laptop sda: sda1

Jan 18 15:04:07 laptop Attached scsi removable disk sda at scsi1, channel 0, id 0, lun 0

Jan 18 15:04:07 laptop Attached scsi generic sg0 at scsi1, channel 0, id 0, lun 0,  type 0

Jan 18 15:04:07 laptop usb-storage: device scan complete

Jan 18 15:04:07 laptop scsi.agent[11063]: disk at /devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host1/target1:0:0/1:0:0:0
```

dvd

```
Jan 18 15:05:46 laptop usb 1-1: new high speed USB device using ehci_hcd and address 4

Jan 18 15:05:46 laptop scsi2 : SCSI emulation for USB Mass Storage devices

Jan 18 15:05:46 laptop usb-storage: device found at 4

Jan 18 15:05:46 laptop usb-storage: waiting for device to settle before scanningJan 18 15:05:51 laptop Vendor: _NEC      Model: DVD_RW ND-3500AG  Rev: 2.19

Jan 18 15:05:51 laptop Type:   CD-ROM                             ANSI SCSI revision: 00

Jan 18 15:05:51 laptop Attached scsi generic sg0 at scsi2, channel 0, id 0, lun 0,  type 5

Jan 18 15:05:51 laptop usb-storage: device scan complete

Jan 18 15:05:51 laptop scsi.agent[11339]: cdrom at /devices/pci0000:00/0000:00:1d.7/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0

```

so indeed for the flashdrive its creating sda1, but not creating a device for the dvd drive.

I also went ahead and compared the lsmod output of my setup vs a livecd where the drive works.

My setup:

```
laptop mjhorn # lsmod

Module                  Size  Used by

snd_mixer_oss          16744  -

snd_page_alloc          8304  -

usb_storage            73248  -

ehci_hcd               29680  -

usbcore               110528  -

nvidia               4084912  -

ieee80211_crypt_wep     3784  -

tg3                   101420  -

ipw2100               143460  -

ieee80211              43432  -

ieee80211_crypt         4428  -

firmware_class          7432  -

```

and the live cd:

```
lModule                  Size  Used by

ipv6                  236096  6 

snd_pcm_oss            48032  0 

snd_mixer_oss          18048  1 snd_pcm_oss

snd_seq_dummy           4612  0 

snd_seq_oss            32128  0 

snd_seq_midi_event      8576  1 snd_seq_oss

snd_seq                50704  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event

snd_seq_device          9228  3 snd_seq_dummy,snd_seq_oss,snd_seq

parport_pc             38724  0 

parport                35144  1 parport_pc

pcspkr                  4684  0 

rtc                     9876  0 

ipw2100               136900  0 

yenta_socket           21896  0 

rsrc_nonstatic         13184  1 yenta_socket

pcmcia_core            48404  2 yenta_socket,rsrc_nonstatic

nvidia               3470908  14 

joydev                 10176  0 

tsdev                   8128  0 

snd_intel8x0           31680  1 

snd_ac97_codec         71032  1 snd_intel8x0

snd_pcm                84356  3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec

snd_timer              24836  2 snd_seq,snd_pcm

snd                    54628  11 snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer

snd_page_alloc         10500  2 snd_intel8x0,snd_pcm

tg3                    88452  0 

ipw2200               127208  0 

firmware_class         11008  2 ipw2100,ipw2200

ieee80211              37924  2 ipw2100,ipw2200

ieee80211_crypt         7368  3 ipw2100,ipw2200,ieee80211

intel_agp              22172  1 

agpgart                34768  2 nvidia,intel_agp

i8xx_tco                8348  0 

slamr                 376900  0 

mptscsih               33500  0 

mptbase                41824  1 mptscsih

atp870u                29440  0 

dc395x                 34956  0 

sim710                  6276  0 

53c700                 29472  1 sim710

qla1280               117644  0 

dmx3191d               15488  0 

sym53c8xx              74900  0 

qlogicfas408            8712  0 

aha152x                37072  0 

aha1740                 8832  0 

BusLogic               73364  0 

aic7xxx               169396  0 

scsi_transport_spi     18944  3 53c700,sym53c8xx,aic7xxx

aic79xx               197276  0 

sg                     32416  0 

dm_mirror              22748  0 

dm_mod                 55076  1 dm_mirror

ata_piix               10244  0 

ahci                   12164  0 

sata_qstor             10372  0 

sata_vsc                8964  0 

sata_uli                8192  0 

sata_sis                8064  0 

sata_sx4               14340  0 

sata_nv                10244  0 

sata_via                9348  0 

sata_svw                8452  0 

sata_sil                9988  0 

sata_promise           11652  0 

libata                 44548  12 ata_piix,ahci,sata_qstor,sata_vsc,sata_uli,sata_sis,sata_sx4,sata_nv,sata_via,sata_svw,sata_sil,sata_promise

sbp2                   23432  0 

ohci1394               33460  0 

ieee1394               96344  2 sbp2,ohci1394

sl811_hcd              13568  0 

ohci_hcd               20612  0 

uhci_hcd               30992  0 

usb_storage            67520  1 

usbhid                 41184  0 

ehci_hcd               29960  0 

usbcore               110716  7 sl811_hcd,ohci_hcd,uhci_hcd,usb_storage,usbhid,ehci_hcd
```

any ideas about the best way to go about figuring out which of those extra modules are the neccessary ones? my guess is the libata one, so im gonna work on that now and see what i can come up with. also, why in my setups lsmod is nothign listed in the used by col?

----------

## _loki_

nice you did some work! I meant to compare lsmod both with live CD, one time with dvd pluged, one time unpluged. As you have a lot of things compiled staticly in the kernel, it's not comparable. Anyway isn't there anybody who do know what is needed to set up a external DVD burner?! 

Waht about 

 *Quote:*   

> 
> 
> Jan 18 15:05:51 laptop Attached scsi generic sg0 at scsi2, channel 0, id 0, lun 0,  type 5 
> 
> 

 

isn't sg0 the device you're looking for?

----------

## _loki_

okay have a look at this thread https://forums.gentoo.org/viewtopic-t-413068-highlight-external+dvd+burner.html

 *Quote:*   

> 
> 
> "sd" devices are scsi disk devices. cdroms dont fall into this category.
> 
> you need to enable SCSI cdrom in your kernel config, and then you'll get a node such as /dev/scd0 (or /dev/sr0 ?) which is mountable
> ...

 

from dsd

and later

 *Quote:*   

> 
> 
> there are many different contexts in which such a dvd/cd burner/player can be used. depending on the context, you may or may not need to actually mount the drive. also, the generic scsi devices /dev/sg0 is used only in special (rare) situations, such as for cdrecord. it gets a little complicated for someone totally new to linux to understand. you only need to mount a dvd if it contains a filesystem that's appropriate for mounting. when you try to mount an iso9660 dvd, you are mounting a _data_ dvd that contains an iso9660 filesystem you wish to latch onto your filesystem for browsing files. film dvd's, on the other hand, contain no mountable filesystems per se. in this case, you simply need a symlink, /dev/dvd, to your dvd device (/dev/sr not /dev/sg) and the video player (mplayer, xine, etc) "knows" how to read the data on the dvd device. again, you do not mount video dvd's, only data dvd's.
> 
> to review, you should have an /dev/sr0 device for this external usb burner. if you don't, you need to find out why. one likely reason may be that you do not have the block device SR config'd in your kernel. make sure, under SCSI Device Support, you have configured SCSI CDROM support. I set it to 'm' for module (sr_mod). The entry on your /usr/src/linux/.config would be: CONFIG_BLK_DEV_SR=m. The command 'lsmod' will show you which modules are loaded. If you do not see sr_mod, type 'modprobe sr_mod' as root to load the module. At that point, udev will create /dev/sr0 and several symlinks for you.
> ...

 

from drphibes

also have look on https://forums.gentoo.org/viewtopic-t-396507-highlight-external+dvd+burner.html

hope that helps!

----------

## mhornnt

looks like im finally getting somewhere. I'm reading through that link from the last post now, and it looks like at least one item ive compiled into the kernel should be a module, so thats the next thing to try. Also, it seems that when plugged in, sg0 is being created according to dmesg, however when trying to mount it, i receive an error stating it is not a block device. i will update with my progress after making it through both of those links

----------

## mhornnt

also, i realized you probably meant to compare lsmod on the livecd with and without the device, however, the live cd is being loaded from the dvd drive im attempting to get running, as my internal drive currently doesnt work. when booting from the drive, it is located without issue by the livecd at sr0, which is the first thing i tried on my own system with no success

----------

## mhornnt

Alright!! issue is solved. I had a couple of the scsi items compiled into the kernel. changing them to modules and recompiling took care of everything.  Thanks again _loki_ for the help, especially those last links that finally solved the issue

----------

## _loki_

glad you did it!

----------

