VOGONS


First post, by Vaudane

User metadata
Rank Member
Rank
Member

I'd like to clone my old (whopping 80MB) 386's hard disk to a .iso file to be able to launch it in DOSBox. Even though I plan on doing a full low-level format for a fresh dos622/win311 install, it was my childhood computer so I'd like to preserve the setup.

I used dd to clone it on my linux system which has IDE headers, but doing a direct dd if=/dev/sdb of=386hdd.iso doesn't seem to preserve CHS addresses so I can't mount it in DOSBox.

Anyone done anything similar?

Reply 1 of 7, by einr

User metadata
Rank Member
Rank
Member

dd should make a complete copy of every byte of the drive, so it should just work. If it doesn't, maybe you're getting read errors that are corrupting the image? It's an old drive after all...

Try:

 dd if=/dev/sdb of=386hdd.img bs=64k conv=sync,noerror

The sync and noerror options will pad read errors with zeroes to keep the image integrity intact even if dd can't read the drive properly. These options are often suggested for making disk images, especially for older/bad disks.

Reply 4 of 7, by Vaudane

User metadata
Rank Member
Rank
Member
einr wrote:

dd should make a complete copy of every byte of the drive, so it should just work. If it doesn't, maybe you're getting read errors that are corrupting the image? It's an old drive after all...

Checked it using chkdsk, 30 years old, 50538 clusters, no errors/bad sectors. Quietly chuffed with that if I'm honest.

jmarsh wrote:

You have to record the CHS values manually if you want to mount a HDD image with DOSBox, they're only automatically pulled from the image file if you're mounting a floppy.

You're on the money here. It would appear I'd calculated the CHS parameters wrong. Recalculated and it just booted. Made sure to use -t hdd and -fs fat too, can't remember if i did this last time or not.

Thanks for your help peeps 😀

Reply 5 of 7, by Vaudane

User metadata
Rank Member
Rank
Member
einr wrote:
Try: […]
Show full quote

Try:

 dd if=/dev/sdb of=386hdd.img bs=64k conv=sync,noerror

The sync and noerror options will pad read errors with zeroes to keep the image integrity intact even if dd can't read the drive properly. These options are often suggested for making disk images, especially for older/bad disks.

Just in addition to my previous message, the aim is to make a bootable drive. The method I've used means it's not bootable. "Missing Operating System" error. Will try the sync command. Why do you say bs=64k and not 512 though?

Reply 6 of 7, by einr

User metadata
Rank Member
Rank
Member
Vaudane wrote:
einr wrote:
Try: […]
Show full quote

Try:

 dd if=/dev/sdb of=386hdd.img bs=64k conv=sync,noerror

The sync and noerror options will pad read errors with zeroes to keep the image integrity intact even if dd can't read the drive properly. These options are often suggested for making disk images, especially for older/bad disks.

Just in addition to my previous message, the aim is to make a bootable drive. The method I've used means it's not bootable. "Missing Operating System" error. Will try the sync command. Why do you say bs=64k and not 512 though?

No real reason, you had specified no block size at all in the OP so I just thought I would increase the block size a bit to speed things up. 😀

But... A full image made with dd includes the boot sector (which is located in the first 512 bytes of the disk) so it should boot. There's no magic to a bootable drive, since you've copied every byte off the disk, everything including the boot sector, bootable flags and partition tables is there. The only thing that isn't, as you discovered, is the drive geometry metadata (C/H/S) which would be stored in BIOS on a real PC.

You should not use -fs fat when trying to boot off a full disk image. Remember that you're dealing with a full disk image, not a partition image. The disk as such does not have a file system, file systems only come into play once you get down to partition level.

I'm not really familiar with the process DOSbox uses to boot whole hd images but reading the docs from here it looks like it should be something like:

imgmount 2 "386hdd.img" -size <your geometry goes here> -t hdd -fs none

and then

boot -l C

I think this is right..? The docs are not very clear and I don't use DOSbox for this kind of stuff myself 😀

Reply 7 of 7, by Vaudane

User metadata
Rank Member
Rank
Member
einr wrote:

No real reason, you had specified no block size at all in the OP so I just thought I would increase the block size a bit to speed things up. 😀

Fair enough, I must have broken something then as I do all that and I get a "Missing Operating System" error, but the iso itself can still be opened as an archive using 7zip. Makes sense about the partition vs drive statements though. Thank you!