Damn Small Linux - Not!
The forum for DSL-N
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

"Some BIOSes... cannot boot USB keys in 'USB-HDD'"

 
Post new topic   Reply to topic    Damn Small Linux - Not! Forum Index -> USB booting
View previous topic :: View next topic  
Author Message
dougz



Joined: 18 May 2006
Posts: 29

PostPosted: Fri May 26, 2006 2:19 am    Post subject: "Some BIOSes... cannot boot USB keys in 'USB-HDD'" Reply with quote

While my tale of woe is in thread [url]http://www.damnsmalllinux.org/dsl-n/f/viewtopic.php?t=127[/url] I thought it would be worthwhile posting this as a separate thread because it may be of more general interest.

I was trying to do research on how to debug SYSLINUX boot errors. One discussion recommended reading the file "README.usbkey" from syslinux-3.10. I thought the material was interesting enough to reproduce it in its entirety. Emphasis added.
[quote]$Id: README.usbkey,v 1.2 2004/12/30 23:31:14 hpa Exp $

The proper mode to boot a USB key drive in is "USB-HDD". That is the
ONLY mode in which the C/H/S geometry encoded on the disk itself
doesn't have to match what the BIOS thinks it is. Since geometry on
USB drives is completely arbitrary, and can vary from BIOS to BIOS,
this is the only mode which will work in general.

[b]Some BIOSes have been reported (in particular, certain versions of the
Award BIOS) that cannot boot USB keys in "USB-HDD" mode. This is a
very serious BIOS bug, but it is unfortunately rather typical of the
kind of quality we're seeing out of major BIOS vendors these days. On
these BIOSes, you're generally stuck booting them in USB-ZIP mode.

THIS MEANS THE FILESYSTEM IMAGE ON THE DISK HAS TO HAVE A CORRECT
ZIPDRIVE-COMPATIBLE GEOMETRY.[/b]

A standard zipdrive (both the 100 MB and the 250 MB varieties) have a
"geometry" of 64 heads, 32 sectors, and are partitioned devices with a
single partition 4 (unlike most other media of this type which uses
partition 1.) The 100 MB variety has 96 cylinders, and the 250 MB
variety has 239 cylinders; but any number of cylinders will do as
appropriate for the size device you have. For example, if your device
reports when inserted into a Linux system:

usb-storage: device found at 4
Vendor: 32MB Model: HardDrive Rev: 1.88
Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 64000 512-byte hdwr sectors (33 MB)

... you would have 64000/(64*32) = 31.25 cylinders; round down to 31.

The script "mkdiskimage" which is supplied with the syslinux
distribution can be used to initialize USB keys in a Zip-like fashion.
To do that, calculate the correct number of cylinders (31 in the
example above), and, if your USB key is /dev/sda (CHECK THE KERNEL
MESSAGES CAREFULLY - IF YOU ENTER THE WRONG DISK DRIVE IT CANNOT BE
RECOVERED), run:

mkdiskimage -4 /dev/sda 0 64 32

(The 0 means automatically determine the size of the device, and -4
means mimic a zipdisk by using partition 4.)

Then you should be able to run

syslinux /dev/sda4

... and mount /dev/sda4 and put your files on it as needed.[/quote]
In my case, I'm running an AMI BIOS, but this sounds interesting.

It is odd that I have no trouble booting DSL, but consistently fail with DSL-N, using same computer, port, and pendrive. That suggests that there is a difference in either the installation script and/or syslinux.

I do know from my testing that the DSL-N HDD install script does [b] change the geometry to 63 sectors/track.[/b]

Suggestions, anyone?
Back to top
View user's profile Send private message
dougz



Joined: 18 May 2006
Posts: 29

PostPosted: Sun May 28, 2006 10:38 pm    Post subject: and some that can't boot USB-HDD can bot USB-ZIP... Reply with quote

Did a bunch more research and found no specific answers. One thing that did appear to be of interest was that syslinux 3.x was deemed to be significantly more reliable than syslinux 2.x. Don't know why DSL-N uses 2.x (size?), but this might be an opportunity for improvement.

If you google to learn more about the issue, it is hard to see how one could justify building systems on pendrives or cfdisks. Variability in flash suppliers can result in geometry differences that mean boot reliability is questionable, even between instances of the same drive model from the same vendor.

If I want to carry DSL & DSL-N for systems troubleshooting, I'd better carry CD-ROMs. Pendrives may or may not work, even between different instances of the same model server. Not comforting.

[b]Note:[/b] This is not a criticsm of DSL/DSL-N or syslinux. This is a criticism of the BIOS BOOT process with USB pendrives & cfdisks. The same problems are described for many different distros and boot loaders. If it works for you, great. If not, you may well not be able to figure out a solution for a given BIOS/drive pair.

OTOH, when I ran out of ideas, I thought I would try the ZIP install. Boots fine. So, this pendrive wants to be HDD with DSL, but ZIP with DSL-N, all on same computer & port.

Go figure... Laughing
Back to top
View user's profile Send private message
cbagger01



Joined: 21 Apr 2006
Posts: 27

PostPosted: Mon May 29, 2006 5:44 pm    Post subject: Reply with quote

FYI,

With recent (3.xx) versions of SYSLINUX, it is now possible to install SYSLINUX on a FAT32 partition.

So with this version it is now possible to perform a DSL or DSL-N USBHDD install using a formatted FAT32 partition on USB storage devices that are larger than 2.1GB in size.
Back to top
View user's profile Send private message
roberts



Joined: 17 Apr 2006
Posts: 320
Location: OC CA USA

PostPosted: Tue May 30, 2006 3:55 am    Post subject: Reply with quote

Sounds like a good suggestion.
Back to top
View user's profile Send private message Visit poster's website
dougz



Joined: 18 May 2006
Posts: 29

PostPosted: Fri Jun 02, 2006 12:51 am    Post subject: Tried adding syslinux "-s" option -- no joy Reply with quote

The syslinux.doc file mentions the -s option, which [quote]will install a 'safe, slow and stupid' version of SYSLINUX. This version will work on some very buggy BIOSes on which SYSLINUX would otherwise fail...[/quote]
So I changed the pendrive_usbhdd.sh script -- from --
syslinux /dev/$TARGET -- to --
syslinux -s /dev/$TARGET

No difference on my machine. Didn't compare the size of ldlinux.sys, pre- and post-change.

Was still using the 2.x syslinux that comes with DSL-N. If I get a chance, I'll try 3.11.
Back to top
View user's profile Send private message
dougz



Joined: 18 May 2006
Posts: 29

PostPosted: Tue Jun 06, 2006 7:31 pm    Post subject: SUCCESS!!! Upgrading SYSLINUX does make a difference! Reply with quote

Did some more testing and found that:
-- Already had AMI BIOS "USB Controller" -- Enabled
-- Added AMI BIOS "USB Device Legacy Support" -- Enabled -- no improvement

Recap:
-- All tests done on same computer, port, and PNY 512MB pendrive
-- No problem booting DSL as USD_HDD
-- Could [u]not[/u] boot DSL-N as USB_HDD -- syslinux 2.04 boot failed w/ no logo or boot prompt
-- Could boot DSL-N as USB_ZIP (why?)

OK, how best to test hypothesis of need for version 3.11 syslinux? Looked at compiling it into DSL-N. Way too much work. DSL-N is "different." Too much work for this newbie.

Manually built single-partition (USB_HDD style) boot pendrive following the logic flow in the DSL-N pendrive_usbhdd.sh script on handy Fedora Core 3 box. Used Fedora 2.11 syslinux with DSL-N pendrive files. Better result:
-- Got past syslinux to boot screen with logo
-- Eventually got kernel panic

OK, going from 2.04->2.11 made a big difference. How to test 3.11? (Current syslinux)

Booted Knoppix 5.0.1 Live CD. Again, manually built a single-partition (USB_HDD style) pendrive following the logic in the DSL-N script. Used the Knoppix syslinux and the DSL-N pendrive files.
-- Booted DSL-N with 3.11 syslinux (current version)
-- Zipped through linux & minirt loads, no kernel panic, right into desktop
-- Fully functional. Total success! Very Happy

Therefore, I think that we have one data point to suggest that moving from the DSL-N's 2.04 syslinux to the current 3.11 syslinux helps with boot problems, at least for some of us. The 2.04 syslinux generated a 7836 byte ldlinux.sys, while the 3.11 generated a 9660 byte file. The authors claimed that it was more robust, which seems to be true.

Note -- I cheated in two places: didn't zero beginning of drive or copy mbr.bin.

Note -- Didn't bother testing FAT32. Syslinux 3.11 says it supports it. Bonus!

For anyone who wants to try to reproduce what I did:
-- To simplify things, I copied all of the files from a DSL-N USB_HDD pendrive to HD (for later reference)
-- Make sure pendrive is not mounted
-- Used fdisk to delete all partitions ([b]Destroys DATA!!![/b]) from pendrive
-- Used fdisk create single primary partition the size of the pendrive (n,p,1,enter,enter,w)
-- Used fdisk to make pendrive bootable (a,1,w)
-- Used fdisk to specify FAT 16 (t,6,w)
-- Should now have something like (device,boot,start,end,blocks,ID,system) -- /dev/sda1 * 1 last_cyl blocks 6 FAT16
-- Make a DOS filesystem - /mkdosfs /dev/sda1
-- Make sure kernel re-reads partition table - hdparm -z /dev/sda1
-- syslinux /dev/sda1
-- Flush buffers - sync
-- Mount pendrive - mount /dev/sda1 /mnt/sda1
-- Note the file ldlinux.sys (created by syslinux)
-- Make the directory knoppix on /mnt/sda1
-- Copy all of the save pendrive files to /mnt/sda1, except knoppix
-- Copy the saved pendrive knoppix to /mnt/sda1/knoppix
-- Flush buffers - sync
-- Reboot & test
Done!

Respectfully submitted from my new DSL-N USB_HDD pendrive. Woohoo! Very Happy
Back to top
View user's profile Send private message
PreZ



Joined: 28 Jun 2006
Posts: 1

PostPosted: Wed Jun 28, 2006 8:31 pm    Post subject: Reply with quote

I just did the same, and no joy.

Mine gets stuck 'Loading minirt.gz.................'

Obviously the syslinux part works, becaue I see the logo screen, it loaded the kernel (Loading linux......) just not minirt.gz.

It works fine off CD, and as with you, the regular DSL works fine off the pendrive.

I've not tried USB_ZIP, because I don't want to use it in that mode, I know it works as USB_HDD, regular DSL proved that.

As with you, when I let DSL-N install the device, it failed. If I copied the data, then did the mkdosfs and ran syslinux (3.11) myself, and copied the data back (except the ldlinux.sys file), it worked fine.

I guess there is one more thing to try - formatting it from windows (as FAT, not FAT32, as my man page explicitly says FAT32 is NOT supported) and then doing the syslinux and copy from that point on (ie. bypassing the mkdosfs and such).

Ugh.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Damn Small Linux - Not! Forum Index -> USB booting All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group