Author |
Message |
|
Post subject: Cloning partition problem - wrong root
Posted: Feb 20, 2007 - 08:07 PM
|
|
Joined: Feb 20, 2007
Posts: 4
|
|
Hi,
I'm trying to clone my current RC4 partition. I have tried a number of methods (pcopy, tar, cp -ax, etc), but all of them are not giving me the wrong root.
The current one is on /dev/hda7, and I am trying to clone it to /dev/hda6. I copied all the info using one of the above methods, then I modified etc/fstab on hda6 to mount hda6 as root. I also modified grub's menu.lst so that it has hda6 (with root=/dev/hda6 to the kernel option).
After rebooting, I select the one for hda6 (use the 'e' command to make sure I have the correct root specified, i.e., /dev/hda6) and then boot. However, after booting up, it still shows hda7 as my root. I checked /var/log/messages, and it showed the line:
Feb 20 00:13:37 mycomputer kernel: Kernel command line: root=/dev/hda6 ro quiet vga=791
so, it did see that I did specify hda6 as my root. However, when I checked with df or mount, it showed hda7 as my root.
Does anyone know what I have done wrong? Is the root hardcoded somewhere?
Thanks |
|
|
|
|
 |
|
Post subject:
Posted: Feb 20, 2007 - 09:23 PM
|
|
Joined: Dec 17, 2003
Posts: 16809
|
|
a) menu.lst has to be correct -> kopt, groot, then run update-grub
b) DELETE /boot/initrd.* before running update-grub as long as no initramfs was used to create (usally it was yaird) |
|
|
|
|
 |
|
Post subject:
Posted: Feb 20, 2007 - 10:33 PM
|
|
Joined: Feb 20, 2007
Posts: 4
|
|
Kano wrote:
a) menu.lst has to be correct -> kopt, groot, then run update-grub
b) DELETE /boot/initrd.* before running update-grub as long as no initramfs was used to create (usally it was yaird)
Thanks Kano for replying.
I already have the following lines in menu.lst:
title Debian hda7, kernel 2.6.18-kanotix-1
root (hd0,6)
kernel /boot/vmlinuz-2.6.18-kanotix-1 root=/dev/hda7 ro quiet vga=791
initrd /boot/initrd.img-2.6.18-kanotix-1
boot
title Debian hda6, kernel 2.6.18-kanotix-1
root (hd0,5)
kernel /boot/vmlinuz-2.6.18-kanotix-1 root=/dev/hda6 ro quiet vga=791
initrd /boot/initrd.img-2.6.18-kanotix-1
boot
The problem is when I select the second one, it still loads up hda7 as my root. So, I'm not sure if it is menu.lst that is causing the problem. Right now, my menu.lst does not use kopt or groot, since I set the options explicitly in each kernel line.
Thanks. |
|
|
|
|
 |
|
Post subject:
Posted: Feb 20, 2007 - 11:03 PM
|
|
Joined: Dec 17, 2003
Posts: 16809
|
|
You did not do what I told you. You can use chroot to do so, you may NOT use initrds for those kernels. |
|
|
|
|
 |
|
Post subject:
Posted: Feb 21, 2007 - 06:55 PM
|
|
Joined: Feb 20, 2007
Posts: 4
|
|
Kano,
Sorry, I was trying to understand the issue before I try it. Anyway, thanks a lot. It now works. I can boot up into hda6 as my root.
I examined the menu.lst before and after, and it seems that the only difference is the removal of the initrd line in menu.lst. Is that correct? If that is case, does that mean that initrd hardcoded the root partition in it?
Thanks a lot. |
|
|
|
|
 |
|
Post subject:
Posted: Feb 21, 2007 - 07:23 PM
|
|
Joined: Dec 17, 2003
Posts: 16809
|
|
best rename menu.lst after successful boot and run
update-grub
to recreate it. you can add chainloader entries and gfxmenu from original file later. the rest should be standard - my fix-grub script needs a fully correct menu.lst, handchanged versions of amateurs do usually not work. |
|
|
|
|
 |
|
Post subject:
Posted: Feb 22, 2007 - 07:06 AM
|
|
Joined: Feb 20, 2007
Posts: 4
|
|
Thank you very much for your help. |
|
|
|
|
 |
|