HELP! Need to move RH install to new drive asap.

andyr354

Junior Member
Aug 26, 2004
6
0
0
I have RH linux 7.3 on a mail server that needs to be moved to a new harddrive.
I tried to use ghost to copy it over to a new drive but cannot get it to boot. Grub is all that displays at the top of the screen.
Next I put the old drive back in and used mbkootdisk to make one. It boots until I get

Kernel Panic No init found
Try using init= to pass to kernel.

So next I put the old drive in and tried the bootdisk on it..... it worked.

So I dunno what is going on. The old drive is dying and need to get it off there soon.


Andy
 

andyr354

Junior Member
Aug 26, 2004
6
0
0
I have gotten the data coppied with the Mini-Howto I found.

Still need to get a bootloader on the new drive, part of grub seems to still be there but not working.
Right now I am booting from a floppy

Also, Unless the old hard disk is connected to /dev/hdc I will get an error on bootup during the fsck and it will not let me boot. How do I solve this?
Edit:
I was looking at the fstab and noticed that the first line has a LABEL in it. I remember fsck saying it could not find some label. It is save to delete the LABEL comment and just replace it with / for the root partition?

It is up and running on the new drive at the moment. Just need to work the above bugs out.
 

Panther505

Senior member
Oct 5, 2000
560
0
0
Allrightttiee...

Grub problems (is it grub or lilo).

If it is grub then I would boot from disk one of the 3 CD set and type "linux rescue" at the prompt. If you have both hard drives in there it will make it easier but if you can discern what partition the root (/) partition is on you can do one of two things
1- e2label /dev/hdx# (where x is the drive and # is the partition on the drive) /
2- edit /etc/fstab so that instead of LABEL=/ it has the device (ie /dev/hdx#). IF you make this change then you will have to change the kernel line in grub to reflect the same thing! (ie root=LABEL=/ to root=/dev/hdx#)

The system it booting because of the fact that it can see the label on the original drive. If you remove that drive you will be in the weeds quickly. Something to point out. IF you have done mail or whatever on this system then the copy that you are using is NO LONGER CURRENT (unless the other partitions were mounted by partition and not by label).

Trick to imaging a linux box.....

1. dd is your friend (if the drives are the same size)
2. fdisk, e2label and rsync or cp -a are your friends if you are upgrading disk size. First create the partitions, label them, and then cp everything over(or rysnc). The key to both of these scenarios is to use disc 1 and boot into linux rescue mode to get it done.

Any questions let me know.

Panther
 

andyr354

Junior Member
Aug 26, 2004
6
0
0
Ok, here is what I did.

I fdisked the new drive (which is a 30gb and the old was 4.3gb) with the same partitions except larger. It only has a root partition and a swap partition.

Formated the new hd data and swap areas.

Put the new drive in on /dev/hdc mounted to /new-disk and use copy -ax /new-disk

put the new drive on /dev/hda and like I said stuck the old disk on /dev/hdc to make it happy.

So from the way it sounds I need to run e2label adn put a label of / on the new drive? or what is the exact syntax for the e2label command.

I don't have the origional install cds I don't think... will have to dig around. It was downloaded to install.

I have relearned much I have forgotten about linux today... and learning new things as well.
 

Panther505

Senior member
Oct 5, 2000
560
0
0
e2label syntax is -

e2label device label (ex e2label /dev/hda1 / )

or you can change it in the fstab to be /dev/hda1 and then change the kernel line to say root=/dev/hda1 also

Panther
 

andyr354

Junior Member
Aug 26, 2004
6
0
0
Cool, you are aweseome! :)

I used the label command, pulled the old drive and booted right up (with the boot disk still).

I did find the install CDs in the back of a cubboard as well.

I will probably have to leave it at this point for a few days since I am going to be out of the office.

I would like to get a bootloader back on it though to get rid of the bootdisk.

Grub is what it was using but if LILO is easier I don't care which one it is.

IT is redhat 7.3 if I didn't mention it earlier.