VOGONS

Common searches


First post, by foxbat

User metadata
Rank Newbie
Rank
Newbie

I have old 250MB spinning drive with Windows 98 that I wish to clone to CF card. My host system on which I executes all steps is 64bit Fedora 36 Phenom II machine.

/dev/sdd is the spinning drive
/dev/sde is the CF

fdisk p command shows:

Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sdd1 * 35 491399 491365 239.9M 6 FAT16

then I used dd to save image of the drive:

dd if=/dev/sdd of=myimage

next I copied the image to the CF card

$ sudo dd if=myimage of=/dev/sde bs=1M status=progress
$ sync

After that fdisk of /dev/sde shows:

Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x616e2069

Device Boot Start End Sectors Size Id Type
/dev/sde1 2037279855 3671775118 1634495264 779.4G 20 unknown
/dev/sde2 1330184192 1869160479 538976288 257G 20 unknown
/dev/sde3 538989391 1937352302 1398362912 666.8G 53 OnTrack DM6 Aux3
/dev/sde4 3909118566 3909183904 65339 31.9M bb Boot Wizard hidden

which is not that I would expect to see.

Not possible to boot legacy Pentium P54C with such a CF as a hard drive. But what is interesting when I switch on host system BIOS 'USB boot device' to 'Floppy mode' the CF boots up but stuck during boot because of wrong drive letter (A instead of C). Then when boot again host system with two CFs with same image on them it boots up successfully but hangs because this is 64bit machine.

Reply 1 of 14, by doshea

User metadata
Rank Member
Rank
Member

I'm pretty sure at one point when experimenting with writing to CF cards from Linux I ended up with some corruption which I verified was there by reading back from the device and then comparing the image I wrote with the image I read back. I think this might have been when I had the CF card attached via an IDE-to-CF adapter; maybe the ATA mode was set too fast in the BIOS or something. Perhaps it'd be worth reading back and doing a 'cmp' to check.

Alternatively maybe there is some bug where the partition table isn't being re-read properly after it was written, maybe removing and reattaching the device would help.

Even if it wasn't for the partition table appearing to be completely corrupt, one issue you might find is that if the CF card's geometry (as presented on the ATA bus) isn't compatible with your old hard drive, you'll probably have trouble booting anyway. I think in practice this means that the number of heads and sectors per track need to match, but you can have more cylinders on the CF card than the old disk (they just won't be used). If you pass '-c=dos' to Linux fdisk (it's deprecated in my old CentOS 7 version though so perhaps it has been removed in your version) it should show you the cylinders/heads/sectors geometry in the partition table.

Reply 2 of 14, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

You probably cant do what you want because the CF cards use LBA , and you drive is using CHS and CHS addressing is not mapped the same as logical block addressing.

--/\-[ Stu : Bloody Cactus :: http://kråketær.com :: http://mega-tokyo.com ]-/\--

Reply 3 of 14, by doshea

User metadata
Rank Member
Rank
Member

Sometimes the BIOS will give you a few different options for what CHS geometry to present when the drive itself is LBA, but I think they're generally ones where the heads and sectors per track are either set to maximum (16 and 63 if I recall correctly) or some power of two, whereas I think old drives normally presented weird numbers. I found this in TH99 for example:

P R O D R I V E   L P S   2 4 0   A T    QUANTUM
NO MORE PRODUCED Native| Translation
------+-----+-----+-----
Form 3.5"/SLIMLINE Cylinders 1818| 723| |
Capacity form/unform 245/ MB Heads 4| 13| |
Seek time / track 16.0/ 4.0 ms Sector/track | 51| |

I don't think any BIOS is going to offer a 13 heads and 51 sectors per track translation because those are weird numbers that just happen to multiply out nicely based on the capacity of the drive. I guess BloodyCactus is probably right, you'd probably need to be lucky for your drive's geometry to happen to match something that a BIOS might present.

Reply 4 of 14, by doshea

User metadata
Rank Member
Rank
Member

I'm not sure, but I think that if you were just using DOS, another possibility would be that you could pick some geometry in the BIOS which has a greater number of heads and sectors per track than your old drive, and just waste the additional capacity. For example, if your old drive emulated 13 heads and 51 sectors per track and your BIOS could emulate 16 heads and 63 SPT, you could just accept that the filesystem won't use the last 3 heads and last 12 sectors per track. The difficulty with that approach is that you need to somehow get your old image written to the disk in a way that matches how you expect the old machine to access it, so you probably need to write the image using the old machine itself, via the BIOS, i.e. don't do it from Linux on the old machine because it will access the CF card using LBA and not leave the unused parts. I have some notes on some DOS 'dd' commands that might help here (although I don't recall whether they actually supported direct access to HDDs). Alternatively it wouldn't be too hard to hack up a little utility that could pad out a disk image so it has the gaps in it.

