Welcome, Guest. Please login or register.

Author Topic: backing up amiga hard drives with linux dd  (Read 4174 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
backing up amiga hard drives with linux dd
« on: February 01, 2009, 02:22:16 AM »
I have two hard drives attached to my Amiga 500.  Dataflyer IDE and an external hard drive case I made out of a drilled radio shack project case 20 years ago.

Both hard drives are old and have surprisingly not failed yet.  I've copied the majority the files off successfully using AmigaExplorer.

I'd like to do an entire bit-by-bit copy of the drives, and plan on pulling the drives, one at a time, installing them into an Ubuntu box, and using dd to perform the copy.

My concerns are that while dd will record every bit on the drive, it does so in such a way that restoring the backup to another (new) drive is impossible because of drive geometry problems.

From within linux, is it possible to mount the dd image, not the hd, and access the contents?  I think I'm using FFS on the HD.

Thanks

(apologize if this is a dup post, I swear I posted this an hour ago)
 

Offline Sparky

  • Sr. Member
  • ****
  • Join Date: Dec 2003
  • Posts: 286
    • Show only replies by Sparky
Re: backing up amiga hard drives with linux dd
« Reply #1 on: February 01, 2009, 03:14:25 AM »
I'm not so sure you will have geometry problems.

By the time "dd" gets to see the disk the heads, cylinders, sectors have all been translated into blocks (numbered 0 to 19847598457987546 :-)

So when you drop in a new disk and transfer the image file over by doing the dd in reverse it should be fine (so long as the new disk is bigger .. not hard these days)

The only thing I can think of is if whatever the Amiga uses for a bootblock also stores info about the drive the bootblock is on ... so if you dd'd to a bigger drive, is there anything in the boot block that would complain ?
Also would the Amiga be able to see the left over space of the bigger drive as free ?  Or would it just not believe it was there ?

Regards

Mark

 

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: backing up amiga hard drives with linux dd
« Reply #2 on: February 01, 2009, 08:26:06 AM »
I'm honestly not sure.

I just spent the last couple hours trying to get Ubuntu, that has support for AFFS, to recognize the attached hard drive.  The driver complained of "No valid root block detected on /dev/sdc"

printk(KERN_ERR "AFFS: No valid root block on device %s\n",

I did manage to dd the whole drive -- but not sure if the contents are ok yet.  I looked at the raw bytes in the file, and it starts off with a big block of 0x2A's.  And then the text in the file seems shifted by x-number of bits/characters..... I'm not sure if linux was reading it properly.


Is devs:mountlist the officially used file for mounting?  I swear I had to manually type in sector/cyl/heads/etc in a file, and I can't find it anyplace.  I want to double check I'm using FFS.

Thanks
 

Offline Thomas

Re: backing up amiga hard drives with linux dd
« Reply #3 on: February 01, 2009, 09:51:52 AM »

Quote
I swear I had to manually type in sector/cyl/heads/etc in a file, and I can't find it anyplace.


If you can boot from the disk, then there is no file. The geometry is stored in the first few blocks of the disk (called RDB or RDSK, Rigid Disk Block).

If you boot from floppy disk, then the mount fils is on the floppy disk.

Quote
it starts off with a big block of 0x2A's


If you made an image of one partition, then the image should start with the letters DOS.

If you made an image of the whole disk, then the image should start with the letters RDSK or at least one of the first 16 blocks of 512 bytes should start with RDSK.

Quote
I've copied the majority the files off successfully using AmigaExplorer.


You can use AE to create HDF images, too. A HDF is a bit-by-bit copy of a partition.

Bye,
Thomas

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: backing up amiga hard drives with linux dd
« Reply #4 on: February 01, 2009, 04:49:56 PM »
The disk I was trying to image isn't bootable (afaict) --- and it's a second hard drive.  I boot from the first.

I don't think it's an image of the partition, because I don't think linux understands amiga partitions at the level at which I have access to it.  I think it sees it as a raw device, since AFFS can't really mount it.

If I do an "lshw", the drive shows up as a seagate, of the right size, and as "/dev/sdc"

I'll search for that string, but I was looking for block/format identifiers in the file, and nothing stuck out.

I've created some HDFs before, and maybe that's the route I'll go this time too.

Thanks
 

Offline buzz

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 612
    • Show only replies by buzz
Re: backing up amiga hard drives with linux dd
« Reply #5 on: February 01, 2009, 04:58:31 PM »
Quote

From within linux, is it possible to mount the dd image, not the hd, and access the contents? I think I'm using FFS on the HD.


should work by using a loopback device.

see this

http://www.andremiller.net/content/mounting-hard-disk-image-including-partitions-using-linux

but instead you will be using affs filesystem (-t affs)
 

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: backing up amiga hard drives with linux dd
« Reply #6 on: February 01, 2009, 05:23:07 PM »
Thanks.  I had found that last night, and I guess AFFS has direct support for the loopback.  (I don't honestly know if direct support is needed, but they do mention it specifically in the source/notes for AFFS)

My problem is I can't even mount the actual hard drive.

I did create an image, and then try to mount the image using the "-o loop."  And I get exactly the same no valid root block found error message.

Thanks
 

Offline LoadWB

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: backing up amiga hard drives with linux dd
« Reply #7 on: February 01, 2009, 06:49:14 PM »
Solaris has the lofi device, but it, at least in Solaris 8, has a pretty limited set of filesystem drivers.  Anyone know of a port of AFFS to Solaris?
 

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: backing up amiga hard drives with linux dd
« Reply #8 on: February 01, 2009, 10:18:03 PM »
Call me crazy, but the image dd has stored for the amiga drive is being corrupted in a very odd way.

Look at this:

001839A0 0000 0000 0000 3A17 0000 6402 0000 5C01 ......:...d...\.
001839B0 480F 7261 4464 7369 2E6B 7264 7669 7265 H.raDdsi.krdvire

Now, that clearly says Harddiskdriver.  There's plenty of other examples.

001F8000 4F44 0153 4F44 0153 4F44 0153 4F44 0153 OD.SOD.SOD.SOD.S

That should be DOS.DOS.DOS.  But it's not always backwards like that.

and this may look like a foreign language but

0C8A4BB0 6562 6120 2073 6165 7973 7420 206F 7375 eba  saeyst  osu
0C8A4BC0 2065 7361 6920 2073 6F70 7373 6269 656C  esai  sopssbiel
0C8A4BD0 202E 2A0A 2A6C 3470 6C2A 2020 5420 6568  .*.*l4pl*  T eh
0C8A4BE0 6E20 7865 2074 6566 2077 6170 6567 2073 n xe tef wapeg s
0C8A4BF0 7270 766F 6469 2065 2061 6C63 6165 2072 rpvodi e alcae r
0C8A4C00 6564 6373 6972 7470 6F69 206E 666F 6820 edcsirtpoi nfoh
0C8A4C10 776F 7420 206F 7375 2065 6874 2065 6F6D wot  osu eht eom
0C8A4C20 7375 2C65 7020 6369 206B 7075 6320 7261 su,ep ci kpuc ra
0C8A4C30 7364 6520 6374 202C 6E61 2064 6C61 6F73 sde ct ,na dlaos
0C8A4C40 6920 6C6C 7375 7274 7461 2065 730A 6D6F i llsurtta es.mo

Any clue to the order of this mangling?

This is probably why it can't find the root block.

00000190 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A ****************
000001A0 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A ****************
000001B0 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A ****************
000001C0 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A ****************
000001D0 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A ****************
000001E0 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A ****************
000001F0 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A 2A2A ****************
00000200 0001 4644 4342 0000 00E8 01FD 0000 300C ..FDCB........0.

Is that FDCB supposed to be RDSK?

Hrmmmm...

Thanks!


 

Offline mongo

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 964
    • Show only replies by mongo
Re: backing up amiga hard drives with linux dd
« Reply #9 on: February 01, 2009, 10:44:22 PM »
Quote

kamiga wrote:
Call me crazy, but the image dd has stored for the amiga drive is being corrupted in a very odd way.



The byte ordering is wrong. I think there is a way to swap them with dd.
 

Offline buzz

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 612
    • Show only replies by buzz
Re: backing up amiga hard drives with linux dd
« Reply #10 on: February 01, 2009, 11:59:49 PM »
Quote

I did create an image, and then try to mount the image using the "-o loop." And I get exactly the same no valid root block found error message.


you cant just mount it like that. if you read the link, you will see you have to get the offset into each partition. you can do that by using 'parted' on the image.

 

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: backing up amiga hard drives with linux dd
« Reply #11 on: February 02, 2009, 05:51:41 AM »
Quote

buzz wrote:
you cant just mount it like that. if you read the link, you will see you have to get the offset into each partition. you can do that by using 'parted' on the image.



Both GParted and parted both report the entire disk (and the image created from the disk) as being "unallocated 1.59gb" and a disk label type as unrecognized.  No partitions are recognized.
 

Offline Thomas

Re: backing up amiga hard drives with linux dd
« Reply #12 on: February 02, 2009, 07:51:23 AM »

Quote
the image dd has stored for the amiga drive is being corrupted in a very odd way.


I don't think it's correupted, you are just looking at it in a wrong way. Your hex dump shows words (16 bits, four digits, two bytes). But words are stored differently on a big-endian machine than on a little-endian one. You should make your viewer dump bytes instead. Then you should see that the bytes are in correct order.


Quote
This is probably why it can't find the root block.


Well, you said that you have two Amiga hard drives and this one is not bootable. Was this one connected to the same controller as the first (the bootable) one ?

And you talked about mount lists. Was this second hard drive perhaps mounted using the mount list ? Only the bootable harddrive needs an RDB (RDSK). If the second harddrive was mounted using a mountlist, the partition can start anywhere and the part before the partition can contain anything useless.

If this is the case, you need to find out where the partition starts and ends on the HDD.

You should really consider using an Amiga program to create the image files. Perhaps you can run WinUAE on your PC, either on WinXP or through Wine. Then you can use tsgui to create images that really work.

Bye,
Thomas

Offline buzz

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 612
    • Show only replies by buzz
Re: backing up amiga hard drives with linux dd
« Reply #13 on: February 02, 2009, 11:03:36 AM »
what version of parted? It does support amiga partition tables and I have used it in the past on an amiga image im sure.
 

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: backing up amiga hard drives with linux dd
« Reply #14 on: February 02, 2009, 05:46:43 PM »
Quote

buzz wrote:
what version of parted?


(0.3.8-1ubuntu2)

Distributed with Ubuntu Intrepid Ibex 8.10 live cd.