LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   On Mounting USB Hard Drives (https://www.linuxquestions.org/questions/linux-hardware-18/on-mounting-usb-hard-drives-546461/)

jerm1701 04-16-2007 08:35 AM

On Mounting USB Hard Drives
 
I have a Western Digital USB, external hard drive running Mandriva '07. When I plug it in, it automounts as /mnt/removable with permissions of 775 and ownership of user:root. I can read and write to it no prob. When I restart the computer, it doesn't automatically mount the USB drive, so I thought I'd put a line in /etc/fstab to make sure it did. That's when the problems started.

First of all, it doesn't always show up as /dev/sda1, so I tried to mount by the UUID, but according to vol_id, the UUID is only 8 digits long, rather than the standard 16, and so

mount UUID=xxxx-xxxx /mnt/removable

returns an error about an invalid UUID. Same thing happens with the -L options, b/c the label contains a space in it (My Book). That's my first question. Can I change the UUID or label or is there another way to always ensure you're mounting the same device?

Second, and even more odd, when I do mount using

mount /dev/sda1 /mnt/removable

it mounts with permissions of 744 root:root, so only root can read/write. If I chown, I get an error that saying that operation can't be done. chmod doesn't give an error, but it also doesn't change the permissions. That's my second question. How can manually mount the drive with the correct user and perms?

maroonbaboon 04-17-2007 01:02 AM

Removable USB disks seem to cause a few problems of this type. I don't know if there is a standardised way to deal with it. Here is a page about a similar problem, with the added complication of trying to boot off a USB drive:

http://www.nslu2-linux.org/wiki/HowTo/MountDisksByLabel


Hopefully that will help with the 1st question.

I don't know the answer to the second - I guess it would be in the man pages for mount and fstab somewhere.

jschiwal 04-17-2007 01:24 AM

You could try using udevinfo to check the uuid.

The Mandriva partitioner may allow you to simply relabel a partition. If not, and it is a fat32 drive, you may be able to use the mtools' "mlabel" to label the partition. Use minfo first to double check which msdos style device it sees the partition as. I tried this to label a usb pendrive, and then used hal-device to check that the label entry was changed.


All times are GMT -5. The time now is 09:10 AM.