You’ll need to boot from a live cd. Add partitions for them to disk 1, copy all the contents over (with rsync
, see rsync clone partition
), and then use sudo blkid
to get the UUID of each partition. On disk 1’s new /
, edit the /etc/fstab
to use the new UUIDs you just looked up.
Updating GRUB depends on whether it’s GRUB1 or GRUB2. If GRUB1, you need to edit /boot/grub/device.map
If GRUB2, I think you need to mount your partitions as they would be in a real situation. For example:
sudo mkdir /media/root
sudo mount /dev/sda1 /media/root
(Filling in whatever the actual partitions are that you copied things to, of course)
Then bind mount /proc
and /dev
in the /media/root
:
sudo mount -B /proc /media/root/proc
sudo mount -B /dev /media/root/dev
sudo mount -B /sys /media/root/sys
Now chroot into the drive so you can force GRUB to update itself according to the new layout:
sudo chroot /media/root
sudo update-grub
Then boot into the new grub entry, and when the system has boot, the
update-grub
will update and set the first entry for the actual /dev/sda1
system