Author Topic: Cloning a IDE hard drive?  (Read 15450 times)

0 Members and 2 Guests are viewing this topic.

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #50 on: April 06, 2020, 01:21:11 am »
Thanks.
Just one of many things I've made (but arguably the most technically challenging).
It certainly is a useful tool, hence my desire to future-proof it.

PS The EMUHDD people came back to me already. US$750 (which for me in New Zealand is the equivalent of around $1,500). So I will keep that as a backup option and go with my $10-20 experiments for now.
« Last Edit: April 06, 2020, 01:23:10 am by olafnz »
 

Offline bobcat2000

  • Regular Contributor
  • *
  • Posts: 209
  • Country: us
Re: Cloning a IDE hard drive?
« Reply #51 on: April 06, 2020, 01:26:27 am »
Oh!  It is a box.  I thought it was something you hang on the wall.

You can put all the Dune movies and video games boxes in it.

Very Nice.
 
The following users thanked this post: olafnz

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #52 on: April 06, 2020, 01:39:57 am »
It was a commissioned job for a fan of the original board game, prior to the new release last year:
https://boardgamegeek.com/boardgame/283355/dune
 

Offline bobcat2000

  • Regular Contributor
  • *
  • Posts: 209
  • Country: us
Re: Cloning a IDE hard drive?
« Reply #53 on: April 06, 2020, 02:04:32 am »
Aha!  I see.
 

Offline bobcat2000

  • Regular Contributor
  • *
  • Posts: 209
  • Country: us
Re: Cloning a IDE hard drive?
« Reply #54 on: April 06, 2020, 03:09:54 pm »
I met a guy who went to the mountain to haul back a big piece of wood about the size of a dining table.  He used a hammer and chisel to make an art work from that piece of wood.  He sold it for around US$20,000.

 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16356
  • Country: za
Re: Cloning a IDE hard drive?
« Reply #55 on: April 06, 2020, 04:45:49 pm »
I still play an old version of Dune II in Dosbox when I feel like nostalgia....... SAdly the sound experience on the emulation is better than what was available on the original Adlib compatible card I had, and even when I got a Genuine Creative labs card I had to move IRQ on it, so not all sounds played as well. But plays really nice now in emulation.
 

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #56 on: May 17, 2020, 07:32:19 am »
Right, that took a while, due to AliExpress shipping times and Covid lockdowns.

