Find the answer to your Linux question:
Results 1 to 8 of 8
hi, ive had this problem for a long time now and haven't been able to find a solution myself. basicaly, i dont use gnome or kde, i use xfce on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User benjamin20's Avatar
    Join Date
    Oct 2004
    Location
    jacksonville beach FL
    Posts
    317

    automounting cdroms and usb sticks


    hi, ive had this problem for a long time now and haven't been able to find a solution myself.

    basicaly, i dont use gnome or kde, i use xfce on gentoo. im looking for a way to automount removable media without requiring some gui specific tool. id like to be able to just be in a basic terminal and still have the system automount removable media.

    id like to try and have ot also create and deleta the mount point files they use for instance, i blug in a usb stick, it creates the file /media/usb-storage01 and mounts it there. when i unplug it it removes the file correctly.

    same so for cdroms, creates /media/cdrom01 and when i press the cd drive button(assuming its not being used) it unmounts, removes the directory and then ejects it.

    so far ive tried ivman(some small program that surfaced right after the big udev switch) but its ridiculous to configure and i couldn't even get it to run right. ive read you can make udev rules to do it too, that seems almost as difficult but proboboly doable.

    anyone that seems to get this working doesn't seem to do it all the way, like they get one specific usb stick to mount at a pre-made location, or they get somehting like an ipod to mount. seeing as how you can have a wide range of usb sticks and memory cards mounted, id kinda like it to be expandable such that it doesnt leave a bunch of unused directories laying around when its done.
    nVidia G-Force 6600GT (bfg) pci-e: amd 64 2000+ (939): 1024 corsair ram: 2X 80gb seagate harddisk SATA: plextor cd/dvd-read/write cdrom SATA

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Do you have HAL installed? I believe HAL and or DBUS is what automagically mounts things for you.

    HAL - Gentoo Linux Wiki
    Last edited by MikeTbob; 01-21-2010 at 12:42 AM. Reason: Added Link
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Linux User benjamin20's Avatar
    Join Date
    Oct 2004
    Location
    jacksonville beach FL
    Posts
    317
    im fairly certain its more than that. hal i think is just a big information center service that hives infromation about the hardware and how its connected to your system, udev doesnt give near the info hal does, udev is responsible for crating the correct file association of the devices connected to the system AND running appropriet scrypts for wne that device is add/removed. then theres d-bus, another important part. it connects programs together and allows them to send information to eachother.

    i think right now the way automounting is done is (for some reason) there's a service provided by your desktop manager (gnome and kde have one) that listens for a dbus message from udev that a device has been connected, then looks up some info through hal, and then mounts it to the appropriate location (either what is says in fstab or crates a file in /media.

    at least that's how i currently understand it, problem is, i dont want to use a desktop specific tool to manage a systemwide problem. it really doesnt seem like the appropriet way to handle it, removable media should work even in a terminal setup with no x11 running.
    nVidia G-Force 6600GT (bfg) pci-e: amd 64 2000+ (939): 1024 corsair ram: 2X 80gb seagate harddisk SATA: plextor cd/dvd-read/write cdrom SATA

  4. #4
    Linux User benjamin20's Avatar
    Join Date
    Oct 2004
    Location
    jacksonville beach FL
    Posts
    317
    ok, my system didnt have hal startup on boot. by activating that thunar(xfce file manager) now will automount the cdrom and usb stuff, however this isnt working in just a terminal with x11 shutdown, was kinda hoping to get that to work as well since it would be nice to have.
    nVidia G-Force 6600GT (bfg) pci-e: amd 64 2000+ (939): 1024 corsair ram: 2X 80gb seagate harddisk SATA: plextor cd/dvd-read/write cdrom SATA

  5. #5
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    XFCE's volume manager, Thunar-Volman, requires the Thunar daemon to be running, so I don't think you can do that without X.

    AutoFS might work as a solution for you.
    Autofs - Gentoo Linux Wiki

    There is also a lightweight volume manager, skvm, from the suckless project, that might work for you. I haven't used it, but it doesn't look like it should require X to work.
    skvm | tools suckless tools

  6. #6
    Linux User benjamin20's Avatar
    Join Date
    Oct 2004
    Location
    jacksonville beach FL
    Posts
    317
    skvm probably isnt the best solution (designed to require source code modification and recompile in order to configure....

    autofs, i think might just be right, a lot of what i was reading about it seems to make it seem really old like automount and supermount, both kinda went unused after the udev change and both *mounts had a lot of weird problems with them.

    id like to know if anyone knows how autofs actualy works. i keep seeing people say they have automounts setup with just using udev, but its like they have some dificult to understand udev rule that points to a automounting script that doesnt end up being all that flexible. i have 4 memory card reader slots, like 8 usb ports, and a cdrom drive, i wouldn't want to have to make 90 different mount points all over the place just to support that, it should be fairly dynamic and automatic.

    also, it is sounding like autofs can actually mount a device at access rather than at connect, and then unmount it when not being accessed and then remount when it is again accessed. that sounds like the best solution for a memory stick, since they, like floppies, can and often are fulled form the system at random points without warning, it would be best for them to only be mounted when actually being accessed and have that occur when someone actually tries to access them.
    nVidia G-Force 6600GT (bfg) pci-e: amd 64 2000+ (939): 1024 corsair ram: 2X 80gb seagate harddisk SATA: plextor cd/dvd-read/write cdrom SATA

  7. #7
    Linux User benjamin20's Avatar
    Join Date
    Oct 2004
    Location
    jacksonville beach FL
    Posts
    317
    everything relating to autofs seems to make it sound like it hasnt been used for a really long time, and it also has a problem where it where it wont necessarily create the directory where it mounts, just look to see if something tries to access that point, so either it expects a directory sitting there at all times or it will actually create it when someone tries to go to that directory, as if it did exist.(kinda weird and confusing)

    other than that and ivman(really dont think manually editing a bunch of xml files is correct, also seems like it hasnt been developed for the past 3 years) i might be able to do some sort of scripting stuff, or just have to make up my own program(doesn't sound like the right option)
    nVidia G-Force 6600GT (bfg) pci-e: amd 64 2000+ (939): 1024 corsair ram: 2X 80gb seagate harddisk SATA: plextor cd/dvd-read/write cdrom SATA

  8. #8
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    I would give skvm a chance. I'm not sure you'll need to do much configuring. It looks like it should, by default, dynamically create and destroy mountpoints in /media.

    And if you need to change the default mount options or path to the mount/umount commands, that part of the source looks pretty straightforward.
    Code:
    /* ============================
     * = Macros
     * ============================
     */
    
    /* feel free to alter these to your liking */
    
    /* NOTE: you may want to use the sync mount option if you plan
     * to cold eject your usb drives. Even though the side-effects
     * are probably not worth it.
     */
    #define MOUNT_CMD_PATH "/bin/mount"
    #define UMOUNT_CMD_PATH "/bin/umount"
    #define DEFAULT_MNT_OPTIONS "noexec,nosuid,nodev,users"
    #define BASE_MNT_DIR "/media/"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •