Re: Unslung 6.8 and 256MB USB sticks: RESOLVED
That will help you in your PostScript.
--- In email@example.com, "Mike \(mwester\)" <mwester@...>
> I finally broke down and bought a 256MB USB memory stick, just to try to
> debug the issues being reported with these small devices and Unslung
> Based on the available information (thanks to those who provided
> output from their 256MB devices), here's what's happening:device -- the
> The vital bit of information is the number of cylinders on the
> Linksys firmware does all its work in units of cylinders. My USB key (aconcept
> 256MB Sandisk Cruzer Mini) has 1011 cylinders.
> [editorial note: yes, the concept of cylinders and heads are totally
> obsolete and have no application to flash memory devices, but the
> lives on to torment all right-thinking people. This is anotherexample of
> how the sins of the fathers are visited upon the future generations.]back and
> In order to figure out the partitioning, Linksys starts from the
> works to the front. We will too, in the following example. One othersecond
> important bit of information: Linksys is trying to come up with the
> and third partitions as close to 128MB as possible: 256,000 blocks to bepartition. This
> exact. Whatever is left over becomes the first (the data)
> approach works well for large disks, but let's take a look at whathappens
> for a 256MB device:device (you
> So, Linksys fetches the number of blocks per cylinder from the
> can read this from the output of "fdisk -l /dev/sda"). For myCruzer, it's
> 496 blocks / cylinder. Doing the division (256,000 blocks / 496blocks per
> cylinder) yields (rounded) 516 cylinders that together can make up thefrom the
> desired 128MB partition size.
> Since the device contains 1011 cylinders, that means that partition #3
> starts at cylinder number 495, and runs for 516 cylinders, ending at
> cylinder 1011.
> Ok. Now the second partition: going back a further 516 cylinders
> start of the third cylinder says that partition #2 must start atspace (-21
> cylinder -21 -- and run for 516 cylinders, ending at cylinder 495.
> Not looked too good, huh?
> But, it's not over yet -- we still need to allocate the left over
> cylinders) to the first partition. Since we all know that the firstlabel), the
> partition must start at cylinder 1 (cylinder 0 is used for the
> first partition must start at cylinder 1, and run for -21 cylinders.code to
> In defense of Linksys, they *do* have code in the kernel that identifies
> devices smaller than 10GB as "flash" devices, and Linksys' code will not
> attempt to format them. So there really isn't any reason for their
> handle this extreme case any more elegantly than it does -- which isto say
> that since this can't ever happen, Linksys doesn't check for it, and thewhat ends
> hacked-up Linksys fdisk utility actually attempts to write these bogus
> values to the partition table.
> Ouch. It's no wonder some of the flash devices get "messed up" --
> up written is enough to choke any OS that tries to make sense of theknow.
> partition table.
> 256MB flash devices cannot be natively formatted by Unslung, at least by
> Unslung 6.8.
> [if there are those who would dispute these findings, please let us
> in particular, the output of "fdisk -l /dev/sd<n>" would be veryhelpful in
> trying to figure out how it might be that you can get it running.the only
> scenario where I can conceive of this working is in the extreme caseof very
> small numbers of cylinders -- for example if the device claims tohave only
> 3 cylinders, rounding might create a situation where the format actuallydevice
> comes up with non-negative numbers. if you have such a system, please
> confirm by sending along your information.]
> Mike (mwester)
> PS: Since I now have a brand new and utterly useless 256MB memory
> lying on my desk, I shall be attempting to hack a means to override theemail to
> Linksys formatting parameters for small devices, and make this work. As
> soon as I get some code working well, I'll check it in and send an
> the nslu2-linux group. Those interested can build the head, andtest with
> unslung 6.9-alpha.