Recovering files from an Amiga hard drive

My Amiga 4000 died recently, and I wish I could recover the files from one of its hard disk drive (I’m not sure if the disk is damaged or not).

The HDD is a Quantum Viking 2.3 WSE (SCSI), it had 5 partitions formatted with FFS (Fast File System for Amiga).


Linux1:~ # fdisk -l

Disk /dev/sdb: 82.0 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000740a7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         901     7237251    b  W95 FAT32
/dev/sdb2             902        2860    15735667+  1c  Hidden W95 FAT32 (LBA)
/dev/sdb3            2861        3643     6289447+  83  Linux
/dev/sdb4   *        3644        9965    50780160    f  W95 Ext'd (LBA)
/dev/sdb5            3644        6172    20304896   83  Linux
/dev/sdb6            6172        9963    30457856   83  Linux

Disk /dev/sda: 2276 MB, 2276762112 bytes
71 heads, 62 sectors/track, 1010 cylinders
Units = cylinders of 4402 * 512 = 2253824 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sda doesn't contain a valid partition table

The “doesn’t contain a valid partition table” does not sound good.

Is it lost ?
Is there something else I can try ?

Hi there,

First off - good on ya for still having the old Amiga around. Nice.

As far as the drive goes, it does not look too good, I would expect it to see something for a partition table - but not being that familiar with how Amiga drives were partitioned, I am not really certain. I would see if you could research that a bit more.

Linux does support Amiga file systems, usually with a kernel module. You can find out if your kernel supports this with:


System:~ # cat /boot/config-`uname -r` | grep -i affs
CONFIG_AFFS_FS=m

(This is on the stock 11.3 desktop kernel by the way, you likely have the same.)

Next you may just need to load the kernel module with: modprobe affs (as root)

You can read more in:

/home/src/linux-2.6.34-12/Documentation/filesystems/affs.txt

See these pages for more info:

Access an Amiga-harddrive under linux on a non-Amiga box - Yüksel

Amiga Forever - Migration Tips

Cheers,
Lews Therin

You 2 bring back old memories when I had my Amiga 2000, all the games and things you could do that IBM at that time wanted to do and MS was still a shell. But I have seen that they are still around kicking mostly in sound and some in video worlds.

Till last December. Then my A4000 died.

Yep, same here. And:


Linux1:~ # modinfo affs
filename:       /lib/modules/2.6.34.7-0.7-default/kernel/fs/affs/affs.ko
license:        GPL
description:    Amiga filesystem support for Linux
srcversion:     F7CC8EAAB523A5566DDB101
depends:        
vermagic:       2.6.34.7-0.7-default SMP mod_unload modversions 586TSC

So the Amiga FFS is available. But from the first link you posted, I read:

First of all you need a kernel with the “affs”-filesystem and “Amiga partition table support”.

How can I check that “Amiga partition table support” and enable it ?
This sound the cause of the “Disk /dev/sda doesn’t contain a valid partition table” I have with fdisk.

Tried that, but no changes.

Thanks for your help.

There is STILL some life around the Amiga. :wink:
Check for example:
The Natami project
The AmigaOne X1000

That’s a good catch, I did not read it carefully enough. You are correct, in addition to the affs module, you also need to have “Amiga Partition Table Support” enabled in the kernel too. Unfortunately, this does not look like it can be compiled as a module - which means you would have to compile the whole kernel. After that, there still may be a bit more work to do.

To find out if Amiga Partition Table support is in your kernel you could look for it like:

me@mine:~/> grep -i Amiga /boot/config-2.6.34.7-0.5-desktop 
# CONFIG_AMIGA_PARTITION is not set

Another alternative is to be able to ignore the partition table, setup a loopback driver with the right offset, and mount the drive directly, as mentioned in the post: Linux mounting hdd - English Amiga Board However, that is also going to be tricky, and I’ve not idea what the proper offset would be. Perhaps someone else here could help with this route.

If you are interested, my suggestion would be to go ahead and compile a kernel with the partition table support and see where that gets you. You will need to install the kernel-source package, and then goto the source directory (for example /usr/src/linux-2.6.34.7-0.5 ) and enter: make menuconfig or make xconfig for the gui version. Search for “Amiga” and enable it - this is easier to find and do using the GUI version.

Then proceed with building and installing the kernel. Of course this is a very, very rough outline, but there are some great hows-tos with step by step details on this process, such as: How To Compile A Kernel - The SuSE Way | HowtoForge - Linux Howtos and Tutorials

Your goal of mounting this drive is a bit of an ambitious project, so don’t get discouraged if you run into some trouble or it takes a bit of doing - this is not really a simple undertaking. But if you want to continue, you will certainly learn a lot in the process.

Cheers,
Lews Therin

Indeed:

Linux1:~ # grep -i Amiga /boot/config-2.6.34.7-0.7-default
# CONFIG_AMIGA_PARTITION is not set

I’m not at ease at all with that.
Maybe I’ll fill a report in bugzilla (because even if Amiga Fast File System is supported by the kernel, real Amiga HDD can’t be access); and hopefully, this will be fixed with the next kernel update…

I made a disk image of the Amiga HDD. I will try to access it from an Amiga emulator.

BTW, the image created with dd went fine, no errors showing, and the entire disk seems to have been duplicated.
Can I be confident that this is a good sign that the HDD is not physically damaged (and the file rescue is a matter of software tweaking) ?

It’s an okay sign, in that “no news is good news”, however it could also just mean “garbage in, garbage out” - - honestly, its hard to say. Provided there is no physical damage, bad sectors, etc, it likely did in fact work okay, and it is good that you did it. If you ran dd on the entire block device, you should be able to dd it back or mount the image later, etc.

As for filing the bug report, it’s not really so much a bug, as it just means that this particular option is not enabled in the Suse Desktop kernel. It is available to be enabled, but by default it is not. There are a great many optional things which can be turned in in the Linux kernel, some very cool, and very esoteric, things. This is just one such example.

If you feel up to it, you could give compiling the kernel a go - one excellent way to do this is to create a virtual machine using VirtualBox - then you do all the compiling and such in there, and if you mess it up completely, who cares - no harm done. But to do this, you will need at least 20 GB free for the kernel compiling process, so if you make a VM, make sure you give it a liberal amount of space - 8GB won’t cut it. Especially if you want to build the kernel as an installable RPM, you need plenty of room.

If you want to try compiling the kernel like this, I am sure you will find ample help here on the boards as you run in to issues. And if you are doing it in a VM, you won’t mess up your system, so there is that layer of protection.

Cheers,
Lews Therin

I filled a report anyway, but as a feature request.
See: Bug 666265 - Kernel support for Amiga hard disk drive

Trying to compile a kernel myself will be the last thing I will try, but I cannot use a VM as I don’t have enough disk space left anymore.

Thanks for your help.

You may want to try this liveCD Parted Magic I asked the question of affs support here

Disk /dev/sda doesn't contain a valid partition table

I must admit, this does not look at all promising.

I don’t have a CD burner, and I don’t have enough room anymore to create a HD partition and copy the iso content to it (like I do with the openSUSE install DVD).
Anyway, that’s an interesting info that might help in another thread (on another forum). Thanks.

I found a tutorial which looks easy:
OpenSUSE 11.2 - How to compile a Kernel for Newbies
I think I’m going to try this…

It failed.

The “make rpm” stage took around 10 hours. I watched what happened for the 1st hour, and saw many warning messages. Scarring…
It finally ended with a lot of “WARNING: … cannot allocate memory” and a fatal error.

Here are the last output lines:


WARNING: Can't read module /usr/src/packages/BUILDROOT/kernel-2.6.34.70.7amiga-1.i386/lib/modules/2.6.34.7-0.7-amiga/kernel/sound/pcmcia/pdaudiocf/snd-pdaudiocf.ko: Cannot allocate memory
WARNING: /usr/src/packages/BUILDROOT/kernel-2.6.34.70.7amiga-1.i386/lib/modules/2.6.34.7-0.7-amiga/kernel/drivers/mfd/ucb1400_core.ko needs unknown symbol ac97_bus_type
WARNING: /usr/src/packages/BUILDROOT/kernel-2.6.34.70.7amiga-1.i386/lib/modules/2.6.34.7-0.7-amiga/kernel/drivers/input/touchscreen/wm97xx-ts.ko needs unknown symbol ac97_bus_type
FATAL: Memory allocation failure ../elfops_core.c line 264: strtbl_add(weak ? weak_sym : undef_sym, *types).
make[2]: *** [_modinst_post] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.ZKvMiW (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.ZKvMiW (%install)
make[1]: *** [rpm] Error 1
make: *** [rpm] Error 2

What can I do now ?
Cleanup and start again ?

On 01/24/2011 01:06 PM, AmigaPhil wrote:
>
> AmigaPhil;2281433 Wrote:
>> I found a tutorial which looks easy:
>> ‘OpenSUSE 11.2 - How to compile a Kernel for Newbies’
>> (http://tinyurl.com/y6jd5zy)
>> I think I’m going to try this…
>
> It failed.
>
> The “make rpm” stage took around 10 hours. I watched what happened for
> the 1st hour, and saw many warning messages. Scarring…
> It finally ended with a lot of “WARNING: … cannot allocate memory”
> and a fatal error.
>
> Here are the last output lines:
>
> Code:
> --------------------
>
> WARNING: Can’t read module /usr/src/packages/BUILDROOT/kernel-2.6.34.70.7amiga-1.i386/lib/modules/2.6.34.7-0.7-amiga/kernel/sound/pcmcia/pdaudiocf/snd-pdaudiocf.ko: Cannot allocate memory
> WARNING: /usr/src/packages/BUILDROOT/kernel-2.6.34.70.7amiga-1.i386/lib/modules/2.6.34.7-0.7-amiga/kernel/drivers/mfd/ucb1400_core.ko needs unknown symbol ac97_bus_type
> WARNING: /usr/src/packages/BUILDROOT/kernel-2.6.34.70.7amiga-1.i386/lib/modules/2.6.34.7-0.7-amiga/kernel/drivers/input/touchscreen/wm97xx-ts.ko needs unknown symbol ac97_bus_type
> FATAL: Memory allocation failure …/elfops_core.c line 264: strtbl_add(weak ? weak_sym : undef_sym, *types).
> make[2]: *** [_modinst_post] Error 1
> error: Bad exit status from /var/tmp/rpm-tmp.ZKvMiW (%install)
>
>
> RPM build errors:
> Bad exit status from /var/tmp/rpm-tmp.ZKvMiW (%install)
> make[1]: *** [rpm] Error 1
> make: *** [rpm] Error 2
>
> --------------------
>
>
> What can I do now ?
> Cleanup and start again ?

DO NOT DO THE RPM STEP. What you should do (as a regular user) is the following:


make -j2
sudo make modules_install install

When these steps finish, you will have the new version as extra entries in the
GRUB menu. Besides no need to actually build the rpm, you will still have your
original kernel as a fallback in case something went wrong.

If you have multiple CPUs, increase that 2 in the make step to one more than the
number of CPUs. That change greatly reduces the kernel build time.

I’m confused as to where to start now.

  1. As the kernel sources are the same version of the kernel currently in use, with the only change in the config is to enable the “amiga partition table support”, I believe that what I only need is a new vmlinuz kernel image (?)
    Is there a way to create it without compiling and installing each and every modules ?

  2. Should I better clean-up all the stuf created by the previous failed compilation ?


make mrproper
make cloneconfig
make menuconfig

THEN use the code you suggested ? (can I omit the “modules_install” ?)
So, still as root:


make -j2
make install

?

On 01/24/2011 03:06 PM, AmigaPhil wrote:
>
> lwfinger;2281857 Wrote:
>> DO NOT DO THE RPM STEP. What you should do (as a regular user) is the
>> following:
>>
>>>
> Code:
> --------------------
> > >
> > make -j2
> > sudo make modules_install install
> >
> --------------------
>>>
>>
>> When these steps finish, you will have the new version as extra
>> entries in the
>> GRUB menu. Besides no need to actually build the rpm, you will still
>> have your
>> original kernel as a fallback in case something went wrong.
>>
>> If you have multiple CPUs, increase that 2 in the make step to one
>> more than the
>> number of CPUs. That change greatly reduces the kernel build time.
>
> I’m confused as to where to start now.
>
> 1) As the kernel sources are the same version of the kernel currently
> in use, with the only change in the config is to enable the “amiga
> partition table support”, I -believe- that what I only need is a new
> vmlinuz kernel image (?)
> Is there a way to create it without compiling and installing each and
> every modules ?

Only if you want the boot to fail! The kernel and modules must be compiled and
linked with exactly the same configuration file (and a lot of other things).

> 2) Should I better clean-up all the stuf created by the previous failed
> compilation ?
>
> Code:
> --------------------
>
> make mrproper
> make cloneconfig
> make menuconfig

Do not bother. All that will do is throw away ALL the work you have already done.

> --------------------
>
>
> THEN use the code you suggested ? (can I omit the “modules_install” ?)
> So, still as root:
>
> Code:
> --------------------
>
> make -j2
> make install

