Strange behavior, while booting from an external Hard Drive (USB)
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 ...
# /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
# /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
## ## End Default Options ##
title Debian GNU/Linux, kernel 2.6.26-2-amd64
kernel /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sdb1 ro rootdelay=16 quiet
title Debian GNU/Linux, kernel 2.6.26-2-amd64 (single-user mode)
kernel /boot/vmlinuz-2.6.26-2-amd64 root=/dev/sdb1 ro rootdelay=16 single
### 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 ...
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...
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.
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.
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 ...
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.
Still If somebody else have an opinion about the error 21 matter, I'll be glad to hear it ...
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").
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 ?
Same problems, again!
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.
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.
|All times are GMT -5. The time now is 02:30 PM.|