Clone redhat 9 to larger disk; part 2

From: Ohmster (notareal_at_emailaddress.com)
Date: 04/10/05


Date: Sun, 10 Apr 2005 14:21:22 GMT

Long post, tried to supply all information. Please reply and delete out
necessary quoted text to make this easy to read. Thank you.

I posted before "Okay to clone drive to larger size drive?" and got some
helpful answers and made some progress but did not successfully get the
main / disk to clone. I really need help with this. Somebody smart please
help!

Background: redhat system; gateway/server/firewall for two XP machines on
LAN. 2 NICs; one to hub and LAN, one to DSL modem. Processor is an Intel
Pentium III 800Mhz with 1.5Gb SDRAM. The system uses grub to boot, the
default kernel is Two hard disks in system, hda is 27Gb drive with three
partions; /boot, /, /home. Partitions are labeled as such.

2nd hard drive was a 27Gb drive, labeled as /home and mounted at /home on
the file system tree. I was able to use Acronis Migrate Easy 6 to copy
the 27Gb /home drive to an 80Gb drive and simply replace the drive with
the new one. It booted right up and there was no difference, other than I
have more space in the /home directory. Worked like a charm! :)

This method did not work at all for the root drive. When I used Migrate
Easy to copy the 27Gb existing drive over to the 80Gb drive, the program
wanted to expand the partitions proportionally. I did not want a 300Mb
boot partition, nor a 3Gb swap file. So, I manually made the /boot
partition the same as it was, 101Mb, all the way to the begining of the
disk with no free space in front. I then expanded the next partion, /, to
start at the end of the /boot partition. Next I shrunk down the swap
partion to the 1278.6Gb that it was, and kept it at the very end of the
hard drive. I then resized the / directory to fill the free space so that
it would begin at the end of the boot partition and end at the beginning
of the swap partition. No free space anywhere on the drive. Great. Commit
the changes and let's do this.

After copying the drive over to the new drive and then exchanging the
drives physically, the system would not boot. I did not get the grub menu
at all that shows the default kernel, 2.4.20-31.9, and the second kernel,
2.4.20-30.9. I got to a black screen with the word "grub", no prompt and
it froze there. Crap. The structure of the drive as per fdisk is:

   Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 3576 28619797+ 83 Linux
/dev/hda3 3577 3739 1309297+ 82 Linux swap

I tried booting to knoppix, opening a root terminal, made a directory
/mnt/realroot, mounted /dev/hda2 as /mnt/realroot, did "chroot
/mnt/realroot", and then did "/sbin/grub-install". Got the message that
there were no errors and showed me a device map:

(fd0) /dev/fd0
(hd0) /dev/hda

That seemed okay so I then unmounted the drive and rebooted. Now the
system booted to a grub prompt (sob!) and who in the world knows what to
do with that? I connected the old drive again and booted my system back
up. The wife will not put up with too much of the network not working.
When I went back to knoppix and looked at my /boot partition, I did not
have all of my good stuff in there anymore. This is what it should look
like in /boot:

[root@ohmster boot]# ls -lRh
.:
total 9.9M
-rw-r--r-- 1 root root 5.7K Jan 25 2003 boot.b
-rw-r--r-- 1 root root 612 Jan 25 2003 chain.b
-rw-r--r-- 1 root root 44K Feb 4 2004 config-2.4.20-
30.9
-rw-r--r-- 1 root root 44K Apr 13 2004 config-2.4.20-
31.9
drwxr-xr-x 2 root root 1.0K May 14 2004 grub
-rw-r--r-- 1 root root 147K Feb 20 2004 initrd-2.4.20-
30.9.img
-rw-r--r-- 1 root root 147K Apr 30 2004 initrd-2.4.20-
31.9.img
-rw-r--r-- 1 root root 473 Oct 24 2002 kernel.h
drwx------ 2 root root 12K Oct 24 2002 lost+found
-rw-r--r-- 1 root root 23K Feb 24 2003 message
-rw-r--r-- 1 root root 21K Feb 24 2003 message.ja
lrwxrwxrwx 1 root root 23 Apr 30 2004 module-info ->
module-info-2.4.20-31.9
-rw-r--r-- 1 root root 15K Feb 4 2004 module-info-
2.4.20-30.9
-rw-r--r-- 1 root root 15K Apr 13 2004 module-info-
2.4.20-31.9
-rw-r--r-- 1 root root 640 Jan 25 2003 os2_d.b
lrwxrwxrwx 1 root root 22 Apr 30 2004 System.map ->
System.map-2.4.20-31.9
-rw-r--r-- 1 root root 510K Feb 4 2004 System.map-
2.4.20-30.9
-rw-r--r-- 1 root root 510K Apr 13 2004 System.map-
2.4.20-31.9
-rw-r--r-- 1 root root 3.1M Feb 4 2004 vmlinux-2.4.20-
30.9
-rw-r--r-- 1 root root 3.1M Apr 13 2004 vmlinux-2.4.20-
31.9
lrwxrwxrwx 1 root root 19 Apr 30 2004 vmlinuz ->
vmlinuz-2.4.20-31.9
-rw-r--r-- 1 root root 1.1M Feb 4 2004 vmlinuz-2.4.20-
30.9
-rw-r--r-- 1 root root 1.1M Apr 13 2004 vmlinuz-2.4.20-
31.9

./grub:
total 186K
-rw-r--r-- 1 root root 82 Oct 24 2002 device.map
-rw-r--r-- 1 root root 7.7K Sep 25 2003 e2fs_stage1_5
-rw-r--r-- 1 root root 7.4K Sep 25 2003 fat_stage1_5
-rw-r--r-- 1 root root 6.7K Sep 25 2003 ffs_stage1_5
-rw------- 1 root root 751 May 14 2004 grub.conf
-rw------- 1 root root 613 May 15 2003 grub (copy).conf
-rw-r--r-- 1 root root 8.2K Sep 25 2003 jfs_stage1_5
lrwxrwxrwx 1 root root 11 Oct 24 2002 menu.lst ->
./grub.conf
-rw-r--r-- 1 root root 6.9K Sep 25 2003 minix_stage1_5
-rw-r--r-- 1 root root 9.2K Sep 25 2003 reiserfs_stage1_5
-rw-r--r-- 1 root root 11K Feb 24 2003 splash.xpm.gz
-rw-r--r-- 1 root root 512 Sep 25 2003 stage1
-rw-r--r-- 1 root root 104K Sep 25 2003 stage2
-rw-r--r-- 1 root root 6.4K Sep 25 2003 vstafs_stage1_5
-rw-r--r-- 1 root root 9.1K Sep 25 2003 xfs_stage1_5

./lost+found:
total 0
[root@ohmster boot]#

When I was in knoppix, I took a look at the drive in fdisk. I noticed
that the bootable flag was set to hda2, the / partition. I used fdisk to
set it to the /boot partition. Figured that I was all set. Halted the
system, physically swapped the drives, and booted. Got the grub screen,
hooray! Booted to the default 2.4.20-31.9 kernel and it looked like it
was going to boot. The system got stuck very early in the boot process,
some kind of disk error but passed it, unable to fix. Came to a runlevel
1-6 message, that they were respawing too fast, and went through all run
levels in the list and froze. Halt gave me a message of dropping to run
level 6 and the system hung like that. Double crap! I should have took a
digital picture of this so that I could have posted it.

Anyway, this is getting long winded, I want to post enough information
for someone to help me. I have the 80Gb drive installed the system but
have unplugged it and have the original 27Gb drive "hanging by the
cables" to run the system and get network and internet access for my home
LAN, I am posting from Xnews on my XP machine.

I had wanted to examine the /boot partitions of each drive while in
knoppix and copy over the /boot partition contents from the old to new
but for some strange reason, I could not mount the / partition of the
original disk, mount wanted me to specify a file system. Huh? I could
mount /dev/hda1 of the new disk but could not mount /dev/hdb1 of the old
disk that really does work. Strange, there goes that idea.

What is wrong with this? How come I cannot simply clone the drive over to
a larger drive, keep the /boot and swap partitions the same size, expand
the / partition to the remainder of the disk, and have it "just boot" and
run normally? What is the secret to cloning the linux drive over to a
larger hard disk? What can I check, what can I do? My friend gave me
Partion Magic 8 to try but PM does not copy disks, it will allow you to
copy partions but for some reason, I could not sucessfull copy the boot
partion with PM8. I could delete the /boot partition of the new drive and
then tried to copy the old one over in the free space and it looked like
it would work but failed with some numerical error and only left free
space on the new drive. Thought this would work for sure.

Somebody please help, I am running out of space and need a larger drive.
The system has years of tweaks, setups, and servers all over it to make
it perfect so reinstalling is not an option.

[ohmster@ohmster ohmster]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 27G 22G 4.2G 84% /
/dev/hda1 99M 15M 80M 15% /boot
/dev/hdb1 74G 18G 53G 26% /home
none 756M 0 756M 0% /dev/shm
//cindy/cindy_music 26G 17G 9.3G 64% /mnt/cindy_music
//missy/ohmster_music 74G 43G 31G 59% /mnt/ohmster_music
[ohmster@ohmster ohmster]$

Hey, how come my swap partion is now showing up?

[ohmster@ohmster ohmster]$ mount
/dev/hda2 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/hda1 on /boot type ext3 (rw)
/dev/hdb1 on /home type ext3 (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
//cindy/cindy_music on /mnt/cindy_music type smbfs (0)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
//missy/ohmster_music on /mnt/ohmster_music type smbfs (0)
[ohmster@ohmster ohmster]$

Is that normal?

[ohmster@ohmster ohmster]$ cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
LABEL=/home /home ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda3 swap swap defaults 0 0
/dev/hdd4 /mnt/zip auto noauto,owner,kudzu 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/cdrom /mnt/cdrom iso9660 ro,mode=444,noauto 0 0

(Left off the mounted shares, unimportant for this post.)

Shouldn't the swap show up in df? Maybe not a big deal as per swapon?

[root@ohmster etc]# swapon -s
Filename Type Size Used Priority
/dev/hda3 partition 1309288 0 -1
[root@ohmster etc]#

What is so freaking hard about all of this? How come cloning over the
/home drive was so easy but the / drive is such a nightmare? My system is
open, my drive is haning by the wires, and I have an 80Gb drive in there
that I cannot use. Help me help me!

-- 
~Ohmster
ohmster at newsguy dot com


Relevant Pages

  • Re: how to change out system disk?
    ... I also boot from a 9 GB SCSI drive, with two additional HDs, but my other ... partition on the first HD; this partition must be marked Active. ... Physically add the new HD as Disk 2 and reboot into your existing system ... create logical drives to match your current "drives": ...
    (microsoft.public.windowsxp.hardware)
  • Re: Boot Problem
    ... Right mouse click the dest disk> Advanced> Edit ... but it should eventually boot to Windows. ... I see a lot of posts in here about the ability of Acronis to clone drives. ... I have managed to successfully copy by DELETING partition, ...
    (microsoft.public.windowsxp.hardware)
  • Re: Starts only with floppy disk
    ... a new drive letter to the disk when Windows is rebooted. ... Windows 98 boot diskette you can get one at bootdisk.com. ... When I marked that Boot Partition as Active it changed over to Healthy ... drives with completely independent NT operating systems the partition ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: OS installed on system with Two Hard Drives
    ... There are several ways to start Disk Management; my favorite is to simply press Start, ... You should see that your Drives C:, D: and E: are on Disk 0, and your Drives H: and T: are on your Disk 1. ... the terms "system volume" and "boot volume" are used counterintuitively; we BOOT from the SYSTEM volume and keep the operating SYSTEM files in the BOOT volume. ... But Vista Setup - when booted from the DVD - assigns C: to its own Boot Volume, even if that is the 3rd partition on the second HDD! ...
    (microsoft.public.windows.vista.installation_setup)
  • Re: reinstalling xp
    ... or at least another physical disk drive. ... drives, then you need to make the DVDs. ... you'll know it because the boot screen will say so. ... Press D to delete the partition. ...
    (microsoft.public.windowsxp.basics)