LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-04-2007, 07:21 AM   #1
silent echo
LQ Newbie
 
Registered: Nov 2007
Posts: 7

Rep: Reputation: 0
Mounting USB from Script at bootup fails


Hello everyone ,

I am currently attempting to perform the following action on a SuSe 10 machine

(1) Modify the rclocal file to do the following at boot up
A.
Code:
mount /dev/sdb1 /tmp/usb
B.
Code:
sh /tmp/usb/run.sh

The problem is that during boot up it says

Code:
mount: special device /dev/sdb1 does not exist
But when the bootup process ends , i am able to mount the USB normally
using
Code:
mount /dev/sdb1 /tmp/usb
After checking mtab i noticed that the USB device is mounted to /media/<paritionname>


Help much appreciated
 
Old 12-04-2007, 07:31 AM   #2
silent echo
LQ Newbie
 
Registered: Nov 2007
Posts: 7

Original Poster
Rep: Reputation: 0
I also noticed that the HAL daemon is booting after the rclocal is ran . Could it be overriding the mount point to /media/<partitioname> ?
 
Old 12-04-2007, 01:28 PM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I think it is known OpenSuse does not load the driver for USB devices until much later in the booting process. Generally the initrd needs to be updated to incoporate this feature. Other distros from Debian, Slax and Red Hat do not have such limitation.
 
Old 12-05-2007, 02:29 AM   #4
silent echo
LQ Newbie
 
Registered: Nov 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thank for the reply saikee

yep i think that is defiantly the case . Even attempting to load a script at boot up at the end of run lvl 3 didn't do the trick .

So any suggestions for a work around ?
 
Old 12-05-2007, 10:21 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Never done it myself but as I said earlier you can recompile the initrd (ram disk file) to work round it. Opensuse web sites have loads of howto for it.
 
Old 12-08-2007, 07:47 AM   #6
silent echo
LQ Newbie
 
Registered: Nov 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for the help ,

I was able to fix this issue by adding a sleep command to the script before mounting the device . This ensured that the services i need had plenty of time to start .
 
Old 12-08-2007, 10:51 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
You may consider posting your script here as it may be of interest to others.
 
Old 12-10-2007, 03:12 AM   #8
silent echo
LQ Newbie
 
Registered: Nov 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Code:
#**************************
# Start USB Detection 
#**************************

# (0) User defined Values
mountDir="/tmp/USBSETTINGS"
PriDev="/dev/sdb1"
SecDev="/dev/sda1"
entryScript="run.sh"
sleepInterval="10"


# (1) Make mount point
mkdir $mountDir

# (2) Sleep to allow needed processes to finish starting up
sleep $sleepInterval

# (3) Mount thumb drive
mount $PriDev $mountDir
workingDev=$PriDev

  # (3.a) Test if mount was successful
  ls $mountDir | grep $entryScript
  
  if [ $? -ne 0 ]
  then
  	# (3.c) Attempt mounting secondary device
  	umount -l $PriDev
  	mount $SecDev $mountDir
  	workingDev=$SecDev
  fi
  
  
# (4) Start entry script
cd $mountDir
sh $entryScript


# (5) Clean up
umount -l $workingDev
rm -rf $mountDir


#*************************
# End USB detection 
#*************************
 
  


Reply

Tags
boot, hal, usb


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Suse 9.3 fails mounting usb flash drive enrico_dvchp Linux - Newbie 4 07-04-2006 04:34 PM
gnome fails to load on login after bootup - unless bootup first in win xp doubletruncation Fedora 6 12-07-2005 08:32 AM
mounting smb file server fails on bootup novacrasher Linux - Wireless Networking 3 12-03-2004 03:14 AM
Mandrake Fails On Bootup Spammy Mandriva 1 04-06-2004 07:30 AM
GRUB fails on bootup arvid Linux - Software 1 03-13-2002 12:07 PM


All times are GMT -5. The time now is 05:39 AM.

Main Menu
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