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?
|
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 |
You can give a user permission to mount it by adding the following line to /etc/fstab:
Quote:
Code:
mkdir /mnt/sda1 Code:
mount /mnt/sda1 |
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.
|
a hotplug script maybe? something like that?
|
You can use autofs to have any device mount automatically when you access it and unmount after a set time of inactivity.
|
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.
|
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 |
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. |
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...
|
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.
|
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. |