Quote:
Originally Posted by Druchii
Nice, so i take it it's not broken then? 
|
Nope but I made a fatal error which could have cost me anyway heres a mini HOWTO
Installing a new distro on a Remote Machine
Disclaimer : If you **** up your machine the author takes no responsibility nor does he give out charity. It's your own fault for being too smart and too lazy to do the install in front of the the computer in question.
BEFORE STARTING ENSURE YOU HAVE ACCESS TO A REMOTE POWERBAR SO THAT YOU CAN POWER CYCLE YOUR MACHINE IF IT HANGS
Instructions
[0] Background : My setup
/dev/hda1 original OS
/dev/hda2 swap
/dev/hdc1 empty partition
/dev/hdc2 swap
[1] Find or create a partition or select a disk for the new OS
[2] Install Vmware : download ISO of the distro of your choice.
[3] Create a virtual machine using a physical disk mounting the distro and carefully install onto the new partition / disk ensure that a new boot loader from the installer is not written to the disk (especially if your new OS partion is going to reside on the same disk as the old OS),
Dont worry if the install process has written a boot loader overwritting the current bootloader of your default OS - If it has just run lilo from outside the Virtual Machine ie natively on the running OS to restore your default bootloader.
[4] Trying to boot the new OS : If it was installed on a new disk and the bootloader was written to that disk then you can boot it simply within Vmware. If not then use
tomsbootroot disk as a mounted floppt within Vmware to boot the new OS sending the parameters bz2bzImage root=/dev/hdc1 ro (single : single user mode if you got problems you need to fix with the new OS) etc etc.
Once up and running configure networking and write some debug scripts to write a logfile to fs and within that script send it for reboot immediately(optional).
Remember to change /etc/fstab so that root / points to the new / fs in my instance :
/dev/hda1 / ext3 defaults 1 1
now becomes
/dev/hdc1 / ext3 defaults 1 1
The usage of LABEL=/ did not work for me if you know how to make that work let me know e2label didnt hack it for me - couldn't be ar$d to play with it.
That should be it from the vmware side of things
[5] Trying to boot the OS natively : Now this is where it gets tricky.
Even though there may be a bootloader on the new disk YOU MUST REMEMBER THAT THIS LOADER CAN ONLY BE READ BY THE BIOS and BIOS is this case is that of the Virtual machine, (ie Vmware) therfore trying to boot the new OS natively will not work as your native BIOS will not have the correct references to know where /boot/kernel is.
So we use the old kernel from your existing install to boot the new OS.
Modify /etc/lilo.conf
default=default
image=/boot/vmlinuz-2.4.20t
label=default
read-only
root=/dev/hda1
image=/boot/vmlinuz-2.4.20t
label=mirrorindirect
read-only
root=/dev/hdc1
Here's mine I made the addition of mirrorindirect.
IMPORTANT do not change default to the new entry unless you're a mega big head and are confident that its gonna work first time !
Lets instead instruct LILO to *TRY* the new kernel/config if it fails then a powercyle of the machine will revert back and load the default profile : KOOOL
lilo -d 0 -R 'mirrorindirect'; reboot
Your machine should come back up using the new OS of not power cycle and your old OS will be booted.
[6] Icing on the cake stuff...
Boot into the new OS and write a new lilo bootloader to a free partion or disk (MAKE SURE YOU DON'T OVERWRITE THE OLD OS BOOTLOADER)
lets say you write it to /dev/hdc
Once thats done reboot back into the old OS and write a new boot entry into lilo.conf
other=/dev/hdc
label=mirrordirect
Now you should be able to boot into the new OS with its kernel via :
lilo -d 0 -R 'mirrordirect'; reboot
Once in the new OS you will know that if you reboot you'll be going back to the old OS.....
Sweet