Red Hat 9 is installed and the following partitioning is present:
hdd1 /boot (ext3) 100MB
The task is to add a second Linux OS (Suse 9) onto this hard disk without destroying anything. The root partition of this system should be 10 GB. Additionally I want to put all user-created files on one partition (now they are on three different partitions: hdd2, hdd6 and hdd7). First I got a 200 MB external USB2/firewire hard drive (Maxtor, mounted as /mnt/sdb1) and copied the data from hdd1, hdd2, hdd6 and hdd7 onto it with "cp -ax /home /mnt/sdb1", etc. Then I rebooted using the Knoppix 3.3 CD and from a root terminal executed partimage. I tried to save the image of the root partition directly to my external usb drive, but without success: everytime the program halted somewhere during the process. I then saved the image on /mnt/music and that succeeded. I rebooted into Red Hat 9 and copied the image manually from /mnt/music to the usb drive (/mnt/sdb1). Because I didn't trust the partimage program, I additionally copied the filesystem manually to the usb drive using the following commands: mkdir /mnt/sdb1/redhat_root cd / find . -xdev -print | cpio -padm /mnt/sdb1/redhat_root Apparently this copies everything including special files, mount points, etc. preserving all the file meta data. After this I disconnected the external usb drive (to be on the safe side), rebooted into Knoppix and wanted to try out QTParted. It should be able to resize partitions. From a root terminal: "qtparted". However, I was not able to resize anything (the options were greyed out). I could delete and recreate though (which didn't help much). So I decided to go for a clean sweep, popped the Suse 9 CD into the drive and rebooted into the Suse 9 installer. I choose expert partitioning and deleted all partitions that were present and recreated the following partitions. I made sure to use exactly the same amount of blocks (1019) for hdb3 as had been used for hdd3 because I knew that partimage can only restore images onto partitions that have exactly the same size or are bigger:
hdd2 /home (reiserfs) 7.8GB
hdd3 / (ext3) 7.8GB
hdd4 EXT
hdd5 swap 1GB
hdd6 /mnt/documents (reiserfs) 12GB
hdd7 /mnt/music (reiserfs) 90GB
/dev/hdb1 1 8 64228+ 83 Linux (ext3) /boot
After the install had finished, I rebooted into Knoppix and tried to restore the Red Hat root partition onto hdb3. Partimage told me that the partition was smaller than the image, thus a restore was not possible. So rebooted into Suse 9 and manually copied the Red Hat 9 root system back to hdb3 (with the same command sequnce that was used to copy it manually to the usb drive). Then I changed /redhat/etc/fstab to reflect the new partitioning and copied all the files from /boot (but not the subdirectories from /boot) onto the new boot partition (except those files that had already equivalents in /boot). Then I modified /boot/grub/menu.lst by adding a line for the Red Hat install:
/dev/hdb2 9 1314 10490445 83 Linux (reiserfs) /
/dev/hdb3 1315 2333 8185117+ 83 Linux (reiserfs) /redhat
/dev/hdb4 2334 14945 101305890 f Win95 Ext'd (LBA)
/dev/hdb5 2334 2464 1052226 82 Linux swap
/dev/hdb6 2465 14945 100253601 83 Linux (reiserfs) /home
title Red Hat 9 Linux
I also create the two user folders in the /home directory (which used to be the mount point for the /home partition). But I copy all the hidden files and directories (those starting with a .) into the userfolders.
root (hd1,0)
kernel /vmlinuz-2.4.20-19.9 root=/dev/hdb3
initrd /initrd-2.4.20-19.9.img
Then I tried to reboot into Red Hat 9. Without success. Kernel panic. No init found. Try passing init=option to the kernel. Actually the file system check of hdb3 failed (no superblock found). There are several error messages and the important ones come first and fast (and you don't see them) and the bad, misleading error messages come late. Something like that you should manually repair the partition. And that root is mounted read-only. And that you can make it read-write by "mount -n -o remount,rw /". And that only with Ctrl-D one can reboot into this state.
Obviously that's what I am going to do. However there is no hint about what command to use. Several attempts to do anything while having mounted from hdb failed (if reiserfs is read-only it cannot be repaired, if it is read-write it cannot be checked). So I reboot into Knoppix and do the repair from there: fsck (which executes reiserfsck) doesn't do the job: it only checks, but doesn't do any repairs. I figured that flagging reiserfsck --rebuild-sb /dev/hdb3 does repair the superblock. Still no go, so I do the slow complete rebuild of the filesystem from scratch with reiserfsck --rebuild-tree /dev/hdb3. It still doesn't boot into RH9. Then I get the idea: the RH9 kernel might not support reiserfs (or the module is not loaded). Or (alternatively) copying some special files from a ext3 partition to a reiserfs partition might simply not work. So I delete (from Knoppix) the whole hdb3 and recreate it as ext3. Copy back all the data (QTParted still complains about too small size). And it finally works. I create two directories for the two users on the /home partitons and manually copy into them the non-hidden files of the old userfolders. I don't copy the hidden files. There are many that would screw up Suse and make it impossible to log in (I had tried that out before). I log into Suse 9 as root and create the two users with exactly the same name as on RH9. There is a warning that the directory exists and that all its content will be owned by the new user. That is OK of course.