Page 1 of 1

[SOLVED] move installation to new harddrive

PostPosted: Mar 8th, '14, 20:18
by madeye
I'm trying to move an installation to a new harddrive.
For this purpose I used rsync to copy the files to the new harddrive. (preserving the permissions). Afterwards I used the rescue system to install the bootloader on the new disk, and chroot to it to generate a new initrd.
However on reboot it keeps telling me that the harddrive cannot be found. It still references the old UUIDs?

What am I missing? I used to do this all the time in arch linux, and never ran into this kind of trouble? :cry:

It's a mageia 4 system if that should make a diffierence.

EDIT:
OK. Now I got it running again. I removed just about anything I could from the grub menu.list, and changed the root uuid. Now it boots! I just hope that I haven't crippled anything in the process.

Re: [SOLVED] move installation to new harddrive

PostPosted: Mar 9th, '14, 09:59
by winstonteacox
Hi Madeye,

I had this problem two months ago. I used another method, where you do not need to fiddle around with UUIDS, bootloader and initrd, but which needs a little more time instead ...

First I cloned the partitions with Clonezilla from the old HD to the new one. So the new HD is now exactly the same as the old one, including the UUIDS. But because of the new HD mostly has much more space, there is a need to resize and move whole partitions. This is now easily done with Gparted, but the resizing and moving of the partitions needs about the same time as the cloning before ... So I have no fiddling around, but I need about two times as long ...

Btw. Maybe you missed to change /etc/fstab, where each partition is defined by its UUID, instead by for example /dev/sda1 like in former times ...

:)
cheers,
Bernd

Re: [SOLVED] move installation to new harddrive

PostPosted: Mar 9th, '14, 11:05
by madeye
Using clonezilla would also have been an option, however I have had problems in the past with resizing the partitions afterwards. But I guess that it's been so long ago that this has been fixed in current versions.
Nevertheless, as I also moved to a GPT based partition table, it would probably not have worked with clonezilla.

I did remember to change the UUIDs in /etc/fstab, but I did not think it was necessary to change manually in grub/menu.lst as well. I sort of thought that dracut would take care of that part.
In the meantime I also found that the swap partition UUID is located in /etc/dracut.conf.d/51-mageia-resume.conf, so I've changed that as well. Not that I've ever used suspend/resume on my PCs.

Re: [SOLVED] move installation to new harddrive

PostPosted: Mar 9th, '14, 12:54
by jiml8
You also could have used tune2fs to change the UUID on the new HD to be what it was on the old HD. Or - and this is how I have taken to doing it - mount your partitions by label and use tune2fs to set the labels. This lets you provide a device ID that you can remember, and it is easy to have it remain the same when you replace the device.

Re: [SOLVED] move installation to new harddrive

PostPosted: Mar 9th, '14, 17:17
by madeye
It's true that the UUID can be changed for ext file systems. However on the swap partion you cannot change the UUID with tune2fs. But it could have been done by using
Code: Select all
mkswap -U <uuid> /dev/sdXy


There are different ways of solving it when you think about it. But when you're stuck you sometimes overlook things. I have also taken to use labels instead. That way I am in control. ;)