TimeLinux1

Wednesday, March 30, 2011

Google Froyo, GingerBread, HoneyComb

Google has been a supporter of Opensource through their Android OS. The last time I checked, they had released their Source code with Froyo and GingerBread. Then something happened. They, in their recent press release have stated that the HoneyComb platform is in need of some more polishing before it is released out for the Developers as Opensource. I think they are taking this decision out of some bugs that need fixing and not because they are suddenly turning against Opensource. BTW, as it is, from my own experience of Android Froyo on my HTC evo smartphone, I think they lacked some of the smooth, svelte graphics and end-user experience in the GUI software. For instance, the menus are comparatively rigid at times, not always working with the finger touches as responsively as one would expect. Smooth-scrolling just gives a better look and feel to the phone and I hope they bring that in the latest version.
This could also stem from the devices Android runs on.The HTC graphics are fine but their touchscreen probably needs some refinement.They sometimes require multiple harder taps for invoking apps. BTW, noone would disagree that the battery life on some of the HTC smartphones is not yet at their best. They run out much faster than stated on the packaging. I hope they are looking onto that. Android is a cool platform because its Opensource and is based on Linux.The freedom enthusiasts in us want it to succeed..

Tuesday, March 29, 2011

Kudos Amazon - Cloud Drive, Cloud Player

Amazon! Thats great news about your new service on the Cloud. What a kick in the face of the forces that try to lock user Freedom. As a computer user, I have the right to my data, my mp3, my jpegs, my files and all that.
So why cannot I be using a remote drive/storage to store my files? Why should I be locked down to one way of accessing my files (I'm talking about you Apple from Cupertino) that too from only one piece of hardware? Its my information. Its my Freedom. You cannot take it. Period.
So therefore, Amazon Cloud that frees me the user of information from the clutches of greedy corporates and labels that are designed to fill only their pockets, is a good great move by Amazon. They are now talking about suing Amazon. Under the garb of Music Copyrights. Welll. I think that is a short sighted move by the copyright jingoists. First of all, there is NO Real way of ensuring that the owner of a music CD will play his/her music only from only one form of media, eg  the music CD. The moment they burn it onto their disk / mp3 players they are making a so-called 'illegal' copy of it. So now if monitoring and regulating is meaningless even in the current scenario, then the same is meaningless also in the case of cloud. Storage is storage -- local or remote. So smart move there Amazon.
Secondly, Amazon cloud service is a general purpose service. Music is only 'ONE' of the uses of remote cloud service. No-one forces you to store music only. You can equally well instead of music, store your Photograph or Resume' also for example. Only that the file will be stored remotely. So are we now going to be sued by Camera makers or Word processor makers?? So I dont see the lawsuits against Amazon going far. Plus I foresee Amazon cloud to be a success. Good job Amazon. Keep it up..

Sunday, March 20, 2011

Linux: How to Dual boot Ubuntu and Fedora?

If you are like me, you would want to have the option of booting your computer in more than one OS. While the virtualization domain can answer certain of the requirements, here today we will discuss some old school..

Objective:   Want to dual boot my laptop between Ubuntu and Fedora. (This will work for Windows as well, incase you want to dual boot between Windows and Fedora).

Story: First I installed Ubuntu 10.04. It worked fine. I created 3 disk devices for it /dev/sda1 for /root partition, /dev/sda5 for /boot partition and /dev/sda7 for /home partition. This means the grub bootloader got installed in its default location /boot/grub/grub.cfg file ie on /dev/sda5. The total of all the Ubuntu partitions being 50 GB.
Next, I installed Fedora 12 on the remaining free space on my hard disk (70 GB).
I created the disk layout as the default LV (Logical Volume) to fill that 70 GB. The installation went smoothly otherwise.

Problem:
While both Ubuntu and Fedora installed smoothly individually, the latter Fedora install overwrote the Ubuntu Grub bootloader with its own. This happened because, during the Fedora Install, the Anaconda installer did not detect my existing Ubuntu installation. So it installed its own version of Grub on top of the MBR (master boot record). Isn't that strange? You would expect one flavor of Linux to work with another flavor of Linux. But no, reality is different.
This means each time I boot my computer, it does not display the bootloader menu giving me the option of choosing which OS I want to boot. Instead it boots Fedora directly. So my challenge is to rectify the bootloader to show both the Ubuntu and Fedora menu options.

Solution:
Since a computer with one single disk can have only one Master Boot Record (MBR - the first 512 bytes of the primary disk, that the bootloader reads when booting a system), this means the MBR can point to only one grub bootloader -- either the grub written by Ubuntu or the grub written by Fedora. I chose the Fedora grub file as the primary grub for my system (just a personal preference). Now, if I can somehow link Fedora's grub file to sense and read the Ubuntu kernel linux, I will be able to dual boot as required. For this I proceeded like this.

1-Boot system in Fedora.
2-After booting, open a terminal window (Applications > System Tools > Terminal)
3-su to root.
4-As root, run  fdisk -l to list the partitions on the system:

[root@Time-Machine ~]# fdisk -l | head -15

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf8000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2432    19530752   83  Linux
/dev/sda2            2432        6079    29294593    5  Extended
/dev/sda3   *        6079        6105      204800   83  Linux
/dev/sda4            6105       14593    68185088   8e  Linux LVM
/dev/sda5            2432        3040     4881408   83  Linux
/dev/sda6            3040        3648     4881408   82  Linux swap / Solaris
/dev/sda7            3648        6079    19529728   83  Linux

In the above, /dev/sda3 is the location of Fedora boot partition (indicated by *).
It also shows that /dev/sda1, /dev/sda5, /dev/sda7 (the three Ubuntu partitions as discussed above).
5-Mount the Ubuntu boot device (in this case /dev/sda5, as noted in the beginning of this blog).
[root@Time-Machine ~]# mount /dev/sda5 /mnt
[root@Time-Machine grub]# cd /mnt/grub
[root@Time-Machine grub]# vim grub.cfg
...
<<< go to the section that shows the boot menu entries like below >>
...
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod ext2
        set root='(hd0,5)'
        search --no-floppy --fs-uuid --set a2c4413e-051a-4479-bf86-403e4e115378
        linux   /vmlinuz-2.6.32-21-generic root=UUID=cf4be790-27f7-4c7a-a61b-0a326de514fc ro   quiet splash
        initrd  /initrd.img-2.6.32-21-generic
}

6-Copy the above lines in a temporary file like temp.txt
7-Then go to Fedora's /boot directory and open its grub.conf file.
[root@Time-Machine ~]# cd /boot/grub/
[root@Time-Machine ~]# vim grub.conf

...
<<< add the lines copied in step 6 above (ie from Ubuntu grub.cfg) and modify Fedora's grub.conf as shown in red below >>
...
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,2)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_timemachine-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,2)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.31.5-127.fc12.i686.PAE)
        root (hd0,2)
        kernel /vmlinuz-2.6.31.5-127.fc12.i686.PAE ro root=/dev/mapper/vg_timemachine-lv_root  LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us rhgb quiet
        initrd /initramfs-2.6.31.5-127.fc12.i686.PAE.img

title Ubuntu with Linux 2.6.32-21-generic
        root (hd0,4)
        search --no-floppy --fs-uuid --set a2c4413e-051a-4479-bf86-403e4e115378
        kernel /vmlinuz-2.6.32-21-generic root=UUID=cf4be790-27f7-4c7a-a61b-0a326de514fc ro   quiet splash
        initrd  /initrd.img-2.6.32-21-generic

Note: Since this is the grub.conf created by Fedora, its syntax is slightly different from that of grub.cfg on Ubuntu. Example instead of 'menuentry' it is called 'title', instead of referring to the kernel as 'linux' it is called 'kernel'.
Note: Also that grub names each disk device starting from 0. so /dev/sda1 is (hd0,0), /dev/sda2 is (hd0,1) etc. This means /dev/sda5 (the /boot partition for Ubuntu in this case) is (hd0,4)  in the 2nd line.

And Thats it. Now I saved the grub.conf and rebooted. And this time grub shows me the menu options for booting either Ubuntu or Fedora. So, everything works like a charm.

Have Fun. Linux is Fun.