Migrate from IDE to SATA

Felipe Alfaro Solana felipe.alfaro at gmail.com
Tue Oct 17 03:13:04 UTC 2006


On 10/16/06, Amit Prahesh <amit.prahesh at gmail.com> wrote:
> Hello,
>
> my machine always had a 40G PATA hard disk unto which I installed Kubuntu
> 6.06, taking all the disk (one little ext3 partition for /boot, the swap
> partition, and the rest of the disk is an XFS partition for /).
>
> Now, I have a new 80G SATA disk that I'd like to use as the system disk (of
> course, the motherboard has support).
>
> What's the easiest way to transfer everything from the IDE disk to the SATA
> (while keeping everything)?

I will assume you want three partitions on your SATA disk, and I
assume your SATA disk is recognized as /dev/sda by the kernel:

/dev/sda1 -> /boot
/dev/sda2 -> swap
/dev/sda3 -> /

Also, I will assume all of your filesystems, the ones you want to move
to the new disk, are mounted under /media/DISK.

1. Plug your new SATA disk.
2. Boot from the LiveCD in rescue/fix mode
3. Open a terminal
4. Run parted, gparted, fdisk or whatever partitioning software you like
5. Partition you SATA disk
6. mkfs.ext3 /dev/sda1
7. mkfs.ext3 /dev/sda3
8. mkswap /dev/sda2
9. mkdir /a
10. mount /dev/sda3 /a
11. mkdir /a/boot
12. mount /dev/sda1 /a/boot
13. rsync -av --progress /media/DISK/* /a
14. Wait :-)
15. chroot /a /bin/bash
16. grub
17. root (hdX,0)
18. setup (hdX), where (hdX,0) is the GRUB name for /dev/sda1 (which
will probably be something like (hd0,0) or (hd1,0).
19. exit (from GRUB)
20. Fix references to your old disks in /etc/fstab and /boot/grub/grub.conf
21. exit (from chroot)
22. umount /a/boot
23. umount /a
24. reboot
25. Pray :-)

The trick part is from 17 up to 18, since I don't know exactly the
boot order of your devices (IDE first BIOS:0x80, then SATA BIOS:0x81,
or the other way around). Since GRUB is BIOS-dependant, it is very
sensitive to changes in the order of the boot devices. You can guess,
or you can use GRUB to identify for you the GRUB name of a Linux
device. I don't have access to a GRUB system right now, so I can't
recall the exact name of the command, but you can use GRUB
command-line help.




More information about the ubuntu-users mailing list