Back in Ubuntu Nothing but Linux posts on my blog of late, well here is another to continue the trend. I decided to do a re-install of Windows over the weekend. The reason? Windows is kept on my machine purely for gaming of which I do little. If I could play every game I have on Linux Windows would be deleted from my HD faster than you can type fdisk. However this isn't the case and so I thought I would "tidy up" my Windows installation. My Windows partition has remained untouched for over a year (a first for me as I used to do a fresh install Windows every 3-5 months)! It dated back to a time before I had become enlightened and had realised Linux and so there were lots of uneeded programs on my system that I needed back then but were just clogging up the system if all you want to do is game. So a fresh install was completed.
I was fully aware of the implications of dual booting Linux and Windows and what would happen if I was to do a fresh install of Windows i.e. Windows would conviently "forget" I have Linux installed and not allow me to boot into Linux anymore. No prob I thought, I can find away round that. So I went ahead, Windows was installed and up and running (I use that term loosely with Windows) games and all and once again I begain to hate how restrive the environment Windows provides is. It was time to move back to Linux. I popped in a copy of Damn Small Linux 2.0 on my business card shaped CD that I carry at all times in my wallet (yes every self respecting geek has a linux distro at hand at all times ) and loaded it up into text mode. I could have gone Blackbox GUI but I wasn't planning on staying long.My planning was wrong, I did stay long, very long indeed and returned on several occasions after getting a few error messages. There was a prob with the mtab, the fstab and GRUB - just my luck! Here's how I got GRUB and so made Linux usuable on my system again: Mini HOWTO: GRUB rescue from Windows bootloader For this HOWTO I'll assume you have a working command line infront of you with basic tools like fdisk, mkdir, mount and chroot available. First things first you need to know what partition is your root Linux partition. Most geeks repeat the contents of fstab in their sleep but just in case you don't know perform an fdisk -l. This should give you a list of all partitions available. If you don't recognise your root partition trial and error is probably your best friend here. For this guide I'll be using /dev/hda1 which you should substitue for your root partition. Now onto the commands: # mkdir fs # mount /dev/hda1 fs # chroot fs # grub-install /dev/hda I could like many guides, finish off here but I hate typing in random commands with no explation of what they do so I'll breify explain them. First we create a new directory for your old filesystem, the root partition to be mounted onto, this directory will "contain" the contents of your root partition after executing the following command. Chroot changes the root directory to fs. Meaning after this command has run you are now working from your old linux root system. So any commands on it are now available to you. We now run grub-install from your old root system and tell it be installed on /dev/hda. That's your first hardrive in the machine. Pitfalls grub-install reports df: Could not find mount point or something similar. I had this problem and it was caused by an old mtab. The fix: # rm /etc/mtab # touch /etc/mtab Grub installed but Linux wont boot. This could be down to your partition numbers changing. On my system Windows created two partitions instead of one which changed my partition numbering. Your going to have to edit /etc/fstab and possibly /boot/grub/menu.lst and make updates to the partion number eg /dev/hda5 might be /dev/hda6 |