However, I think the fact that you want to run Windows 9x means you couldn't try that, because Windows is going to do "32-bit disk access" or whatever they call it in 9x, i.e. not go via the BIOS but rather use LBA. I know Windows 95 could use 16-bit disk access in some cases when you had a DOS-only CD-ROM driver for example, so maybe there's a way to force 98 to do it for a HDD, but it might not perform well.

Just to be totally clear, I don't know for sure that any of the things I propose here would work, it's more like I think there's a chance they could!

Reply 5 of 14, by weedeewee

User metadata
Rank Oldbie
Rank
Oldbie

In stead of cloning the whole hard drive...
Let the CF card be autodetected by the 'legacy Pentium P54C system' and create a primary active partition on it.
Then clone the partition of the old hard drive onto the primary active partition of the CF card.

Right to repair is fundamental. You own it, you're allowed to fix it.
How To Ask Questions The Smart Way
Do not ask Why !

Reply 6 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Just use an old version of Acronis True Image..

Version 7 to 10 (or 11) were goid and had a Linux and DOS based emergency medium, respectively.

The DOS version should run on an ancient 586/686 PC with at least 64MB of RAM.

Edit: There are several alternatives for 386 era PCs, of course.
PC Backup of Central Point PC-Tools, for example.
Just requires a stack of good diskettes, afaik.
But it does compression, so it's not as bad as it sounds.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 7 of 14, by janih

User metadata
Rank Newbie
Rank
Newbie

On Ubuntu I've had good results cloning old hard drives and restoring the images to CF cards with Gnome's Disks utility. It can create and restore disk images. Don't know if it actually uses dd tool internally to make and restore images.

I've had similar problems with cloning disks with dd. Could it be for example that if you have old partitions on the target card that those could cause these issues? Maybe try to remove all partitions first on target.

Reply 9 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Unix' dd is brutal, though. It can damage media easily, if not used with care.
The same task can be done with Win32DiskImager, albeit more safely.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 10 of 14, by doshea

User metadata
Rank Member
Rank
Member
janih wrote on 2022-09-23, 06:57:

On Ubuntu I've had good results cloning old hard drives and restoring the images to CF cards with Gnome's Disks utility. It can create and restore disk images. Don't know if it actually uses dd tool internally to make and restore images.

That reminds me: I wonder if partclone has any smarts for this kind of thing?

I've had similar problems with cloning disks with dd. Could it be for example that if you have old partitions on the target card that those could cause these issues? Maybe try to remove all partitions first on target.

'dd' to the whole disk device (/dev/sdx instead of /dev/sdxN) should replace the partition table, it certainly does for me.

konc wrote on 2022-09-23, 07:18:

What's this "OnTrack DM6 Aux3"? Is DDO software involved? That might well be the issue.

I assume that Linux fdisk wouldn't silently handle the DDO on the original disk and show you a partition table other than what is actually on the disk. In fact I was surprised to learn that it actually supports (or at least supported) DDO software at all, but apparently they stopped automatically handling it as of the 2.x kernel (so over 25 years ago), so unless the original poster is telling the kernel to handle DDO software it should hopefully ignore any weird things like that. I assume that that stuff in the fdisk output was just due to corruption of the partition table.

Reply 11 of 14, by Jo22

User metadata
Rank l33t++
Rank
l33t++

^I was there. Linux Kernal 2.4 was the last "good" kernal for classic hardware.
At the time, Kernal 2.6 received heavy criticism for dropping support for ISA devices and other legacy components.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 12 of 14, by Azarien

User metadata
Rank Oldbie
Rank
Oldbie
Jo22 wrote on 2022-09-23, 11:56:

Unix' dd is brutal, though. It can damage media easily, if not used with care.
The same task can be done with Win32DiskImager, albeit more safely.

I'd recommend ddrescue in place of dd.
I always use ddrescue (included with gparted live) for cloning Windows drives.

Reply 13 of 14, by foxbat

User metadata
Rank Newbie
Rank
Newbie

What I did now is just dd'ed only partition not the entire device. This got me into unbootable drive in legacy machine. Next I booted with win98 floppy boot disk and still being on A: drive did:

C:\WINDOWS\COMMAND\sys.com C:
C:\WINDOWS\COMMAND\fdisk /mbr

Now CF boots to fully functional Windows 98SE. I use CF to dual uSD (this red one). It hangs my i430VX based system with black screen but works on i430TX (GA-586T2) one.

Because of differencies in geometry between legacy spinning drive and CF2uSD looks like it requires mbr/sys transfer. I will fiddle more now with this bootable CF2uSD maybe now it will allow me to just dd entire device to avoid wasting time with floppy boot disk.

Reply 14 of 14, by weedeewee

User metadata
Rank Oldbie
Rank
Oldbie

Glad to see my suggestion helped.
Enjoy !

Right to repair is fundamental. You own it, you're allowed to fix it.
How To Ask Questions The Smart Way
Do not ask Why !