[TriLUG] How to move root partition?

Tom Bryan tbryan at python.net
Wed Sep 8 01:32:37 EDT 2004


I put this project on the shelf, but I'm back at it again.  I was trying to 
move my root partition to another disk.  (See below for the history.)

Essentially, I believe that I copied /boot/vmlinuz-2.4.20-8 from one root 
partition to another.  Yet, when I boot up and go to the grub command prompt, 
grub sees my old 
(hd0,7)/boot/vmlinuz-2.4.20-8
but when it looks for the copied kernel image, it sees
(hd1,0)/boot/vmlinuz-2.4.18-8

If I actually boot the machine from the old partition and mount /dev/hdb1 at 
/newroot/, I can see that the filename on /dev/hdb1 is 
/boot/vmlinuz-2.4.20-8.  
$ ll /boot/vmlinuz-2.4.20-8 /newroot/boot/vmlinuz-2.4.20-8
-rw-r--r--    1 root     root      1117254 May 31 23:35 /boot/vmlinuz-2.4.20-8
-rw-r--r--    1 root     root      1117254 Sep  6 15:28 
/newroot/boot/vmlinuz-2.4.20-8
$ ll /boot/vmlinuz-2.4.18-8 /newroot/boot/vmlinuz-2.4.18-8
ls: /boot/vmlinuz-2.4.18-8: No such file or directory
ls: /newroot/boot/vmlinuz-2.4.18-8: No such file or directory

Any ideas why grub would think that the file on /dev/hdb1 is vmlinuz-2.4.18-8 
instead of vmlinuz-2.4.20-8?

BTW, a key grub troubleshooting feature with the file not found error was tab 
completion on the grub command line.  I finally just started specifying the 
hard drive as (hd1,0)/ and using tab completion in grub to see what it 
thought was available.

---Tom

On Monday 31 May 2004 11:56 pm, Tom Bryan 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?





More information about the TriLUG mailing list