[TriLUG] How to move root partition?

Smith, Brett bsmith at bloodhoundinc.com
Tue Jun 1 08:18:28 EDT 2004


CAUTION ** you could render your box unbootable.
this is a pretty good article on grub
http://www.linuxjournal.com/article.php?sid=4622

I would try this (not that it is the best solution)
using your old install or at boot time or chrooted from RH9 recovery mode.

grub
root (hd1,0)
setup (hd1)
quit

that will repoint grub to the new harddrive.

for the record this is really dangerous if you do not understand grub.


-----Original Message-----
From: Tom Bryan [mailto:tbryan at python.net]
Sent: Monday, May 31, 2004 11:56 PM
To: Triangle Linux Users Group discussion list
Subject: Re: [TriLUG] How to move root partition?


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

-- 
TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
TriLUG Organizational FAQ  : http://trilug.org/faq/
TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc

This email message is for the sole use of the intended recipients(s) and may contain confidential and privileged information of Bloodhound Software, Inc.. Any unauthorized review, use, disclosure is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.



More information about the TriLUG mailing list