No. You still need that part. It is quick anyway.

Hey there,

I see you decided to jump in and try building the kernel - good on ya’. Looks like you are heading in the right direction here, and the instructions should get you there. For what it’s worth, I usually prefer to do a make rpm - it take longer, but you end up with an .rpm containing the kernel and modules you can just install - and it is easier to keep around in case you ever need it again. But really, it’s not a big deal. If you do make followed by make modules_install install that will get you there too - it’s all good.

Cheers,
LewsTherin

The “make -j2” seems to went fine.
But the “make modules_install install” immediately gave me this error:


Linux1:/usr/src/linux # make modules_install install
cp: cannot stat `/usr/src/linux-2.6.34.7-0.7/modules.builtin': No such file or directory
make: *** [_modinst_] Error 1

On 01/24/2011 07:36 PM, AmigaPhil wrote:
>
> The “make -j2” seems to went fine.
> But the “make modules_install install” immediately gave me this error:
>
> Code:
> --------------------
>
> Linux1:/usr/src/linux # make modules_install install
> cp: cannot stat `/usr/src/linux-2.6.34.7-0.7/modules.builtin’: No such file or directory

make: *** [modinst] Error 1


It appears that you were logged in as root when you built the kernel. The kernel
developers strongly recommend against that. What you need to do is be logged in
as your normal user, change directory to /usr/src/linux-2.6.34.7-0.7, and issue
the command


chmod -R <name>:users 2.6.34.7-0.7

where <name> is your login name - the output of the whoami command. I don’t know
what might happen these days, but a few years ago, a bug in the kernel build
script destroyed /dev/null if you were logged in as root, and rendered the
systems unbootable.

After you have changed the ownership of the files, change back to the source
directory and redo the ‘make -j2’. If the install step still fails, then ‘make
clean’ and start the ‘make -j2’ again.

Didn’t you mean chown ? :slight_smile:
Also, to be able to change the ownership of files own by root, I must be root.
So the right way to do this would be:


su -
cd /usr/src
chown -R amigaphil:users linux-2.6.34.7-0.7

If I do that, shouldn’t I also change the ownership of the other files ?


Linux1:~ # dir /usr/src
total 12
lrwxrwxrwx  1 root root   18 Jan 25 20:10 linux -> linux-2.6.34.7-0.7
drwxr-xr-x 24 root root 4096 Jan 25 20:22 linux-2.6.34.7-0.7
drwxr-xr-x  3 root root 4096 Jan 25 20:12 linux-2.6.34.7-0.7-obj
drwxr-xr-x  3 root root 4096 Jan 25 20:12 linux-obj

All in all, are you sure I should better change the ownership of every file and try to compile as user ?

  1. The error I had:

Linux1:/usr/src/linux # make modules_install install
cp: cannot stat `/usr/src/linux-2.6.34.7-0.7/modules.builtin': No such file or directory
make: *** [_modinst_] Error 1

appeared while I was root, so it not a question of not having the right priviledge (the “modules.builtin” file was really missing).

  1. The examples I found on the web all show commands issued as root.

Well, I have cleaned everything and re-installed the kernel sources completely (with Yast), and re-created the config file (“make cloneconfig” and “make menuconfig”).
I would like to hear any further advices before I try the “make” (or “make -j2”) step again.

I found a hint in the README.SUSE :

(2) Create a build directory for use in configuring and building
the kernel. Using /usr/src/linux directly requires root priviledges
and will cause problems if you need to build kernel modules for
other installed kernels.

and in the README :

BUILD directory for the kernel:

When compiling the kernel all output files will per default be
stored together with the kernel source code.
Using the option “make O=output/dir” allow you to specify an alternate
place for the output files (including .config).
Example:
kernel source code: /usr/src/linux-2.6.N
build directory: /home/name/build/kernel

To configure and build the kernel use:
cd /usr/src/linux-2.6.N
make O=/home/name/build/kernel menuconfig
make O=/home/name/build/kernel
sudo make O=/home/name/build/kernel modules_install install

Please note: If the ‘O=output/dir’ option is used then it must be
used for all invocations of make.

So in my case, I could try (as user) :


mkdir ~/build
mkdir ~/build/kernel
cd /usr/src/linux
make O=/home/amigaphil/build/kernel cloneconfig
make O=/home/amigaphil/build/kernel menuconfig
make O=/home/amigaphil/build/kernel
sudo make O=/home/amigaphil/build/kernel modules_install install

What do you think ? Can I try this ?