Monday, November 29, 2010

How to edit grub files so Ubuntu boots after installing Fedora

Recently I installed Fedora 14 as a third OS, having Ubuntu 10.10 and Windows XP in other partitions. I told Fedora to install the grub loader, and now I had this in /boot/grub/grub.conf :

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,5)
#          kernel /boot/vmlinuz-version ro root=/dev/sdb6
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sdb
default=0
timeout=5
splashimage=(hd0,5)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.35.6-48.fc14.i686)
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.35.6-48.fc14.i686 ro root=UUID=e0a1c43c-0bc5-4762-b497-16f99a6e8bc8 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
    initrd /boot/initramfs-2.6.35.6-48.fc14.i686.img
title Fedora (2.6.35.6-45.fc14.i686)
    root (hd0,5)
    kernel /boot/vmlinuz-2.6.35.6-45.fc14.i686 ro root=UUID=e0a1c43c-0bc5-4762-b497-16f99a6e8bc8 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
    initrd /boot/initramfs-2.6.35.6-45.fc14.i686.img
title Ubuntu 
    rootnoverify (hd0,2)
    chainloader +1
title Windows XP
    rootnoverify (hd0,1)
    chainloader +1

 But when I tried to boot to my Ubuntu, it didn't work. This is how I solved it:


We will need to edit some files as root, the easiest way to do this, IMHO, is to open terminal and run
sudo nautilus
so we can browse everything as root and edit what we please, or
sudo gedit file_to_edit
to just edit a single file as root.
But Fedora does not allow you to "sudo" by default.


And if you try

su
nautilus
or
su
gedit


It doesn't work. (http://forums.fedoraforum.org/showthread.php?t=253687)
So let's add our user to the sudoers file.

Open a terminal, run
su
(enter password)
visudo
page-down to the bottom
press "insert" key to start editing, and add this line to the bottom:

laura ALL=(ALL) ALL

where "laura" is your username. Press esc, and then type
:wq
to save and exit. (A more complete guide for this can be found here: http://fedorasolved.org/post-install-solutions/sudo )

Ok now finally we can "sudo nautilus". We need to edit /boot/grub/grub.conf from our Fedora root partition.

We can comment the lines

#splashimage=(hd0,5)/boot/grub/splash.xpm.gz
#hiddenmenu

(by placing "#" in front) if we like. This is so the grub menu appears when booting without pressing any key, it is easier that way to reboot several times and always see the grub menu. You can uncomment it again later.

Now open a nautilus as a normal user, and make sure the partition where your ubuntu root resides is mounted. (Click its name if it doesn't have the "eject" arrow to the right) Now that mount will be visible from your root nautilus. (??? Why do we need to do this? it is a mystery: nautilus as root does not list all available disks or partitions like normal-user nautlus does).

(Here we see the root nautilus to the right, where the partition mounted as "127 GB Filesystem" in the normal-user nautilus, is shown as a long UUID).

Then open /boot/grub/grub.cfg, we will not edit this file, we'll just copy some lines from it to the fedora /boot/grub/grub.conf file.
It will contain something like this:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then

[snip]


### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos3)'
    search --no-floppy --fs-uuid --set 3089130e-0a2e-4f80-8eee-a3030a6810ea
    linux    /boot/vmlinuz-2.6.35-23-generic root=UUID=3089130e-0a2e-4f80-8eee-a3030a6810ea ro   quiet splash
    initrd    /boot/initrd.img-2.6.35-23-generic
}

[snip]

This is the part we are interested in:
linux    /boot/vmlinuz-2.6.35-23-generic root=UUID=3089130e-0a2e-4f80-8eee-a3030a6810ea ro   quiet splash
initrd   /boot/initrd.img-2.6.35-23-generic 



copy these lines to your Fedora /boot/grub/grub.conf and replace the word "linux" to "kernel". It should look like this now:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,5)
#          kernel /boot/vmlinuz-version ro root=/dev/sdb6
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sdb
default=0
timeout=5
#splashimage=(hd0,5)/boot/grub/splash.xpm.gz
#hiddenmenu
title Fedora (2.6.35.6-48.fc14.i686)
root (hd0,5)
kernel /boot/vmlinuz-2.6.35.6-48.fc14.i686 ro root=UUID=e0a1c43c-0bc5-4762-b497-16f99a6e8bc8 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.35.6-48.fc14.i686.img
title Fedora (2.6.35.6-45.fc14.i686)
root (hd0,5)
kernel /boot/vmlinuz-2.6.35.6-45.fc14.i686 ro root=UUID=e0a1c43c-0bc5-4762-b497-16f99a6e8bc8 rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
initrd /boot/initramfs-2.6.35.6-45.fc14.i686.img
title Ubuntu 2.6.35-23-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.35-23-generic root=UUID=3089130e-0a2e-4f80-8eee-a3030a6810ea ro quiet splash
initrd /boot/initrd.img-2.6.35-23-generic
title Windows XP rootnoverify (hd0,1) chainloader +1

I marked with red the modified parts. After updating the Ubuntu Kernel, you need to modify this file again so you can boot Ubuntu using that new kernel. Well, that's all for today, hope this helped someone. If you know better ways to do this, your input is welcome in the comments. I read somewhere that it's better to install Ubuntu last, because it recognizes installed OSs better, but I haven't tested this.

Friday, November 19, 2010

Yet Another Person attempting to build GNOME with jHbuild ;)

Just a quick post with some links to people who said it earlier and better than me:

http://www.vuntz.net/journal/post/2010/09/23/My-love-for-jhbuild
http://blogs.gnome.org/aklapper/2010/09/19/jhbuilding-gnome-3-0-no-fun
http://gnomedeveloper.blogspot.com

Also, this is a good idea:
https://bugzilla.gnome.org/show_bug.cgi?id=313147 so http://live.gnome.org/JhbuildIssues is more visible. Maybe add it to http://library.gnome.org/devel/jhbuild/unstable/index-info.html.en somewhere?

I know that building the bleeding-edge GNOME with jHbuild is not really necessary for people starting to contribute, but it's an experiment I wanted to do, and it serves a good purpose: I'm learning a lot on the way.

Maybe I will file some bugs when I encounter any clearly module-related problem, since that is another way to contribute.

Friday, November 12, 2010

Hello Planet GNOME!

Yay! I was selected! I'm in!

I felt, and still am, really happy about being selected as a participant in the GNOME Outreach Program for Women. I think is a wonderful opportunity, not only for the participants to learn a lot and get to know a vast community (that otherwise we may never would have explored, out of not noticing we could), but also an opportunity to create tiny "ripples of expanding information" and awareness amongst our contacts and personal circles. "Hey, if she could, I could too!" or "Contributing to an opensource project would also look great on my resume".

I think this video about Google summer of code sums up very well at 8mins 52 sec how intimidating the first steps into an opensource project can be. I felt that way for sure!


That's another reason this program is so great, by offering mentorship to participants in this way everything is really less scary.



(Those are screencaptures of the video I linked above, by the way).
It is even more difficult (to not be scared) if you are a woman. The topic of women in computing is a can of worms, but inavoidable: this is an outreach program for women after all. Why do we need extra encouragement? Ah, how I would like to be able to explain the complexities of being a woman in this world.

If you are a male, has anyone ever told you "Oh, so you are interested in doing X even when you are a BOY? Cool, I'm sure you can do it as well as any woman!" Implying X is made/done by and for women by default. Would you feel confident after that?

We say that ourselves: "Hi, I can do this as well as any man!". Yep, it's true, but why do we need to say it?  Because it was drilled into our heads, culturally, all our lives, that we are "the others", that if we do X (code, for example) that's uncommon and surprising. Lots of young school-age girls start to drift away from math, science and technology because of this perceived "that's for boys" thing. And they miss the opportunity of having better income as adults, they settle, instead, for boring and worse-paid "female" jobs.

Yep, I told you it was a can of worms ;)

I hope no one gets offended by this, it's not meant to. :)

-------

So! I will be working on Cheese Project with Daniel Siegel as a mentor, he has been very nice and helpful. I really like the application and I'll try my best to add new cool features, it's a lot of fun. I'd also like to thank everybody else for being so friendly, welcoming and encouraging. I'm really grateful to everyone involved!

I'd also like to say "Congratulations!" to the other seven participants, and "Stay around, don't go away, apply again next time!" to all other applicants.

So, what else can I tell you about myself? I live in Buenos Aires, I have a five month old son (that's an extra challenge: to find time and energy to code while taking care of an infant, but also a possibility to all technical mothers out there, as Marina Zhurakhinskaya said to me a couple of days ago, to participate in opensource projects if they are at home with their kids).


I started to like computers in the BBS era, I was a sysop of my own BBS back then 15 years ago, receiving calls in my 14400 modem. I'm working towards my bachelor's degree in computer science. I worked the last five years as a Visual C++ software developer in different companies.

And that's all for now, this was my introduction to people at http://planet.gnome.org where these posts will be aggregated. I will be reporting my experiences and progress weekly, so stay tuned! :)
See you around!