LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2009, 12:42 AM   #1
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Rep: Reputation: 16
Strange behavior, while booting from an external Hard Drive (USB)


Hi everybody!

recently I installed Debian/Lenny in my external USB hard drive (a Western Digital Passport Elite - 250 MB, which is USB powered ...) The steps I followed was:

1) I unplugged my Internal SATA Hard Drive and also my USB card reader device (which has 4 card slots). So the only device left plugged in was my SATA DVD-RW.

2) I connected my external Hard Drive to a USB port, and started a normal Installation of Debian/Lenny from the CD. Lenny "saw" my external HD as the only installable media /dev/sda. I made 3 partitions: /root (sda1) , swap (sda5 - logical) , /home (sda6 - logical). Finally I installed GRUB to the MBR of my external HD. And reboot ... (the first time I encounter an error 21, but the second time everything went fine)

3) I turned off my computer, plugged all my devices (internal HD and card reader) plugged my external HD and powered on my computer again... Changed BIOS options of-course, and also my GRUB boot parameters the first time ....

4) when I logged in, I changed the files fstab , menu.lst and uswsusp.conf because now /dev/sda is my Internal SATA Hard Drive, So (logically) /dev/sdb should be my external one ...

Here is the content of each file ...

fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/sdb1 / ext3 errors=remount-ro 0 1
/dev/sdb6 /home ext3 defaults 0 3
/dev/sdb5 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0

uswsusp.conf

# /etc/uswsusp.conf(8) -- Configuration file for s2disk/s2both
resume device = /dev/sdb5
splash = y
compress = y
early writeout = y
image size = 1914332938
RSA key file = /etc/uswsusp.key
shutdown method = platform

menu.lst

default 0
...
timeout 5
...

## ## End Default Options ##

title Debian GNU/Linux, kernel 2.6.26-2-amd64
root (hd0,0)
kernel /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sdb1 ro rootdelay=16 quiet
initrd /boot/initrd.img-2.6.26-2-amd64

title Debian GNU/Linux, kernel 2.6.26-2-amd64 (single-user mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sdb1 ro rootdelay=16 single
initrd /boot/initrd.img-2.6.26-2-amd64

### END DEBIAN AUTOMAGIC KERNELS LIST


Now, The problem Is:
When I want to boot from my external Hard Drive,

a) sometimes everything goes fine (like now) , my external HD is recognized as /dev/sdb and the login procedure proceeds normally ...

b) sometimes the GRUB fails with an error 21 , and not even show me the initial menu. (I suspect It cannot find some file ...)

c) sometimes the GRUB doesn't fail, but the kernel cannot enumerate my USB port, and label my device as /dev/sdf. Then throws me into ramdrive, expecting from me something to do. And the only command I know is reboot ...
I suspect It understands something like that ...
Internal HD sda
Card Reader sdb , sdc , sdd , sde
External HD sdf

Any Ideas ? Is it possible to change something at the boot parameters , or the configuration files ?
Is it because my Hard Drive doesn't have It's own power supply ? (Note this Drive has a very short USB cable - maybe USB power is not enough for booting ... but is adequate if the Drive acts as a storage device only)
Is it because my Hard Drive is "too fast" ? e.g I didn't have any GRUB problems with my USB stick earlier ...


Any help will be appreciated ...
Vas

Last edited by vasmakk; 05-02-2009 at 12:48 AM.
 
Old 05-02-2009, 01:14 PM   #2
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Hello vasmakk!
I suggest doing some research in the direction of usb and/or drive not being recognized because of slow usb-scan.
This means that your drive and/or USB-controller might be too slow starting up to be seen when it is needed.
Concerning your problem with the boot process stopping throwing you into ramdrive you could add/change something like...
Code:
rootdelay=30 doslowusb
...which would raise the search of the root fs from your 16 to 30 seconds and the "doslowusb" which would probably do as well something (never found out exactly what it does).

On the other side your grub-21-error is more serious, especially because it happens from time to time. Perhaps there your BIOS is changing behaviour from time to time?

Sorry I couldn't help more.
 
Old 05-02-2009, 01:32 PM   #3
hurry_hui
Member
 
Registered: Oct 2008
Location: Near Jakarta
Distribution: Slackware, Arch, Slax, Porteus, Tiny Core, Slitaz
Posts: 355
Blog Entries: 1

Rep: Reputation: 52
You might want to (re)configure your kernel so all supports for USB block devices are built-in.

You can also modify stanza so any 'root=/dev/your-hdd' refers to label or UUID. By doing so, boot sequence is no longer an issue.
 
Old 05-02-2009, 03:54 PM   #4
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Hi !

Pearlseattle, your solution seems to work. Thank you! In my previous attempts, I consider changing only the rootdelay value. Now with doslowusb things are O.k. Still I'm having problems with error 21, especially after reboot. When I turn on my Pc (from scratch) having already plugged in my HD, this error occurs rarely ...


Vas

Last edited by vasmakk; 05-02-2009 at 03:58 PM.
 
Old 05-02-2009, 03:58 PM   #5
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
hurry_hui, your solution seems somewhat advanced for a newbie like me ...
I'll try it when I learn some more stuff about the kernel.
Thanks anyway...

Still If somebody else have an opinion about the error 21 matter, I'll be glad to hear it ...

Vas
 
Old 05-02-2009, 04:22 PM   #6
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Happy to hear that
hurry_hui is right too:
when you download the kernel sources and configure it ("make menuconfig"), you can choose the USB-thingies to be compiled inside the kernel ("Y") instead as of modules ("M"). That jumps over the need to load the USB-modules separately once the kernel is being started.
Unluckily this doesn't solve the problem of your error 21.

If you would have an external case with a separate power connector you could try to start the external case before the PC - that way the HDD would for sure be ready by the time the PC boots from USB.
But I have to admit that grub's error 21 in your case is a little bit misterious - in the end if your PC is able to read grub's executable it should be able to read as well the rest (excluding root fs), or? And I don't think that "the rest" is affected by config files, as the boot medium, if alone, is (I think) always the first HDD (I am referring to "<your_boot_partition>/grub/device.map").
Greetings.
 
Old 05-02-2009, 04:46 PM   #7
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Pearlseattle View Post
Happy to hear that
...But I have to admit that grub's error 21 in your case is a little bit misterious - in the end if your PC is able to read grub's executable it should be able to read as well the rest (excluding root fs), or? And I don't think that "the rest" is affected by config files, as the boot medium, if alone, is (I think) always the first HDD (I am referring to "<your_boot_partition>/grub/device.map").
Greetings.
I never had an error 21 isue, with my USB Kingston stick ... Same Installation procedure as here. Anyway I shall try install debian/lenny in a seperate powered ext. USD drive next week, and see what happens.

By the way i found somewhere the scandelay=x boot parameter, which is also for slow devices... (x in secs) Could I use it in place of doslowusb ?

Vas
 
Old 05-02-2009, 05:51 PM   #8
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Same problems, again!

Quote:
Originally Posted by vasmakk View Post
I never had an error 21 isue, with my USB Kingston stick ... Same Installation procedure as here...
Vas

And what a pitty! I found this in ubuntu forums, and explains a lot...

" USB hard drives are not particularly good for using as bootable devices because they can fail to spin up in time for the BIOS to find them. Sometimes it can take a few attempts to get them to boot each time you want to use them.
Flash drives do not suffer from this problem and are far better for use as external bootable devices "

The problem is, I don't want a USB stick device and I don't want a dual boot system either... I prefere a portable linux system on a regular HD.


Vas
 
Old 05-03-2009, 01:19 AM   #9
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Hi everyone!

I think the problem solved ... (I mean, so far so good ...)
Along with the doslowuci option I had to add doscsi. The rootdelay=30 doesn't seem to have an effect since it is executed after the USB devices have being enumerated ... This is what I found:

doslowusb This adds some extra pauses into the boot process for the slow USB CDROM of the IBM BladeCenter.

doscsi This loads support for most SCSI controllers. This is also a requirement for booting most USB devices, as they use the SCSI subsystem of the kernel.

I also changed the timeout parameter (menu.lst) from 5 to 15... Not sure If this matters but anyway ...

As for the grub error 21 ... I connect my HD on a motherboard USB port directly, (not a USB hub in the front side) and then turn on my PC.

Regards
Vas
 
  


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
External USB Hard Drive and re-booting coreychch Linux - Hardware 1 04-26-2009 04:36 AM
Booting Suse 10.1 From USB External Hard Drive trickster009 Linux - Newbie 2 11-12-2006 02:25 PM
Strange USB flash drive behavior SamuelHenderson Linux - Hardware 3 09-17-2006 11:03 PM
Booting from external USB Hard drive? ArchAngeL13 Linux - Hardware 3 08-11-2006 03:02 PM
Booting from cd, linux on external usb hard drive ruh31 Linux - General 6 05-09-2006 07:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:11 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