Well, you will probably ask - whats the potential problem ? Yes, no problem if there are only Amiga partitions on source drive, but what if there are also Linux and Mac partitions?In this case you will probably experience problems how to transfer this partitions. I found the solution.
First of all, create partitions on new drive using Amiga HD toolbox to make the RDB partition table structure and decide what partitions will be used for Linux and/or Mac.
Remember - you have to reserve two partitions for Linux - one main (root) partition and other swap partition.
Now write down root partition names - source and destination e.g. /dev/sda5 - source and /dev/sdb8 - destination. Swap partitions are not need to be copied( but you can try to avoid swap service problems). Destination partition should have size >= then source.
So we have necessary information to start copy:
- if (input file): /dev/sda5
- of (output file): /dev/sdb8
So you need to open Terminal windows and type:
sudo dd if=/dev/sda5 of=/dev/sdb8
Next, if you source and destination partitions are NOT exactly the same size you will need to make corrections on filesystem on the destination drive to suit new size of the partition. So do the command in Terminal:
sudo resize2fs /dev/sdb8
Again, use yours destination name instead ! Now, we have our partition copied, but we have to make changes in /etc/fstab file on new drive to be able to boot from this partition. Since it have a new name, without changes in fstab it will not boot correctly.
Mount your new Linux partition (you may do this directly from Gparted or Ubuntu disk utility or command line) and open it in file explorer. We need to edit fstab file.
su gedit /etc/fstab
(Superuser permission is needed to be able to save changes)
Find and replace /dev/sda5 to /dev/sda8 (in my example of course) - usually it is the first line.
Please, notice, I use sda8 NOT sdb8 because when you boot this partition on Amiga it will be the first hard drive - sda! sdb is for CD-ROM drive. Save changes, turn off PC and put your drives back to Amiga.
If you partition numbers are the same e.g. sda8 and sdb8 (since on Amiga you used to have only one hard disk there are will be only /dev/sda partitions) in this case no changes needed in fstab.
Boot Amiga OS from source drive and start HDtoolbox again. Check that now your new drive have Linux partitions ! But they are not bootable yet.
Macintosh partitions - if you have those - are easy to clone under Mac emulation. When you starting Fusion or ShapeShifter from original drive , add partition from new drive as well. Mac will let you format it and then copy files from old partition to new using Mac files copy.
After all - when you will have only new drive connected and successful boot, start
HDtoolbox to check the linux partition name - it should be the same as you set in fstab !
I did that to transfer files from my old ATA HD to CF card and everything work fine!
There are many cloning software that able to clone Linux drives, but most of the do not understand RDB partition table that is used by Amiga OS, that's why I made this tutorial.
If you would like to make an image file of your partition (to be able to restore from it lately instead of transferring once again ) I suggest you to use PartImage software. It has a nice bootable CD, its free and you will easily made all steps described above using only partimage CD !
P.S. I`m not sure but sometimes you may notice warning about SWAPON while booting Linux.
I saw this in several cases but don't know how to fix swapping on new drive so any help will be appreciated ! )