LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   USB hard drive, how do I mount it? (https://www.linuxquestions.org/questions/debian-26/usb-hard-drive-how-do-i-mount-it-244166/)

Oxyacetylene 10-18-2004 09:14 AM

USB hard drive, how do I mount it?
 
I recently installed Debian Sid on my laptop. Everything works great, but there are a couple things left to be setup. I have a USB hard drive that I would like to use. How do I mount this device? I have used the mount command before, but what device do I mount (how do I tell how it is showing up)? How could I get the system to automatically mount the drive whenever I plug it up? Is there perhaps a package I could install to easily accomplish this?

rm6990 10-18-2004 09:23 AM

Your USB Hard drive should be SCSI. So if it is the first SCSI device on the system, it will be sda. So typing in this

mount /dev/sda1 /path/to/mount/point

should mount it

m_yates 10-18-2004 09:42 AM

You can give a user permission to mount it by adding the following line to /etc/fstab:
Quote:

/dev/sda1 /mnt/sda1 vfat rw,exec,user,noauto,umask=000 0 0
Then make the directory for it:
Code:

mkdir /mnt/sda1
As a regular user, you can mount it with:
Code:

mount /mnt/sda1
Of course, you can name the directory whatever you want if you don't like /mnt/sda1. Good luck!

Oxyacetylene 10-18-2004 10:13 AM

Thanks for the super fast replies, I was able to mount the drive with no problems. Is there a way to make the system automatically mount the drive whenever I plug it in? I would like the drive to be plug and play so I can just plug and unplug and have it work.

haimeltjnfg 10-18-2004 04:51 PM

a hotplug script maybe? something like that?

David the H. 10-19-2004 02:51 PM

You can use autofs to have any device mount automatically when you access it and unmount after a set time of inactivity.

Oxyacetylene 10-20-2004 12:05 PM

Thanks I will look into that. I wonder how SuSE does it? My home desktop is SuSE 9.1 Pro. When I hook the drive up it shows as USB-1238907590w7 or some such nonsense (serial # I guess). Then I just unplug it and the folder disappears.

Oxyacetylene 10-20-2004 04:42 PM

I got autofs installed and configured so that it would automatically mount the drive for me when I inserted it and did an ls command, of any other way I wanted to access it. I still have to umount it before I can unplug it though....

Gotta be an easy way?

SuSE seems to do things differently?
http://portal.suse.com/sdb/en/2004/0...ldhotplug.html

David the H. 10-21-2004 01:09 PM

autofs should automatically unmount the device after a set period of time. I don't remember what the default time is offhand (about 60 seconds?), but you can manually set it by adding "--timeout=5" (or however many seconds you want) to the entry in auto.master.

As for hotplug, I think that's job is to detect what kind of device has been plugged into the usb port, storage device, printer, scanner, whatnot, and load whatever driver modules are needed. It's not involved in the actual mounting of the device. There might be a way to do it, but I haven't heard of any myself.

Oxyacetylene 10-21-2004 02:02 PM

I tried setting the timeout for autofs to 5 seconds, but even if I wait at least that long before unplugging it I can't access it when I remount it unless I umount it first. I'll have to play with it some more and see what I can do. autofs seems to be the best so far...

David the H. 10-24-2004 03:22 PM

Hi. I have a belated heads-up for you. After reading the last post, I started playing around and I discovered that my autofs wasn't unmounting either. After a bit of googling I discovered that there's a bug in the recent versions of autofs. I downgraded mine to a previous version and now it's working again.

Oxyacetylene 10-24-2004 06:00 PM

Thanks for the info! That makes sense. Now I know it wasn't just how I had mine set up or something


All times are GMT -5. The time now is 08:02 AM.