Sep 14, 2025 - 02:44 PMDeutsch | English
Hello unlogged user [ Register | Log in ]

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
amac
Post subject: Cloning partition problem - wrong root  PostPosted: 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
 
 View user's profile Send private message  
Reply with quote Back to top
Kano
Post subject:   PostPosted: 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)
 
 View user's profile Send private message  
Reply with quote Back to top
amac
Post subject:   PostPosted: 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.
 
 View user's profile Send private message  
Reply with quote Back to top
Kano
Post subject:   PostPosted: 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.
 
 View user's profile Send private message  
Reply with quote Back to top
amac
Post subject:   PostPosted: 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.
 
 View user's profile Send private message  
Reply with quote Back to top
Kano
Post subject:   PostPosted: 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.
 
 View user's profile Send private message  
Reply with quote Back to top
amac
Post subject:   PostPosted: Feb 22, 2007 - 07:06 AM



Joined: Feb 20, 2007
Posts: 4

Thank you very much for your help.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
 
Deutsch | English
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2004 - 2006 by Jörg Schirottke (Kano).
Consult Impressum and Legal Terms for details. Kanotix is Free Software released under the GNU/GPL license.
This CMS is powered by PostNuke, all themes used at this site are released under the GNU/GPL license. designed and hosted by w3you. Our web server is running on Kanotix64-2006.