[SOLVED] move installation to new harddrive

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] move installation to new harddrive

Postby madeye » Mar 8th, '14, 20:18

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.
- Madeye

When I supply commands in an answer, please make sure you understand them before you run them! Use google or man to check!
User avatar
madeye
 
Posts: 110
Joined: Jul 23rd, '11, 12:36
Location: Aabenraa, Denmark

Re: [SOLVED] move installation to new harddrive

Postby winstonteacox » Mar 9th, '14, 09:59

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
Now after my words of profound wisdom, I'm going back to procrastinating.
User avatar
winstonteacox
 
Posts: 139
Joined: Mar 30th, '11, 16:05
Location: Straubing Germany

Re: [SOLVED] move installation to new harddrive

Postby madeye » Mar 9th, '14, 11:05

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.
- Madeye

When I supply commands in an answer, please make sure you understand them before you run them! Use google or man to check!
User avatar
madeye
 
Posts: 110
Joined: Jul 23rd, '11, 12:36
Location: Aabenraa, Denmark

Re: [SOLVED] move installation to new harddrive

Postby jiml8 » Mar 9th, '14, 12:54

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.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: [SOLVED] move installation to new harddrive

Postby madeye » Mar 9th, '14, 17:17

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. ;)
- Madeye

When I supply commands in an answer, please make sure you understand them before you run them! Use google or man to check!
User avatar
madeye
 
Posts: 110
Joined: Jul 23rd, '11, 12:36
Location: Aabenraa, Denmark


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest