Monday, June 15, 2009

Converting Root Partition to ext4

Since I had updated the system to Fedora 11, the root filesystem was still ext3.
Boot directory is on a separate ext3 partition.

To get the maximum benefit of an ext4 system, I backed up the root. Reformatted it as ext4 and restored the backup.

The result - system would not boot. Booting into Ubuntu 9.04 and recreating the initrd after chroot to the Fedora 11 partition did not help.

I extracted the files in the initrd file and found that the change was simple. One line in 'init' file needed to be changed. The file system type had to be set to ext4 and the UUID changed to the current one.

mkrootdev -t ext4 -o defaults,noatime,nodiratime,ro UUID=6718a39a-2215-4e11-8716-455e7dcb11f4

Recreated the initrd file - remembering to use the cpio option -H newc

The system has been working fine.

Sunday, June 14, 2009

NetworkManager makes a difference

I finally managed to get NetworkManager to work for a fixed ip as well. It was really simple. Both system-config-network and nm-applet create the appropriate files.

Fedora includes a plugin - ifcfg-rh. This integrates the /etc/sysconfig/network-scripts with the NetworkManager settings. The line needed in ifcfg-ethX is:

Plugging/unplugging the cable enables/disables the interface.

The use of NetworkManager reduced the boot time by about 20 sec to 1 minute.

Unfortunately, too late for me to check out the same changes on Fedora 10

Saturday, June 13, 2009

Fedora 11 - the initial startup experience

The boot time is supposed to be faster. But what matters is what I would see on my system. I checked twice to confirm.

From the grub screen to the display of gdm screen with the same services:

1. Fedora 10: 1 minute 25 sec
2. Fedora 11: 1 minute 15-20 sec

Visible difference will come if the X is started asap and the services get started in the background.

Signing in to the startup sound on KDE:
1. Fedora 10: 35 or so sec
2. Fedora 11: 40 or so sec

So, the usable state of my system continues to be around 2 minutes. This may become longer whenever an fsck on a file system is needed.

For gnome, the signing in time has come down from approx 20 sec to 15 sec. Even then, the effective time for being able to use the system is over 90 sec.

Bringing up the network connections takes time. So, may be switching to network manager may shave a few more seconds.

Using icewm, the signing on time reduces to 5 sec though it takes time for the menu items to show up.

XFCE4 is usable in 10 to 15 sec.

Fedora 11 Upgrade - the unofficial way

I continue to believe in 'Fedora 9, May You Live a Hundred Years, Please!' that I wrote in Linux for You, April 2008. Any upgrade is a disruption. Still, I am addicted.

I continue my experiments with upgrading with minimal disruption - even though the elapsed time is much longer. The original source of this method:

I had used it to upgrade a system which had no CD/DVD and used the rpm's cached on a server.

The 'zeroth' step - 'yum update' to ensure that we have the latest updates.

The first step - download fedora-release from Fedora 11 repository and manually update the rpm.

This now ensures that yum will search Fedora 11 repositories. It is better that yum does a clean start. So,

$sudo yum clean all

Now, preferably in a screen session:
$sudo yum -y update
and sit back and do what you want.

Not entirely, I needed to erase some packages like 'VirtualBox' which had not been downloaded through one of the configured repositories.

I also had to erase 'Miro', 'ntp' and 'ntpdate' as the versions with the Fedora 10 update were higher than the ones in Fedora 11 at the time! 'ntp' and 'ntpdate' were installed as a part of dependency resolution. I installed Miro after the update to Fedora 11.

I restarted 'yum -y update'. Thirty hours later, 2.5 gb of data was downloade in about 2000 packages. The 'broadband' connection is 256K.

I had been hoping for a miracle. I had hoped that there would be delta-rpm packages for Fedora 10 to Fedora 11 updates! It would have reduced the time to below 10 hours of downloads. Who knows, it may happen for Fedora 12.

There was still 2 GB space available, but while running the transaction but before actually any update, yum complained that not enough space for some packages. I managed to increase the space to 3GB and the update succeeded.

The extra disk space used after the upgrade was .7gb. However, it needed just above 2 GB during the update process.

The use of screen was a life saver. There was a kernel failure and the konsole session died. However, yum update continued. The actual update took about 3 hours.

15 June: Came across this useful link

Saturday, June 6, 2009

More on Schools and Boredom

I got the motivation to post the above note after I got the following link.

So, I wasn't all that unusual in disliking school.

Schools Achieve 100% Results in Boredom

I came across the presentation by Sugata Mitra given in 2007 on the “Hole in the Wall” project (sugata_mitra_shows_how_kids_teach_themselves ). It puzzles me that we are aware of the shortage of teachers, the lack of resources and yet we do not seem to apply the lessons being learned regarding informal education, at least, not on a substantial scale.

Mark Shuttleworth made his money from technology, became the first South African in space, funded the creation of Ubuntu, a Linux distribution, and the home page of the Shuttleworth foundation quotes him, “If we are to lift Africa from her current circumstances, we will need a generation of learners that are gifted about the world in which they live, and the tools to understand and shape the world.”

Technology now offers us options which did not exist till even a decade ago. It is time that we re-think about schools, their role and the best approaches for enabling our children to learn. I regard that as important because I do not have any fond memories of schools.

As I approach the age of 60, the most painful memories are all of schools. My wife feels that cultural conflicts triggered by studying in the US in my teens is the cause. However, the bad memories go back much farther.

My first memory is that I wanted to drop out of kindergarten because of the painting activities. Children are supposed to love painting but I just couldn't paint the Indian flag. I would paint the saffron and then the white and the colours would mix and the result was terrible. Trying to draw the Ashok Charkra invariably resulted in a disaster. Why was I in a state of panic at that age that I just couldn't think?

The next memory is of trying to drop out of primary school. Having to memorise and repeat a set of seemingly random numbers - the table of 7 was horrible. It became worse when I had to memorise the table of 13. It still amazes me that I went on to study physics and mathematics. It could be that my experiences with English were even worse. I don't know if I ever succeeded in memorising 10 lines or so of "If you don't succeed at first". I wanted to drop out.

About a year after my father had been transferred to the US, we had a substitute teacher for physics one day. The topic we had been studying was conservation of momentum. The substitute teacher asked me what makes the planes fly. The answer or the absence of one still embarrasses me. How could I have been the 'best' student in physics and never even thought about its connection to the objects and events around us.

For the life of me, I cannot find a single memory of schools which I recall fondly. I cannot recall any teacher who influenced me or had a positive impact on me though there were teachers whom I liked very much. I did well in schools in spite of the mind being absent half the time. It makes me wonder if I was brighter or the other children had even more Calvin-like fantasies.

There was a sudden change when I reached college.

I wonder what was so different that I suddenly liked learning after coming to college. The main reason probably was the absence of boredom. There was no catering to the lowest common denominator. The professors were teaching what they liked. The passion showed. We were dumped with lots of information and it was our responsibility to assimilate it. Day dreaming in class was far less. The average number of hours spent on lectures was about 3 per day - 5 days a week. Scolding was subtle. "You don't seem to have liked the assignment. There were many careless spelling errors." Even today my behaviour is influenced by what I learnt in the psychology classes in college, although those subjects had nothing to do with my major - physics. Learning American history in college and coming across the critical analysis of it, especially, the impact on the local populations was really enlightening and mind blowing.

The same model may not work in schools. In fact, the above model may be inappropriate for colleges as well in today's world.

I would like to see schools offer a smorgasbord of toys which help children learn. A child may spend as much or as little time on a toy. Teachers should actively encourage children to learn from each other, rather than “do not copy” syndrome. A teacher need spend a few minutes to help each child get started – after that the learners explore independently or collaboratively. It is imperative that certification needs and learning objectives do not get entangled and confused with each other.

On second thought, I would be thrilled if schools implement any solution that eliminates boredom and tediousness from the lives of the students and teachers.

My son sent me this link and I had better get back to wasting time on Newtonian mechanics!

Fedora Live USB and Persistence

The disk of my 5 year old machine failed. I wanted to explore the possibility of using it from a 2GB flash disk. The liveusb creator of Fedora with persistence seemed very convenient. All I needed was a second machine to browse the net and use my primary desktop with ssh.

I wanted to add the usual multimedia applications and the persistence filesystem proved very flaky. Even backing up the persistence snapshot and installing rpm's - a few at a time did not work. The snapshot was repeatedly marked as bad.

Since the problem is likely to be the old hardware, a better workaround was needed. I did not wish to create a new live image from scratch.

I extracted and mounted the LiveOS image on the desktop and then add the desired packages to them. The steps were:

$ cp path-to-usb/LiveOS/squashfs.img .
$ sudo mount -oloop squashfs.img /mnt

Now extract the files from the squash file system
$ sudo cp -r /mnt live
$ sudo umount /mnt

Mount the ext3 image used by the LiveOS
$ sudo mount -o loop live/LiveOS/ext3fs.img /mnt

Add the repositories for rpmfusion as per but adding the root option.
$sudo rpm --root=/mnt -Uvh

Now, it was simple to use yum
$sudo yum -y --installroot=/mnt install gstreamer-plugins-bad gstreamer-plugins-ugly

The new squashfs can now be created

$ mksquashfs live squashfs.img

Finally, the new squashfs can be copied to the flashdisk.
As a precaution, I recreated the overlay file, e.g. a 256MB file as below

$dd if=/dev/zero of=overlay-FEDORA-6EB6-DB4C bs=1M count=256

I liked the Fedora 11 beta liveusb, but somehow, I could not get ssh -X to work with my Fedora 10 desktop. I will wait to try again but after the official release so that I can update the desktop as well.

Ubuntu uses a different mechanism for creating persistent storage on the USB disks. I plan to explore that as well and see if that is less flaky on my hardware.