I've cross-posted this to comp.os.os9 and uk.comp.os.linux. I read both
groups.
Here's why I'm asking: I need a fast way of backing up a complete OS-9
disk and of transferring it to a Linux system where it can be used with
the os9exec emulator. A Compact Flash card and IDE adapter for it looks
like a good solution.
The flash card would keep its original FAT32 format or be reformatted as
FAT16 because these can be read by both operating systems. Ideally I'd
reformat the card as an RBF filing system but the LinuxRBF module was
last worked on back in 2003 and is stuck at kernel 2.5. Anyway I don't
know if it would work over USB, so I'll probably just build LZH or TGZ
archives on the flash card.
OS-9 v2.4 doesn't understand about USB, so the idea is to use a Compact
Flash to IDE adapter on the OS-9 box together with the PCFS IOMan. Linux
knows about USB, so a straight card reader will work for it.
However, I'll need to make an OS-9 disk descriptor and to do this I need
to know the number of cylinders, tracks per cylinder, block size and
blocks per track on the card.
Questions:
- is there a Linux utility that can report the disk geometry for IDE and
USB attached storage devices? I tried parted, but it only summarizes
partition names and sizes.
- is there any available information about how CF card to IDE adapters
report disk geometry and what limitations apply to the geometry the
CF card is formatted to?
- can the PCFS IOMan handle FAT32 or is it limited to FAT16?
I think it is limited to FAT16 but that's not a problem because
I'm only planning to use a 1GB card.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
[snip]
>
> Questions:
> - is there a Linux utility that can report the disk geometry for IDE and
> USB attached storage devices? I tried parted, but it only summarizes
> partition names and sizes.
>
fdisk will do this. Of course it only shows what it /thinks/ is the geometry
but I guess that will be good enough.
--
Geoff Registered Linux user 196308
Replace bitbucket with geoff to mail me.
My expectation is that if I build a descriptor describing the geometry
defined when the card was formatted then the driver + IOman should do
the right thing.
> fdisk will do this. Of course it only shows what it /thinks/ is the geometry
> but I guess that will be good enough.
Especially given that disk geometries have all been lies for years ...
FWIW, fdisk actually allows you to *change* the geometry (in expert mode).
This turned out to be useful to get a 4GB card to work in an older
digital camera which did not like it out-of-the-box. The reason seemed to
be that a 4GB card has > 1024 cylinders by default. So I dropped the
cylinder count by a half and doubled the track count. You then just need
FAT-format it and set-up the directory structure that the camera expects, as
you can't let it format the disk...
--
Just because I've written it doesn't mean that
either you or I have to believe it.
> Especially given that disk geometries have all been lies for years ...
What?? You mean my disc doesn't have 255 read heads?? I demand a
refund! ;-)
--
Blast off and strike the evil Bydo empire!
Another one to try is hdparm -g.
Mike
And from the "theres alyways another way" department:
sfdisk -g /dev/...
(And compare it to -G rather than -g ;-)
Not all distros have sfdisk though... (Debian does, and I presume it's
variants)
Gordon
> On 2007-10-20, Andy Burns <usenet....@adslpipe.co.uk> wrote:
>
>> Especially given that disk geometries have all been lies for years ...
>
> What?? You mean my disc doesn't have 255 read heads?? I demand a
> refund! ;-)
But I'm quite sure your flash card has 255 read heads. ;)
--
`Some people don't think performance issues are "real bugs", and I think
such people shouldn't be allowed to program.' --- Linus Torvalds
Out of curiosity, do -g and -G often show different values?
sfdisk is part of the Fedora distro too, though I notice that the parted
manpage says to try parted first, then fdisk and sfdisk last but doesn't
give a reason for this advice.
Not always... modern sata drive:
# sfdisk -G /dev/sda
/dev/sda: 30401 cylinders, 255 heads, 63 sectors/track
# sfdisk -g /dev/sda
/dev/sda: 30401 cylinders, 255 heads, 63 sectors/track
Old IDE drive:
# sfdisk -g /dev/hda
/dev/hda: 158816 cylinders, 16 heads, 63 sectors/track
# sfdisk -G /dev/hda
/dev/hda: 9964 cylinders, 255 heads, 63 sectors/track
Kernel says:
hda: 160086528 sectors (81964 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(133)
at boot time.
Looks like the later versions of sfdisk (debian etch) don't support the
-G flag!
>sfdisk is part of the Fedora distro too, though I notice that the parted
>manpage says to try parted first, then fdisk and sfdisk last but doesn't
>give a reason for this advice.
I've never used parted - always use cfdisk - it's been in Debian for
a long time. It's a nice curses based utility. sfdisk is almost
impossible to use by hand - I use it to clone disk partitions when
building raid sets, or duplicate servers
sfdisk -d /dev/??? > sda.part
will dump the partition table in a format suitable for:
sfdisk /dev/sdb < sda.part
Gordon
> I notice that the parted
> manpage says to try parted first, then fdisk and sfdisk last but doesn't
> give a reason for this advice.
parted uses "better" ioctls and IME can often change partition tables,
and force the kernel to re-read them, in cases where fdisk/sfdisk woukd
need a reboot for changes to be seen.
> Looks like the later versions of sfdisk (debian etch) don't support the
> -G flag!
>
I found the exact opposite: FC1 (which is still on this laptop - kernel
2.6 installers don't fit on a floppy and this laptop doesn't boot from
its removable CD) sfdisk lacks -G but FC6 sfdisk has it.
> I've never used parted - always use cfdisk - it's been in Debian for
> a long time.
>
Its not in my copies of FC1 or FC6 but a French manpage is in both and
FC6 has a HOWTO for it. Very odd. I wonder why.
It's a nice curses based utility. sfdisk is almost
> impossible to use by hand - I use it to clone disk partitions when
> building raid sets, or duplicate servers
>
> sfdisk -d /dev/??? > sda.part
>
> will dump the partition table in a format suitable for:
>
> sfdisk /dev/sdb < sda.part
>
Thats a useful set of tips. Thanks. Filed for future reference.
Smart Boot Manager (http://btmgr.sourceforge.net/about.html) fits on
a floppy and can "chain-load" bootable CDs.
In your case, I'd look at chain-loading the Fedora 7 live CD (or Fedora
8 in a few weeks), seeing how it runs on your hardware, and if you like
it, run the install routine from "inside" the live CD session.
Fedora 6 has less than two months support scheduled for it.
Hope this helps,
James.
--
E-mail: james@ | I learnt the rules of rugby. There is only one rule.
aprilcottage.co.uk | "Skip it by any means necessary".
| -- "Nix"
> Fedora 6 has less than two months support scheduled for it.
>
Yes, I thought the cutoff point must be getting close.