LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Moving hard drive with install intact (http://www.linuxquestions.org/questions/linux-software-2/moving-hard-drive-with-install-intact-672782/)

Q.. 09-27-2008 03:12 PM

Moving hard drive with install intact
 
I'm trying to move a hard drive from one PC to another so I can retain the install without having to do it over. It's not working on the new machine, it gives an error about not being able to move root.

The two machines are different architecture, but I even compiled a new kernel on the old PC to the spec of the new one but it didn't matter. I don't remember the exact errors but something about not finding resume device, so maybe the partitions are not being detected. Isn't that strange? Same exact hard drive, no other hard drives set up. Why wouldn't it detect it as it is? The root param in grub is set up to the label, so it shouldn't matter. Does mkinitrd use the partition UUID or something like that? Even if it did, is that going to change on a new PC on the same hard drive? I don't know but I'm doubting it. What could be causing this?

jailbait 09-27-2008 03:37 PM

Quote:

Originally Posted by Q.. (Post 3293657)

Does mkinitrd use the partition UUID or something like that? Even if it did, is that going to change on a new PC on the same hard drive?

The initrd is different for different hardware. it is not unusual for an initrd not to work when transferred to different hardware. You may need to use the mkinitrd command to create an initrd which will work on the second computer.

http://www.ibm.com/developerworks/li.../l-initrd.html

-----------------------
Steve Stites

Q.. 09-27-2008 08:09 PM

Thanks, but that link doesn't really explain how to do that. I tried setting ARCH=i686, nothing. Nothing in the man about it either.

Q.. 09-28-2008 10:40 PM

Oh well, I got it. These are the basic steps I found to work with Fedora:

Set up the old drive on the new PC, of course. Boot up another install on it, live media or otherwise. It must be new enough in relation to the install to be recovered, so for example, no 2.4 for recovering Fedora. I had an unused partition so I installed an old version of Fedora on it, same version being recovered.

Once up and running, mount the partition to be recovered to /mnt for example, full read and write

cd /mnt

mount -t proc proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys

chroot /mnt /bin/bash

mkinitrd -f /boot/initrd-[kernel-version-applicable].img [kernel-version-applicable]


All times are GMT -5. The time now is 12:20 AM.