LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 04-03-2005, 02:30 PM   #1
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Rep: Reputation: 35
udev takes long time to create /dev/usbhd symlink


Greetings,

I'm using an external USB 2.0 harddrive for my /home and /files area, but have some problems mounting ut during system boot.

The System

OS: Slackware 10.1 with 2.6.10 kernel

my /etc/udev/rules.d/10-local.rules as follows:
Code:
BUS="usb", KERNEL="sd*", SYSFS{product}="OneTouch", SYSFS{serial}="Y2NXJFLS    "
, NAME="%k", SYMLINK="usbhd%n"
My /etc/fstab is:
Code:
/dev/usbhd1      /files           vfat        defaults         0   2
The Problem

During boot, I get an error-message that device /dev/usbhd1 does not exist. As a natural consequence, /files does not mount.
However, when fully booted, /dev/usbhd1 exists perfectly and a "mount -a" mounts the disk with no problems.

I *SUSPECT* this problem occurs because udev takes a long time to create the symlink, but I don't know.
This /dev/usbhd1 9 out of 10 times symlinks to /dev/sda1, but some times to /dev/sdb1 or /dev/sdc1 depending on various factors, which is why I use udev to ensure that this particular drive always gets mounted /home, and not a temporary memory stick etc.

The Question
Is there a quicker, more elegant/correct way to do this? I know I can add a "sleep 10" to the rc.S startup script, but I feel my system boots too slow as it is...
Is this a normal problem?

Thank you!

-Y1
 
Old 04-03-2005, 02:36 PM   #2
tank728
Member
 
Registered: Sep 2003
Posts: 142

Rep: Reputation: 16
in your 10-local.rules try using this
Code:
BUS="usb", KERNEL="sd*", SYSFS{product}="OneTouch", SYSFS{serial}="Y2NXJFLS    "
, NAME="%k", SYMLINK="usbhd"
I just took off the %n on the symlink, since the %n can be something different everytime, but you are changing your symlink everytime, you want something consistent. Now you can use /dev/usbhd as you device in /etc/fstab, with the %n it would be different.

-tank
 
Old 04-03-2005, 02:50 PM   #3
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Thanks Tank,

Just to be on the safe side I changed it to create /dev/maxtor - no room for misunderstanding there.

However, the problem still remains.

During boot I still get the error: mount: special device /dev/maxtor does not exist.

Am I coding this so it is too slow, or do I need to re-arrange my rc.d scripts, or do I absolutely have to add a sleep 10 prior to the mount part? I really really do not want to have to do that.

C'mon fellas - I can't be the only one mounting a USB harddrive from fstab...

Thank you for listening

-Y1
 
Old 04-03-2005, 07:49 PM   #4
tank728
Member
 
Registered: Sep 2003
Posts: 142

Rep: Reputation: 16
Where are you trying to mount your drive. When I say where, I mean where in the start up
scripts. You should not use /etc/rc.d/rc.S, or /etc/rc.d/rc.M. You should use /etc/rc.d/rc.local.
This is the only thing I could think of. Also since it is an external drive, you might not always
want to mount it, for example when the device is not plugged you will not want to mount it,
and udev should/will only make the symlink when the device is present. Try adding this to
/etc/rc.d/rc.local, assuming your /etc/fstab is set up correctly, which it looks like it is from
your first post, just make sure you use /dev/maxtor now.
Code:
if [ -e "/dev/maxtor" ]; then
   mount /dev/maxtor
fi
Also if you are running current, you might want to report it to slackware.com as a bug, or
upgrade to the latest version. I know a couple of weeks ago there was some trouble with
it. I do not know exactly what was going on, as I do not run current anymore. I will post
back if I think of anything else, or if anyone wants to add their input.

Good Luck

-tank
 
Old 04-04-2005, 04:27 AM   #5
Yalla-One
Member
 
Registered: Oct 2004
Location: Norway
Distribution: Slackware, CentOS
Posts: 635

Original Poster
Rep: Reputation: 35
Thanks again, good input!

I added the "noauto" flag to its entry in the /etc/fstab and made the following changes to /etc/rc.d/rc.local and now it works perfectly :

Code:
if [ -b /dev/maxtor ]; then
  echo -n "Mounting external USB harddisk(s): "
  mount -v /dev/maxtor
fi

Note! I changed the -e to a -b test as /dev/sd?1 is a block device - just another precaution..

Case closed.

-Y1

Last edited by Yalla-One; 04-04-2005 at 05:44 AM.
 
  


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
login takes long time doorman007 Linux - Software 2 04-25-2005 01:56 AM
Bzipping takes a really long time sometimes scott_R General 0 10-10-2004 01:47 AM
Firefox - Script takes a long time to go away Irving Linux - Software 1 05-05-2004 10:42 PM
Gnome takes a long time to shutdown weelyjim Linux - Laptop and Netbook 1 02-05-2004 05:16 PM
Mandrake takes a LONG time to boot VinTSS Mandriva 2 01-11-2004 01:36 AM


All times are GMT -5. The time now is 11:40 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration