disk

Cloning HD

(also works on bootable System disks and non linux disks )

start ubuntu live cd
using firefox go to : http://www.howtogeek.com/howto/19141/clone-a-hard-drive-using-an-ubuntu-live-cd/
follow instructions:
sudo fdisk -l
to establish names of source and target drives or partitions - then

example
sudo dd if=/dev/sda of=/dev/sdb bs=32M


will clone drive /dev/sda, to drive /dev/sdb
where bs="xx" is optional, block size, default is 512B but 32M is much faster for large drives

remove ubuntu cd, and shutdown
IMPORTANT !! - with System disks disconnect source HD before rebooting target HD otherwise cloned system will NOT! boot


Partitions

use Gparted from ubuntu CD to edit partition table


nb. to edit mounted partitions you must first :-
     sudo umount -a
     sudo swapoff
then go to Gparted


auto mounting Ubuntu partitions at startup
(may be ??? also applicable to Macs - because Unix based)

edit filesystem table file
gksu gedit /etc/fstab
directly (preferred), or use  MountManager

related links:-

fstab tutorial   https://help.ubuntu.com/community/Fstab
dd command   http://en.wikipedia.org/wiki/Dd_(Unix)                        
                        http://how-to.linuxcareer.com/learning-linux-commands-dd

data recovery

partition table recovery
use testdisk (partition scanner and disk recovery tool)
sudo apt-get install testdisk
sudo testdisk


files recovery
use photorec , which is part of testdisk package
sudo photorec < eg /dev/sda1>