[TriLUG] How to move root partition?

Tom Bryan tbryan at python.net
Mon May 31 23:56:08 EDT 2004


On Monday 31 May 2004 12:27 pm, Michael Hrivnak wrote:
> Boot knoppix or equivalent, and mount the old and new partition.  It'll go
> faster if the two drives are on different IDE channels.
>
> cp -avx /mnt/old/* /mnt/new/
>
> I suggest reading the man page to see just what those flags are doing.

Thanks.  That seemed to copy everything, but do I need to do something special 
with the kernel image?  Or am I forgetting something silly?  I'm getting the 
following error in grub

kernel /boot/vmlinuz-2.4.20-8 ro root=/dev/hdb1
Error 15: File not found

/dev/hda8 was my old root partition.  /dev/hdb1 is supposed to be my new root 
partition when I'm all done.  grub.conf looks like this on both partitions:

default=0
timeout=10
splashimage=(hd1,0)/boot/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
        root (hd0,7)
        kernel /boot/vmlinuz-2.4.20-8 ro root=/dev/hda8
        initrd /boot/initrd-2.4.20-8.img
title Red Hat Linux (2.4.20-8 new hard drive)
        root (hd1,0)
        kernel /boot/vmlinuz-2.4.20-8 ro root=/dev/hdb1
        initrd /boot/initrd-2.4.20-8.img

/boot/vmlinuz-2.4.20-8 was copied using cp -avx from /dev/hda8 to /dev/hdb1 
(while they were both mounted from using Knoppix).  I ran rdev to switch 
/boot/vmlinux-2.4.20-8 on /dev/hdb1's root device to /dev/hdb.  

When I boot up to grub (probably still booting off of /dev/hda at the moment) 
and drop to the command prompt, I get interesting results from find.  If I 
type find /boot/grub/device.map or find /boot/vmlinuz (the symlink), grub 
lists both (hd0,7) and (hd1,0) as locations for the file.  If I type find 
vmlinuz-2.4.20-8 or find vmlinux-2.4.20-8, grub only finds the one in 
(hd0,7).  

Does that indicate something wrong with the copied kernel image?  Or do I need 
to do something to make the kernel image on /dev/hdb1 available to grub?

> I'm pretty sure the limitation you are referring to is bios-specific. 
> Rather than squeezing your root partition when this is a problem, you might
> try making a /boot partition. 

I have not yet created a separate /boot.

---Tom




More information about the TriLUG mailing list