I have this week received my CompactFlash to IDE adaptor (https://www.aliexpress.com/item/32920488992.html). I plugged an 8 Gb CF card into it (remember that my original HDD is ~2.1Gb) and booted up.




The drive presents as 8000MB, so I wrote the image and it seemed to copy with no issues.

I tested this on the same desktop PC I used to write the image, and it does at least get to the LynxOS boot loader:



I plugged it in to the CNC, and the BIOS seems to recognise it just fine:



This was a relief, because I don't know how large the BIOS can handle, although it does support LBA.

Sadly it would not boot. I had the same issue as previously when I tried with spinning HDD's:



According to Google, 1962 means "No operating system found". There is no other HDD in the PC, so it is not boot order. The jumpers are definitely set to Master, and of course it kind of boots in the other PC.

So I might be on the wrong track, but I'm still concerned about drive CHS geometry. To refresh you, the original HDD is:
2162Mb (Fujitsu MPB3021AT, 40-pin IDE with 4470C, 15H, 63S). See http://www2.fcpa.fujitsu.com/sp_support/ext/desktop/manuals/mpb3xxxat-manual.pdf

My 8GB CF card presents as:
15501C 16H 63S, Sector Size 576



I sort of feel that this shouldn't matter under LBA, but I lack the confidence to know for certain, and if it is not that, then what is it?

To refresh you, I previously tried 3 similar-era-but-slightly-larger HDD's with different geometry, and had similar results to today. But when I purchased an identical MPB3021AT HDD and cloned the image on to it, it works just fine. Very luckily because since I took the image my original disk failed.

To me that proves that I am copying the image "correctly", but I lack the knowledge to know whether LynxOS looks at the HDD at a low level of geometry to achieve its realtime requirements.

I still wonder whether I somehow need to pad out the image (ie. 15 blocks, then 1 block of blank to match 16 heads) but having a different sector size probably doesn't help either.


 

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 739
  • Country: de
Re: Cloning a IDE hard drive?
« Reply #57 on: May 17, 2020, 09:43:55 am »
If you can find one try a 1- or 2GByte CF-Card. It still can be a BIOS problem that can't handle bigger drives than 2.1GByte. The code reporting the size on the screen and the one actually used for accessing the drive might be two different parts.

But there were many other IDE size limitations in the past: https://www.tldp.org/HOWTO/Large-Disk-HOWTO-4.html

Edit: Can you check the Jumpers on the old drive? The old drive is a bit over the actual size limit. But you can 'reduce' the reported size by jumpers. It is described on page 3-12 of the drive manual.
« Last Edit: May 17, 2020, 09:48:36 am by Twoflower »
 
The following users thanked this post: olafnz

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #58 on: May 17, 2020, 10:23:02 am »
Thanks Twoflower,

Well spotted. I had not noticed that there are a few other jumper options apart from just the usual Master/Slave/CSEL, as the printing on the drive itself only covers the "Default Mode" settings not the "Special Mode" settings. However both my old defunct drive and my replacement working drive are just on the default mode Master Device setting, so it definitely should be presenting as 4470/15/63.

Obviously there are no jumpers on the CF, and this has been my big confusion throughout. If you look at some of my previous posts I was asking why different CF cards actually present different CHS geometries.

"
https://www.ebay.com/itm/4GB-DOM-SSD-Replace-Vintage-3-5-IDE-Drives-with-this-40-PIN-IDE-SSD-Card/254364506542 (8146 Cylinders 16 Heads 63 Sectors)
https://www.ebay.com/itm/16GB-SSD-DOM-Replace-Vintage-3-5-IDE-Drives-with-this-40-PIN-IDE-SSD-Card/312774694344 (16383 Cylinders 15 Heads 63 Sectors)

But what confuses me is that these CF DOM modules state that they present as a certain number of cylinders, heads and sectors in non-LBA mode. I would have thought this might be configurable on the module. ie. why is are all 16Gb modules of that type 15 heads, 63 sectors (so probably compatible with my drive, since I am told that the cylinder number doesn't matter if it is larger) but all 4Gb and smaller modules on Ebay seem to different, ie. 16 heads, 63 sectors?
"

I'd love to know if there is a way to "reprogram" a CF card to present as a different geometry (or even a different total size). Always assuming that I am on the correct track, but ultimately I know that replacing the identical HDD and cloning it did work. So if there is a way I can spoof the same size and geometry I'd hope that should work too.

----------------------------------------

I know there were lots of different size limits, so I could try 4Gb. However the existing image is 2.1Gb so I can't really go much smaller.

Also, I know you weren't part of the conversation a couple of months back, but I had previously tried 2-3 very-similar-era-but-slightly-larger HDD's (of the order of 2.5-6Gb) and they all had the same result.

I probably need to know more about whether there is anything specific to LynxOS, but sadly I have had a topic on comp.os.lynx for over a month with no responses there.
https://groups.google.com/forum/#!topic/comp.os.lynx/H-JmV74I_7o

 

Offline granzeier

  • Regular Contributor
  • *
  • Posts: 84
  • Country: us
Re: Cloning a IDE hard drive?
« Reply #59 on: May 17, 2020, 10:40:34 am »
...I have this week received my CompactFlash to IDE adaptor (https://www.aliexpress.com/item/32920488992.html). I plugged an 8 Gb CF card into it (remember that my original HDD is ~2.1Gb) and booted up.
...
The drive presents as 8000MB, so I wrote the image and it seemed to copy with no issues.

I tested this on the same desktop PC I used to write the image, and it does at least get to the LynxOS boot loader:
...
I plugged it in to the CNC, and the BIOS seems to recognise it just fine:
...
This was a relief, because I don't know how large the BIOS can handle, although it does support LBA.

Sadly it would not boot. I had the same issue as previously when I tried with spinning HDD's:
...
One more thing to test...
Try deleting the image on your CF card, and put it into the CNC computer. Boot that from DOS (floppy disk, USB, whatever) and then try to format the CF with /S to make it bootable. Then reset the computer and see if it will boot. That will tell you if the trouble is with the hardware/firmware, or with the image.
 
The following users thanked this post: olafnz

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 739
  • Country: de
Re: Cloning a IDE hard drive?
« Reply #60 on: May 17, 2020, 11:11:20 am »
Probably there's no real way to modify the geometry of the CF cards. Unless you can access the card-Internal controller. I think the geometry is managed in the CF card itself.

Just looking a bit around in the webs abut that. Maybe that might help:
https://www.linuxquestions.org/questions/linux-newbie-8/lynxos-disk-clone-939135/#post4659248

Try to format the CF card from a FreeDOS or MS-DOS as granzeier mentioned is a good idea. Just to see if the drive is correctly accessed. I think the next step would be to test if your cloning somehow was not working as it should (even if it booted on another PC). With the unknown file-format it might not like to moved from one geometry to another. If the LynxOS uses some kind direct access to the media you might run into some unexpected trouble.
 
The following users thanked this post: olafnz

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #61 on: May 18, 2020, 09:49:55 pm »
Thank you both Twoflower and granzeier for your thoughtful and helpful suggestions. Perhaps obvious in retrospect, but I had not thought of them!

So I got another 8Gb CF card, installed FreeDOS on it, and checked that it boots OK in the desktop PC.

Sadly when I put it in the CNC, it does not boot. I get the same 1962 error as before.

I tried fdisking to a 512 Mb primary partition, just in case it was a partition size, rather than disk size issue, but no difference.

So I guess we can rule out this being a LynxOS direct media access issue. Which for me is a huge step forward, so thank you for that suggestion!

Then I thought, well I have nothing to lose, so I did something I had never tried before - I set the BIOS from Extended CHS to Basic CHS. The 8000 Mb CF card now shows up as 527 Mb (no big surprise).



Then, wonders of wonders, FreeDOS boots!

So I decided to push my luck and try the other LynxOS CF card. It also booted right up without issues. I am not sure whether this is because there is <527 Mb of data accessed on the disk, or whether LynxOS accesses the disk directly in spite of the BIOS settings (but then why does it not work when the BIOS is set to Extended CHS).

The problem for me is this is all 20+ years ago, and my memory is vague. But I do recall sometimes (I think?) you had to do tricks where the drive presented (or was set up) as a smaller drive, until it had booted, then you could access the rest of the drive. I thought that was usually done with a small primary partition and some TSR or other utility that was loaded on boot, but does anybody remember the details?

----------------------------------

I did find an interesting article saying you can "force disk geometry" (https://dark.ca/2009/06/22/force-disk-geometry-with-sfdisk/). Sadly the sfdisk on my version of Linux (LinuxMint) seems to lack the -C -H and -S options, so I will have to chase down some other distribution. Not sure exactly what this is claiming to do, though.

 

Offline bobcat2000

  • Regular Contributor
  • *
  • Posts: 209
  • Country: us
Re: Cloning a IDE hard drive?
« Reply #62 on: June 01, 2020, 05:39:48 pm »
I found this video talking about why the PC can see the drive but won't boot.  I think what he is saying is that the CF adapter may be reporting the wrong CF card geometry to the PC.

He says to use a third party software to query the CF card directly to get the exact geometry.  So, you can manually enter the numbers to the BIOS instead.

https://youtu.be/G26cRjrt5Mg
« Last Edit: June 01, 2020, 05:42:25 pm by bobcat2000 »
 
The following users thanked this post: olafnz

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: de
Re: Cloning a IDE hard drive?
« Reply #63 on: June 03, 2020, 04:09:33 pm »
I found this video talking about why the PC can see the drive but won't boot.  I think what he is saying is that the CF adapter may be reporting the wrong CF card geometry to the PC.

He says to use a third party software to query the CF card directly to get the exact geometry.  So, you can manually enter the numbers to the BIOS instead.

https://youtu.be/G26cRjrt5Mg
  I haven't seen the video and hence don't know what he claims, but the CF adapter is passive and won't (be able to) "translate" the card's geometry.  CF cards use an IDE interface, all the schmarts happen inside the card.  The translation generally cannot be changed inside the card and seems rather be an artifact of the PC BIOS.  So yes, you might have some luck bypassing the auto-detection and force some values.

  I know nothin' about LynxOS, but early Linux didn't use BIOS code, so you could end up in a situation, where the BIOS was able to load the boot loader (e.g. LILO or GRUB), that one then in turn might or might not load the kernel and the kernel then might or might not find the root fs.  I could imagine something similar is happening in LynxOS.
 
The following users thanked this post: olafnz

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #64 on: June 04, 2020, 12:24:28 am »
Yes, there are absolutely no IC's on the adapter board. I hadn't realised CF cards were so compatible with IDE, even to the extent of presenting a fake CHS geometry. (Obviously fake, since a memory chip has no physical "geometry").

In any case, my BIOS doesn't seem to provide any option to enter the CHS values manually.
The only options you get:
General IDE setup:
- IDE Translation Mode: Standard CHS or Extended CHS

Then drilling down for each drive you get:
- Transfer Mode Determination: Auto or Manual. The options in Manual are PIO Mode 0, PIO Mode 1, PIO Mode 2, PIO Mode 3, PIO Mode 4. In Auto, (for my hard disk) PIO Mode 4 is selected. I notice (looking at the screenshot in my previous comment, that the CF card selects PIO Mode 2).
- There is another note stating that LBA is supported.

From a Google search, PIO mode seems to be just about data transfer rate (ie not relevant to this thread):
- PIO Mode 0   3.3MB/sec
- PIO Mode 1   5.2MB/sec
- PIO Mode 2   8.3MB/sec
- PIO Mode 3   11.1MB/sec
- PIO Mode 4   16.6MB/sec

So, to recap:
- My CF card will boot under Basic CHS (first 527MB), but not under Extended CHS (8000MB).
  - Basic CHS works both under FreeDOS and using LynxOS.
  - Extended CHS does not work under either FreeDOS or LynxOS, so I've actually become less suspicious of LynxOS's (probably) direct hardware writes being the cause.
- My CF card presents as 15501C 16H 63S, Sector Size 576, but there is no way to put that in to my BIOS.
- My Hard disk boots fine under Extended CHS (2162Mb (Fujitsu MPB3021AT, 40-pin IDE with 4470C, 15H, 63S). See http://www2.fcpa.fujitsu.com/sp_support/ext/desktop/manuals/mpb3xxxat-manual.pdf
  - The Master/Slave/CS jumpers are just fine (set to the default).

So, a BIOS firmware bug/incompatibility?

But then why does my Hard Disk specifically work, and other similar-vintage hard disks with slightly different geometry not work?
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: de
Re: Cloning a IDE hard drive?
« Reply #65 on: June 04, 2020, 03:48:03 pm »
[..]
- My CF card presents as 15501C 16H 63S, Sector Size 576, but there is no way to put that in to my BIOS.
[..]
The sector size looks wrong.  It will most certainly be 512 bytes (520 bytes was used in some systems, e.g. NetApp and NeXT Cube/Workstation, but those were SCSI).
 
The following users thanked this post: olafnz

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #66 on: June 05, 2020, 07:32:59 am »
Agreed, but that's what it reports.
I tried using some of the Linux fdisk options to "modify" the geometry, but that was ignored.
So it's all very confusing what the BIOS is doing under Extended CHS.
 

Offline Wallace Gasiewicz

  • Super Contributor
  • ***
  • Posts: 1294
  • Country: us
Re: Cloning a IDE hard drive?
« Reply #67 on: June 06, 2020, 05:46:08 pm »
Is it possible to connect an IDE drive to a PCMCIA port on an appropriate computer and then use the computer to clone another PCMCIA card and use this for backup? Using the correct connector.
PCMCIA cards were used a lot in old programmable machines.
Wally
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2617
  • Country: 00
    • My random blog.
Re: Cloning a IDE hard drive?
« Reply #68 on: June 06, 2020, 10:07:24 pm »
'CF -2- PCMCIA' converters work because CF cards support PCMCIA PC Card ATA modes of operation in addition to IDE emulation.
PCMCIA PC Card ATA defines memory mapped and I/O Mode.
TLDR it only works one way.
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: de
Re: Cloning a IDE hard drive?
« Reply #69 on: June 07, 2020, 04:46:07 pm »
[..]
The problem for me is this is all 20+ years ago, and my memory is vague. But I do recall sometimes (I think?) you had to do tricks where the drive presented (or was set up) as a smaller drive, until it had booted, then you could access the rest of the drive. I thought that was usually done with a small primary partition and some TSR or other utility that was loaded on boot, but does anybody remember the details?
[..]
  That was common practice (at least) using Linux for a time:  you had to create a small (less than say 500MiB) partition which you formatted with a fs the bootloader understood, e.g. ext2, which had to be in the beginning of the disk, so that the braindead BIOS would find it and place the bootloader there.  The bootloader then did understand larger drives and was able to load the kernel either from that boot partition or anywhere you specified.  That procedure isn't needed with UEFI.

  I actually ran into similar issues just these days, as the HDD in my HP1662C died (before I could make a back-up).  I got a CF card and adapter which works fine, but struggled a bit to get the system software (chiefly test tools, as the OS is thankfully in ROM) on that card as the fs used by the LA is an oddball FAT (byte-swapped, 16KiB sector size) and neither Linux' fat fs nor the mtools (at least not mformat) cooperate with that.   I seem to have succeeded by formatting the card using the LA and then using mtools under Linux to copy the files to the card.  Have you tried to format your drive using LynxOS?
 
The following users thanked this post: olafnz

Offline olafnz

  • Contributor
  • Posts: 17
  • Country: nz
Re: Cloning a IDE hard drive?
« Reply #70 on: June 07, 2020, 07:35:04 pm »
I have no possibility of setting up from scratch - I have no LynxOS installation, nor the CNC-specific software.

Hence why I am jumping through hoops to preserve the HDD image. If I had not taken the initiative when I got the machine, I'd now have a 3 tonne paperweight.
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 727
  • Country: de
Re: Cloning a IDE hard drive?
« Reply #71 on: June 08, 2020, 06:09:31 pm »
  I just see that the company which (still) produces LynxOS makes it software available for 'evaluation'.  Not sure, whether that's just a legal limit or indeed a technical (limited time or limited functionality).  Might be worth looking into that.  Or bugging them for support.

  I also looked around a bit and came to the conclusion that the 576B sector size is very likely a software bug in the reporting (incidentally the 4GB CF card from Kingston reports itself having cylinders of 576 sectors, each 512B, see https://web.pa.msu.edu/hep/atlas/l1calo/cmx/hardware/cf_cards/CMX_CFcard_02_Kingston_4GB.txt).
 
The following users thanked this post: olafnz


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf