LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-11-2005, 08:06 AM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Rep: Reputation: 36
Static mount of USB harddisk


Greetings,

I've got an external Maxtor 120GB USB2.0 harddrive that will primarily live on my SuSE 9.2 box, but will also be connected to my XP Pro laptop for backup and file transfer purposes. Thus I do not want to reformat the Maxtor USB disk with a Linux-only FS, and preferably keep it as it came out of the box.

When plugging the Maxtor into the desktop running SuSE 9.2 Pro, it's automagically detected and mounted on /media/usb-Y3NWSFWE:0.0.0p1 and works perfectly.

However, if I use a USB-hub or connect other devices, sometimes this name changes, which obviously causes path problems.

I have tried adding the USB disk to /etc/fstab, but with 2 problems:

1. All files are root:root and I cannot change them
2. It's currently on /dev/sda1, but might depending on other connected drives be found on /dev/sda2 (or 3 or 4) and thus mount won't find it.

So question: How do I manipulate the "automount"/plug'n'play option to mount this drive on /files, rather than /media/usb-Y3NWSFWE... ?

(I checked the HOWTO's and FAQ's, and all they describe is how to add /dev/sda1 to fstab, which for above reasons doesn't quite apply here)

Thanks for any insight!
 
Old 03-11-2005, 08:50 AM   #2
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
Use udev to control your /dev entries, and set a rule that always names the USB disk the same way.
 
Old 03-13-2005, 07:00 PM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Thanks 1&1=2

I really don't feel too intelligent at the moment, but having browsed through quite a few different man pages and config pages I am somewhat at loss on which configuration file to configure, what to search for, and how to ensure that my "important" USB-harddrive is always mounted on /files, while USB memory sticks and other USB harddrives remains mounted in the defauls /media/usb-XXXXXXXXXXXX ?

If you could offer me a hint in the right direction I'd appreciate it. Right now I've just stared myself blind and entered a state of total confusion.

Thanks much!
 
Old 03-14-2005, 03:49 AM   #4
nnsg
Member
 
Registered: Apr 2004
Distribution: Slackware 9.1/10.1, Mandrake 9.1/10.1
Posts: 75

Rep: Reputation: 15
Hi Yalla-One,

Maybe you can try this guide:

http://www.reactivated.net/udevrules.php

It had some examples, I think it's easier to understand than the official udev doc.
 
Old 03-15-2005, 03:26 AM   #5
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 641

Original Poster
Rep: Reputation: 36
Thanks much nnsg - that it the spot perfectly.

As a reference to others who might have similar questions, here's what I did to make it work perfectly:

1. Locate the name, type and serial number of my important USB harddisk :
Code:
udevinfo -a -p `udevinfo -q path -n /dev/sda`
2. Copy/paste the name and serial number of the harddrive

3. Create /etc/udev/rules.d/10-local.rules with content:
Code:
BUS="usb", KERNEL="sd*", SYSFS{product}="OneTouch", SYSFS{serial}="Y3NWSFWE    "
, NAME="%k", SYMLINK="usbhd%n"
4. Add the following line to my /etc/fstab:
Code:
/dev/usbhd1          /files               vfat       auto,gid=100,umask=022 1 0
Note the "umask=022" part, which allows root only to make changes to the drive. Having it world-writeable is somewhat risky as my girlfriend sometimes uses my Linux box (nuff said)

5. I can now mount and read my files both when it's connected to XP and to Linux. No

As stated by nnsg above, all of this is thanks to Daniel Drake's document found at http://www.reactivated.net/udevrules.php

-Y1
 
Old 05-24-2006, 10:51 PM   #6
Monker
LQ Newbie
 
Registered: May 2006
Posts: 4

Rep: Reputation: 0
ok thanks for this form im just alittle lost.(still trying to get switched over) I have the same problem. I have a Usb hub that i want to use. I put in the udevinfo -a -p `udevinfo -q path -n /dev/sda` and i got bash: udevinfo: command not found
. im using red hat 9.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
the second harddisk is not mount csstudy Linux - General 2 10-08-2005 03:27 AM
mount-problem usb harddisk: not a valid block device micha Mandriva 2 11-21-2004 11:29 AM
how to mount a new harddisk kjsubbu Solaris / OpenSolaris 5 11-04-2004 10:45 PM
Format and mount problem - External USB harddisk darn dao Linux - Hardware 1 11-03-2004 03:40 AM
How to mount second harddisk??? novkhan Linux - Newbie 2 01-26-2004 08:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:24 AM.

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