LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 10-18-2004, 09:14 AM   #1
Oxyacetylene
Member
 
Registered: Apr 2004
Location: Greensboro, NC, USA
Distribution: Debian
Posts: 134

Rep: Reputation: 15
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?
 
Old 10-18-2004, 09:23 AM   #2
rm6990
Member
 
Registered: Aug 2004
Location: Canada
Distribution: SUSE 9.1 Pro and Debian Testing on Server
Posts: 469

Rep: Reputation: 30
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
 
Old 10-18-2004, 09:42 AM   #3
m_yates
Senior Member
 
Registered: Aug 2003
Location: Upstate
Distribution: Debian, Mint, Mythbuntu
Posts: 1,249

Rep: Reputation: 101Reputation: 101
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!
 
Old 10-18-2004, 10:13 AM   #4
Oxyacetylene
Member
 
Registered: Apr 2004
Location: Greensboro, NC, USA
Distribution: Debian
Posts: 134

Original Poster
Rep: Reputation: 15
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.

Last edited by Oxyacetylene; 10-18-2004 at 10:55 AM.
 
Old 10-18-2004, 04:51 PM   #5
haimeltjnfg
Member
 
Registered: May 2004
Distribution: debian
Posts: 235

Rep: Reputation: 30
a hotplug script maybe? something like that?
 
Old 10-19-2004, 02:51 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
You can use autofs to have any device mount automatically when you access it and unmount after a set time of inactivity.
 
Old 10-20-2004, 12:05 PM   #7
Oxyacetylene
Member
 
Registered: Apr 2004
Location: Greensboro, NC, USA
Distribution: Debian
Posts: 134

Original Poster
Rep: Reputation: 15
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.
 
Old 10-20-2004, 04:42 PM   #8
Oxyacetylene
Member
 
Registered: Apr 2004
Location: Greensboro, NC, USA
Distribution: Debian
Posts: 134

Original Poster
Rep: Reputation: 15
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

Last edited by Oxyacetylene; 10-20-2004 at 04:56 PM.
 
Old 10-21-2004, 01:09 PM   #9
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
Old 10-21-2004, 02:02 PM   #10
Oxyacetylene
Member
 
Registered: Apr 2004
Location: Greensboro, NC, USA
Distribution: Debian
Posts: 134

Original Poster
Rep: Reputation: 15
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...
 
Old 10-24-2004, 03:22 PM   #11
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
Old 10-24-2004, 06:00 PM   #12
Oxyacetylene
Member
 
Registered: Apr 2004
Location: Greensboro, NC, USA
Distribution: Debian
Posts: 134

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mount usb hard drive NalinA Linux - Newbie 1 10-26-2005 10:07 PM
usb mount hard drive rpetrenko SUSE / openSUSE 2 10-07-2005 12:49 AM
I can mount a usb hard drive fiacobelli Linux - Hardware 3 07-06-2005 01:52 PM
How do I mount an USB hard Drive? nandy70 Linux - Newbie 1 11-20-2003 12:29 PM
mount usb module then mount usb hard drive guanyu Linux - Hardware 1 10-08-2003 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 11:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration