How to copy & convert linux root file system.

In this example:
copy from /dev/hdb1 (reiserfs) to /dev/hda5 (ext3)


# mke2fs -c -j /dev/hda5
# mkdir /hda
# mount -t ext3 /dev/hda5 /hda

umount all files system in /mnt (e.g windows)

# cd /

# for i in bin boot etc initrd lib mnt opt root sbin tmp usr var
do
echo $i
cp -a $i /hda
done


# cd /hda
# mkdir proc dev

modify /hda/etc/fstab

/dev/hda5 / ext3 defaults 1 1
/dev/hdb1 /hdb reiserfs notail 1 2
/dev/hdb6 /hdb/home reiserfs defaults 1 2


# cd /hda/boot

# mkinitrd -f --fstab=/hda/etc/fstab --preload=ext3 my.img 2.4.22-21mdkcustom

Add an entry to /etc/lilo.conf to boot /dev/hda5.

image=/hda/boot/bzImage.good
label="9.2hda"
root=/dev/hda5
initrd=/hda/boot/my.img
append="devfs=mount acpi=off quiet"
vga=788
read-only

# lilo


Now you can reboot to choose 9.2hda

Remember to modify the lilo.conf in hda.