Pages

Showing posts with label howto. Show all posts
Showing posts with label howto. Show all posts

Monday, March 19, 2007

Oops I killed my GRUB ...

Did you know that ...

So on my hard drive, I originally had a windows partition (from my original windows xp tablet pc edition), a linux partition (formatted ext3fs for my ubuntu installation), and a 3 GB linux-swap partition. I suddenly decided over the weekend that I wanted to make a vmware image of my windows partition (since that's the virtual machine program used in this tutorial).

However, VMware converter required 12mb, and I didn't have that much space left on my windows partition. So, I went and made an image of my mom's tablet computer, then backed up everthing I wanted to keep from my windows partition and then proceded to use GParted to delete the windows partition.

Now, I couldn't just leave all that space gaping there, right? So I tried to move my linux partition foward on the drive, but of course, GParted said "no!" So, I copied my hd2 (then linux partition) foward, then deleted the original hd2, then expanded both my original swap partition and my new linux partition. So here's a diagram to help you visualize:

Original Partition Configuration:
|hd1 - windows|hd2 - linux|hd3 - swap|
New Partition Configuration:
|hd1 - linux (copy of old one)|hd2 - swap|

Now, I happily rebooted my hard computer, eager to install that huge virtual machine so I can used windows under linux. However, now my grub file is messed up! After trying the Super Grub Disk (which didn't help at all - it only had confusing menus and awful options that went around and around in a voyage circulaire), I eventually booted into a Ubuntu Edgy live cd, ready to (sigh) reinstall my entire system. However, when the time came to reformat my hard drive, I refused to give up! I prodded around, sudo nano'ed /boot/grub/menu.lst (after backing up, of course), yet still I couldn't get it. Eventually, I found the solution in the man pages (ah ... the good old Linux Programmer's Manual Pages ... ) under update-grub. So here's the entire code for what I did ... hope it helps anyone else with this problem :)
sudo bash
enter root password here
mkdir /media/linux
mount /dev/hda1 /media/linux
chroot /media/linux
dir
double check to make sure it looks like / on your original linux ... if now, then something's wrong and you might need a reinstall :'(
dir /boot/grub/
backup your current menu.lst ... it may not work, but it's still better than trying to write your own from scratch :)
cp /boot/grub/menu.lst /boot/grub/menu.lst
rm /boot/grub/menu.lst
you might want to remove anything else that says menu.lst or similar ... not tested, so be careful ... better to back them up first, then remove
update-grub
when it asks you if you really want to make one, say yes ... there might be some other options I'm missing here, feel free to ask questions in the comments
update-grub
the first run generates the menu.lst file ... the second run configures it according to default settings
reboot

Now my computer works perfectly, with no glitches, and I've even managed to keep my tweakings to GRUB that I originally had without redoing all those tweaks! Apparently, update-grub was smart enough to figure out and keep my original GRUB settings. Yeah! ^_^

Thanks to Zach for telling me about chroot!

Well, now you know!

Friday, March 16, 2007

howtoforge.com - linux tutorials

Did you know that ...

Howtoforge.com is an excellent place to find detailed, easy to use, and comprehensive error-free tutorials for many flavors of linux, including BSD, Ubuntu, Mandriva, Fedora, and many other linux related howtos. How do I set-up my own mail server in 15 minutes with antivirus & antispam? How about a mirror of all packages on your own home network? Just follow the links to see! All the tutorials are easy and clear, and there is a comments secttion for easy Q&A. Go and give it a try ... the worst you could do is mess up your computer, and have to restore to a previous state. You did remember to backup your computer, right?

Well, now you know!

edit: oops, you're not supposed to use the comments to ask questions ... use the forums instead :)

Turning Physical Windows Systems into Virtual Machines for Use on Linux Desktop

Did you know that ...

You can use your own install of Windows on your linux box? By using Xen, an opensource virtual machine solution, you can run windows within your linux box without having to dual-boot and restart. Just follow this link to read an excellent howto from howtoforge.com on setting up xen on debian ubuntu.

An alternate solution is to use VMware from VMware.com. A tutorial for setting up VMware to run windows on ubuntu can be found here. Although VMware is commercial software (thus not free), there is a trial version available (which is all you should need -- according to the tutorial), not to mention VMware is one of the more popular virtualization software solutions for windows on linux.

Well, now you know!

Edit: spelled commercial wrong ... "commertial", lol.