This is a guide on one of the easiest ways of moving one *nix install to one disk from another, or, if you can move one of the disks, from computer to computer.


1. Connect both drives to ONE computer. Then boot off a live disk/usb with a live OS compatible with the filesystems on your current install(s). If you have a mixed *BSD/Solaris and Linux system, you may have to use two live OSes for either one, I would say PC-BSD for UFS/UFS2 and ZFS, any Linux live disk for Ext{1,2,3,4}/BtrFS/XFS/etc.


2. Install (if not already there) GParted on the live OS and launch it.


3. On the old disk, copy a partition. as shown:




4. Then use the menu in the top right to change disks to your new disks. Paste the partition there, by right clicking on the empty drive.


5. Repeat 4. until all partitions are copied. you can ignore copying efisys and bios_boot partitions if you use GPT, but remember to create a new one on the new disk if you plan on being able to boot from it. For for organization sake I suggest doing this from beginning onwards.


6. Now, all of your data is over, but grub hasn't been installed to the MBR/efisys/bios_boot. so, chroot time. NOTE= these next steps can also be used to recover an over written grub bootloader , minis the fstab step.


first you will need to mount all of your partitions, again not including efisys/biosboot. Become root and then start with /
Code:
Code:
[CODE]su -
[/CODE]
Code:
Code:
[CODE]mount /dev/sdXx /mnt
[/CODE]


replace the Xx with the number of the disk and the number of the partition. both of these should be listed in GParted.


Then, mount any other partitions
Code:
Code:
[CODE]mount /dev/sdXx /mnt/{home, boot, etc.}
[/CODE]


after this change to that directory
Code:
Code:
[CODE]cd /mnt
[/CODE]


then run these commands, one line at a time.
Code:
Code:
[CODE]mount -t proc proc proc/
mount -t sysfs sys sys/
mount -o bind /dev dev/
mount -t devpts pts dev/pts/
[/CODE]


Now to move back into your install,
Code:
Code:
[CODE]chroot . /bin/bash
[/CODE]


7. Update your fstab.

*in the chroot*
Code:
Code:
[CODE]nano /etc/fstab
[/CODE]


now, in a different terminal of the live OS run this:
Code:
Code:
[CODE]ls -lF /dev/disk/by-uuid/
[/CODE]


now, write the UUIDs of the new disks partitions into your fstab inside the chroot. alternately, you could run nano /mnt/etc/fstab and edit them from there, both should work. make sure to use the correct partition UUIDs for the right mount points, it's quite impossible to mount your home partition as root.



8. Now inside the chroot do the actual installing of grub.
Code:
Code:
[CODE]grub-install /dev/sdX
[/CODE]


again, replace X with the drive number. HOWEVER, I highly suggest not putting a partition number as this requires a different way of booting that is harder to setup and not recommended, called blocklisting.


now, last step:
Code:
Code:
[CODE]update-grub
[/CODE]


9. reboot, make sure bios is pointed at the right drive and enjoy!


POSSIBLE PROBLEMS: The only one I ran into was that everything in /home was owned by root, a simple change running any file manager as root. Also, in some OSes grub is called on by grub2, so update-grub would be update-grub2 etc. ran into that with F17. If anyone notices any problems with this please post.