Announcement

Collapse
No announcement yet.

Having trouble with USB device mounting behavior

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Having trouble with USB device mounting behavior

    I'm having a small problem and I'm not entirely positive how to fix it. First, here's what I want to do.


    I have an external hard drive in an external enclosure (converted a 40GB internal IDE drive to an external USB/Firewire drive). The drive itself works great and has been formated with ext3 (single volume). No issues there.

    What I'd LIKE to do is have this drive, whenever plugged into my system, to be mounted to a directory I created, /media/externbackup instead of anywhere else. I would also like it owned by root, have the group set to "staff," and have the permissions 770 (rwxrwx--- so NOBODY but those on the members of staff and root can even go into it...very, VERY important).


    I have added the following entry to the bottom of my otherwise stock /etc/fstab.
    Originally posted by /etc/fstab
    # /dev/sda1
    UUID=5fad2e08-cd97-4cbe-aeef-3271baad1406 /media/externbackup ext3 defaults,noauto 0 0
    So, to my understanding, whenever the device is plugged in (as that is its UUID) it should be mounted to /media/externbackup.


    Here's my problem. Whether I leave it plugged in at bootup or plug it in during normal use it automatically mounts the drive to /media/usbdisk. This is strange since I can't find out why it would ignore the fstab and mount it somewhere else.

    To solve the permissions and ownership issue (since having any old user account able to read a full system backup would be a perilous proposition indeed, even with its own permissions in place) I mounted the disk via "$sudo mount /media/externbackup/" and did a chmod 770 ; chgrp staff to it. Whenever I mount it, even if it's automatically mounted to /media/usbdisk, it maintains these permissions and ownership (I'm going to assume it's actually on the disk filesystem but please feel free to enlighten).




    So, anyone have any idea how to stop it being automatically mounted to /media/usbdisk? After modifying the fstab to tell it where I want to be able to mount it I'm not really sure what else to change since I'm not familiar with Ubuntu's automounting. Is there something else I need to change?
    Just a fox, a whisper.

    #2
    Re: Having trouble with USB device mounting behavior

    I'm making the assumption that you have a fair amount of knowledge concerning Linux, based on the information within your post. But ....

    Was the mount point /media/externbackup actually created? Is there maybe a spelling error, either on the created mount point name or within fstab?
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: Having trouble with USB device mounting behavior

      Thanks for the reply. Yes, the mount point /media/externbackup really does exist (I created it as root).

      I also when manually mounting the drive to that location need only issue "#mount /media/externbackup" and it works without further question. Since it doesn't ask for a device link or filesystem type I figure it must be listed properly in the fstab.


      Just for some reason when you plug it in OR on boot-up (either one) it automatically mounts it to /media/usbdisk. It's pretty infuriating.
      Just a fox, a whisper.

      Comment


        #4
        Re: Having trouble with USB device mounting behavior

        Hmm. I have two external USB IDE drives attached to my laptop. They mount automatically on boot. But if one looks in fstab, they are not listed. From what I've found by watching this forum and via searches with Google, Linux handles all USB devices as SCSI. SCSI management isn't done in fstab.

        This tidbit may not help you much, but it may lead you in another direction that will get you the answer as to 'why' it is happening, and hopefully, the solution to getting your drive to mount as you want.
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: Having trouble with USB device mounting behavior

          That's very interesting, any idea how SCSI things are handled if not in the fstab? To my understanding that's where all filesystem mounting was done.


          Interestingly I also have Xubuntu-desktop installed on this system (wanted to play around with it) and when I log out then log back in the drive's mouting moves right back to /media/usbdisk, even though I didn't touch anything mounting-wise.


          It's as if there's some kind of extra mounting tied to my login. Curiously when I logged into another user account (using KDE) it didn't move the mount point, it stayed at /media/externbackup.

          I'm going to do some more testing, thank you for the tip.


          EDIT: Okay, some more testing has led me to think it may have something to do with the graphical login or the desktop environment. When I use KDE I can right-click on the device and under properties there is a tab that says "Mounting." This mountpoint says, "/media/usbdisk" and I believe that KDE or whatever backend it's using must not be looking in the /etc/fstab.



          Any idea what backend KDE is using for mounting or where it would get this line that I would want it in /media/usbdisk instead of /media/externbackup? It's obviously not checking my /etc/fstab.

          Further Edit: Alright, even after in that "mount" tab of properties for the drive to /media/externbackup and checking the "automatically mount" option it STILL mounts it at /media/usbdisk. I'm beginning to think this has something to do with HAL as years ago when I was running Gentoo with HAL for KDE I had a similar problem (though admittedly much worse, long story).
          Just a fox, a whisper.

          Comment


            #6
            Re: Having trouble with USB device mounting behavior

            Foxx, KDE still uses HAL and, if I'm not wrong, DBUS, for all types of removable media. Those dark days of IVMAN are gone, as KDE has its own way of mounting and unmounting stuff.
            I didn't see you mentioning, so I will ask: did it work before, and stopped working?
            When I first installed Dapper, all removable media, including CD and DVD (which are not USB/SCSI) were automaticaly mounted and the system presented me with a screen so I could choose what to do, just like Windows. After some updates, Dapper (KDE) didn't automount DVDs anymore, but CDs worked fine, and many, many users have this problem with different distros, so it's more of a KDE issue than a Kubuntu issue. BTW, USB media worked fine, always.
            I upgraded to Edgy (not a fresh install, but online dist-upgrade) and this problem persisted. Upgraded to Feisty and everything is working again, so it's hard to know where is the problem.
            You could try to plug your device, go to the system settings and open the Removable Media tool. Try configuring your device there.

            Comment


              #7
              Re: Having trouble with USB device mounting behavior

              HAL and DBUS now? Alright, thanks, I'll see if I can scare up some documentation for those.


              Thanks for asking, it's always done this. It mounts and umounts media (all media) just fine, it just refuses to read the fstab for this drive apparently so I have no idea where it's getting the idea that it should mount it into /media/usbdisk since I haven't specified that.

              It does come up with a dialog box in KDE (understandably none in XFCE) but it doesn't say anything about where to mount it, just whether I want to open up a new window or the like.


              The automounting into /media/usbdisk happens in either XFCE or KDE so I don't think it's explicitly tied to KDE but it could still be.
              Just a fox, a whisper.

              Comment


                #8
                Re: Having trouble with USB device mounting behavior

                Originally posted by FOXX
                # /dev/sda1
                UUID=[blurb]
                Just a thought ... have you tried to mount the partition by it's ID (not: UUID), as described on this page ...?

                Comment


                  #9
                  Re: Having trouble with USB device mounting behavior

                  No, but I didn't think there'd be a problem since the UUID works out fine for everything else. I'll give it a shot.
                  Just a fox, a whisper.

                  Comment

                  Working...
                  X