# Could you suggest best/good method to autmount CD/DVD/RW?

## surfingtom

Hi,

I've recently upgraded to kernel 3.2.1 with KDE 4.7.4 and a Phillips 8801 CD/DVD+-RW drive. I have a decently functional system but mounting and unmounting cd's is a bit flaky and the gentoo docs seem a bit outdated. 

I would like a system where the type of media is automatically detected and then mounted, playing nice with KDE/GNOME/XFCE. 

What would you recommend as the best way to achieve this with the given system above? What packages should be installed, what should /etc/fstab look like?

I have got a 'sortof' working system and I'm hoping you can help me unravel the right combination of udev/autofs/kernel and configs required to stop Ubuntu users claiming superiority  :Wink: 

Many thanks for any help you can give and apologies for my ignorance.

Tom

----------

## f4c3m3l70r

1. Create cdrom directory

```

$ mkdir /media/cdrom

```

2. Edit fstab

```

/dev/cdrom              /media/cdrom    auto            auto,user               0 0

```

3. When a media is inserted, cdrom is mounted automatically, or do it yourself

```

$ mount /dev/cdrom /media/cdrom

$ umount /media/cdrom

```

4. Want to mount USB sticks & hdd ? Create another directory where to attach your usb drive

```

# mkdir /media/usb1

```

6. Connect your usb and list all storage devices

```

# fdisk -l

```

7. Edit fstab once again

```
/dev/sdb1               /media/usb      auto            auto,user                    0 0
```

Leave filesystem at "auto" for compatibility with other platforms (Windows, Dos)

I hope this can help you a little bit. And ehh welcome to Gentoo forums (:

----------

## VoidMage

First of all, disregard all what f4c3m3l70r wrote - it's either trivial or outdated.

For awhile, in KDE/GNOME/XFCE automounting it handled by some sort of udisks frontend (which obviously means dbus is a prerequisite).

In KDE solid has an udisks backend, in Gnome gvfs has an udisks backend, though it's nautilus that's actually controlling requests.

Not sure which xfce component is responsible, but it uses udisks too.

The udisks dbus interface is a bit stifling on occasions,  but in usual cases it just works (unless something on dbus is broken, that is).

----------

## myceliv

If you're not using a desktop environment, then `uam' is a good automounter. It writes some udev rules for you automagically. You do have to use `pumount' from the pmount package, or a similar tool to unmount them.

----------

## surfingtom

Hi,

I had been using the outdated method of editing fstab which produced some confusing results not helped by a semi-functioning cdrom drive which will be replaced. Once I got rid of the offending fstab entry about the cdrom and updated the kernel to  Y for the Joliet it all 'just worked' as I would like (as a cdrom anyway, the dvdrw aspect seems to be faulty and a different drive was fine) -

#

# CD-ROM/DVD Filesystems

#

CONFIG_ISO9660_FS=y

CONFIG_JOLIET=y

# CONFIG_ZISOFS is not set

CONFIG_UDF_FS=y

CONFIG_UDF_NLS=y

Not sure what was wrong previously and many thanks indeed for the input. I will now explore udisks and see if I can understand this new fangled technology  :Smile: 

Cheers!

Tom

----------

## smartass

I can recommend udiskie as a stand-alone automounter using udisks.

The "old" and "outdated" methods of using fstab or autofs aren't really obsolete, rather I'd say that they aren't as flexible as the modern computing environment requires.

If you need to automount a few specific drives or devices then using fstab or autofs with UUID is sufficient, actually it's better than usdisks in this case, because you can define the exact mount-point, options, etc.

But if you need to mount previously unknown device, udisks is the way to go.

Another thing to consider is the permissions for the mounted media. Many people use FAT filesystems for the USB flash disks, so udisks + console-kit takes care of that. Fstab/autofs can do something similar by mounting as groups users and giving write permissions to the group.

So, my setup:

Autofs for various network filesystems and udiskie for mounting removable media.

The unofficial Gentoo wiki shows a way to combine autofs and Udev, to me it seemed too much like a hack, but it works.

----------

