Month: June 2004

Laptop Happy

After another session of troubleshooting I got my laptop up and running again. Here the story goes…Collecting a bunch of first HD sectors around my boxes convinced me that every first sector was different from the others. Scaring thoughts of trying all the 65535 values with a reboot in the middle were hitting my mind… but I had no better idea than this… Well to be honest I had a better idea – internetting to find the data structure of the first HD sector in order to put some proper values at offset 506.
This would have require an evening spent in front of my desktop in the other room, and neither my wife nor me would have appreciated 🙂 So I went the experimental way.
I started with 0x0000 value, anything magic with that, just a starting point, and rebooted.
The boot went fine and it happened to get over the ‘remounting root filesystem’ line just to produce a bunch of warnings such as: invalid swap partition, can’t activate swap and the like.
Anyway the system reached a usable state and I was able to login. First I launched fdisk and when issuing a ‘p’ command (print partitions) I was greet with a warning – logical end for partition /dev/hd4 different from physical end; plus some digits intended to help me in understanding the problem … I guess.
Well, if the problem is in the swap partition, maybe the best way to fix it is just to remove and re-create the swap partition. All this can be done without a reboot therefore it is worth a try.
After the reboot the box come up fine, and at last I stop holding my breath (my face should have been about blue in the face at the moment).
This morning while commuting I flipped just a couple of bits. I forgot to set the partition type to ‘Linux swap’ and to run the mkswap command on the partition. Lesson learned – don’t touch and watch astonished the blinken lights.

Harm Yourself with rdev and Superficial Reading

Fast reading technique is good to get the idea from a long document, but the more you use it the more you get accustomed and the more you use it without notice. That’s bad especially when you are dealing with something potentially dangerous – explosives, driving directions, contracts and … man pages. So when reading the rdev man pages I didn’t read it too carefully and missed the difference between kernel image and boot device. It didn’t help that the man page examples are quite misleading using many times the /dev/fd0 as kernel image synonym.
The rdev command (on Linux) works by chaining pairs of bytes at specific offsets in the kernel image. The usage of rdev is deprecated (I read this on man page O:-), since it is based on historical legacy and works only for x86 architectures.
Likely I was thinking about the grub boot code instead of kernel, so I launched rdev on /dev/hda and… it changed two bytes at offset 506,507. What did that two bytes contain? For sure not 0xFFFD since I guess this is the main cause for the boot failure of the notebook.
I hope this evening to verify my theory and eventually restore my notebook health.

The Too Short Blanket and Other Stories

Nothing of interest on tv last evening seemed a good excuse for some fun programming on my laptop while my wife watched some tv-drama. The next good excuse was to completely discharge batteries before recharging them, increasing their lifespan… and so on.Not to count that at last my desktop Linux PC was working and needed no more my caring attentions.
I switched my aging Toshiba on and waited for the good ol’ login screen… unfortunately the computer refused to proceed beyond the “remounting root file system in read/write mode” with a grinding sound. I started feeling uneasy.
That kind of sound and that kind of halt couldn’t be any good. So I restarted the thing, only to have it halted on the same boot line with the same sound. I’m not only very aficionado to my laptop, but to my fun programming stuff too. And the fact that it was nearly time to switch to a new laptop it wasn’t a good reason to die for it that way without a notice.
Time to get that Fedora Core 2 Rescue Disc I burnt on a mini-CD (nice).
The mini-CD booted without a glitch (while it took quite a time to get to the prompt), and I was dropped in a root shell.
I found the root partition by using fdisk, and then, after a bit of experiments with –help and some command line switches I launched:

fsck.ext3 -f -v /dev/hda2

And after some time astonished I learned that no problems were found. So I tried harder with a badblock thorough check:

fsck.ext3 -f -c /dev/hda2

And after more time and even more astonished I learned that the disk was really ok. To be really sure, I mounted the partition and chroot’ed there:

mount /dev/hda2 /mnt/source
mount /dev/hda1 /mnt/source/boot
mount proc /mnt/source/proc -t proc
chroot /mnt/source

And, yes everything worked, and my files was still there… I stopped holding my breath. Maybe it was just a transient problem. I rebooted and … no the system hadn’t been impressed by my exercise with the rescue disc.

Thinking of what could have caused that state I recalled about the ‘rdev’ command I twiddled with. My intention was to restore the text video mode at boot time in something suitable with the 800×600 resolution of the screen. In fact after having tried Knoppix I got the boot video resolution set to 640×480. Maybe that rdev could have messed up something, since it can control also the read/write mode of the root filesystem.
I had another round with rescue disc, mount and chroot, to run ‘yum update’. I got a lot of new stuff among which a brand new kernel. Useless to say but the update didn’t solve the problem. I hope to solve it soon without resorting to reinstalling Linux.

Maybe you remember the digital camera I got as bonus for “Beyond Good&Evil”. Well I discovered, to my surprise, that this is a real camera and is sold for about $38… The price is disappointingly high compared to the quality. I think that this camera can be successfully used only as a webcam. We used the camera to take some shots during a trek on “Corni di Canzo” only to discover the day after that no picture was present in the camera memory. My wife used the camera to shot some picture during a live concert and the result was more or less the same. Only 3/4 of a picture survived.
The battery lasted for no more than 100 shots. Consider that when the camera is connected to PC it should pull juice from the USB cable.
Definitively I don’t recommend this Vivitar camera to anyone.
The positive side of the story is that this experiences convinced my wife of the need of a (real) digital camera :-).

Fedora Done

Yesterday I had some time to waste on Linux, so I went on with my twiddling on Fedora Core 2. Despite this story was starting to be likely never-ending, I got the USB system to work. I’m not sure if I have to thank a new version of the kernel I yum’ed yesterday, or the ‘module_upgrade’ cast I invoked after some googling around. Anyway the USB flash disk is now properly working.I’m still perplexed about the new version of Nautilus that has not the directory tree view. You can ‘explore’ by choosing the proper item in the ‘hat’ menu, but when you double click on a folder on the desktop you get just the folder view. It was like that once upon a time on the Amiga… but nowadays we are used to tree views… And I feel they are really handy.

Fe-fe-fe… Fedora

Last Friday I got a gadget – a mini digital camera. I have never seen this kind of gadgets in local stores… I suppose either because the shop owners shame to have such a item or because they are too greedy and there isn’t enough margin. Anyway the camera is a ViviCam 5 (pdf reader required for the link). And since this is a gift, I’m very happy to have received it for free.
Friday I took some shots and then I wanted to download them to my PC. So I switched on my desktop system and discovered that… Fedora Core 2 messed up something with GRUB and my Windows didn’t boot.
I use Windows mainly for playing games and for compatibility, moreover I didn’t want to spent huge amounts of time to resurrect Fedora Core 2 support for USB.
Saturday morning I tried to solve the thing. Apparently it seems that FC2 installer is somewhat broken and doesn’t always handle correctly the multiboot issue.
Luckily on www.fedorafaq.org there is a brief description on how to fix and some links for more detailed explanations.
Fixing involves two invocations of ‘sfdisk’ which is a stream line version of fdisk (sfdisk is to fdisk, what sed is to vi). Unfortunately the solution proposed in fedorafaq doesn’t work because the first sfdisk is issuing some warnings about disk geometry. I remember I got the same warning during installation. It is easy to get rid of such warnings by using an intermediate text file as described in one of the links.
So far so good, the pictures weren’t great, but funny for sure.

While I was playing with Fedora I tried to put USB back to work. After a bit of investigation I discovered that apparently the kernel doesn’t find the usbcore module which is the base for handling USB. A quick search through Internet showed up that I’m not alone, there is at least another Internet user who had the same problem. Unfortunately he (or she) didn’t get any sensible suggestion apart than recompiling the kernel.

I’m not afraid of recompiling the kernel, but it’s more a question of principle, not counting all the goods I get with a standard kernel (such as pre-compiled drivers).
Still convinced that reinstalling is the way to go.

Fedora Core 2 – part 2

Upgrading my home PC to Fedora Core 2 proved to be the most troubled Linux upgrading I ever did. It’s likely I started with the wrong foot, but things got worse and worse during the way. It all began quite innocently with my decision of not reformatting Linux partitions. Well it’s just laziness since I didn’t want to backup my personal data. Laziness sometimes can be a virtue… not this time.
The second mistake was to instruct Fedora installer to ‘Install’ instead of ‘Upgrade’. My intention was good, I meant – get rid of all the old configuration, install a brand new system. Unfortunately the installer speaks another language and it understood something like: install the new system, but keep the old one altogether.
The resulting mess was a system in which most of the packages were duplicated, one FC2 version and one RH9 version. Oddly enough files weren’t duplicated… I mean the files on the disk replaced the old ones.
Configuration files were a mess, sometimes the new version was installed, in other cases just the opposite. To FC2 credit I have to state that no configuration was lost and all the conflicts were reported in the install.log.
I started to wipe out all the old packages by ‘rpm -e’ them by hand one at time. Luckily the system wasn’t too picky on the dependencies for these obsoleted packages and let me remove them quite freely.
Then I turned to configuration files and tried to merge them in a sensible result. The system seemed to react fine, but it was only appearance. At the first reboot the X system didn’t come up.
Logging in the text console I discovered that X-related programs weren’t able to find their shared libraries. A quick check confirmed me that the libraries were still in their place, so the problem had to be in the search for shared libraries.
This pointed me to /etc/ld.so.conf and ldconfig. The configuration file turned out to be empty… likely either I deleted inadvertently the content during my merge, or the system regenerated it (empty) for some reason. Anyway I filled in the X lib directories and gnome came to life again.
So far so good. The mail and spamassassin configuration seemed fine, and I was able to receive and send mails. I get through fedorafaq and applied all the enhancements listed (java, mozilla/java plugin, macromedia flash plugin, mp3, pdf).
Anyway the system proved to be still somewhat broken, since when I plugged in my USB disk, FC2 ignored it. I ran usbview to check the usb bus, but usbview wasn’t unable to find anything since the usbdevfs was missing. Apparently something in the kernel or kernel configuration was broken. The situation didn’t solve even after I downloaded and installed the NVidia NForce drivers.
That’s all… Likely I would have spent less time by reinstalling everything at the first sign of troubles. And I think this will be the way I go. Nonetheless all this problem solving is a good exercise. (Not clear for what, but a good exercise for sure 🙂 ).

Fedora Core 2

It’s now a week since the new version of Fedora has been released. I have attempted to install it on three system, therefore I collected a bit of experience in the operation.Rewritable CDs sounded like a good idea to store my favorite distro, given that it pops up in a new release every 6-8 months. Unfortunately Fedora doesn’t seem to like this kind of media too much, especially for its disc #2. Quite puzzling you can burn all the ISO images without errors. The trouble hits you during the installation.
If you choose the GUI installer be prepared that in case of media error the installation is aborted. You have to fix the defect and restart from scratch. While the good ol’ text installer is more forgiving – when it stumbles against a media error it let you choose between retry or restart.
The first “guinea-pig” was my old office PC – a dual P3 at 733Mhz, 512M RAM, one SCSI 9G HD and one EIDE 30G HD.
By letting Fedora installer doing the disk partition, only the EIDE device was used. So I get back and manually reconfigured the disks. I put /boot, swap and /usr on the SCSI, and /home and /var on the EIDE.
I am not sure if Fedora doesn’t like booting from a SCSI when it has an EIDE disk available, or the rewriteable media provided damaged packages, but the result is that this machine isn’t able to boot.
The second candidate was my notebook (Celeron 433Mhz, with 192M RAM, 6G HD). Apart from installing in text mode and frying a new CD, I got the system up and running. Anyway I installed over the old system (Fedora Core 1) and used a backup for my data.
The third system was my home PC (AMD 2600, 1G RAM, 120G HD). This time I opted for an installation, without reformatting the disc. My intention was to preserve my home directory content. Unfortunately the installer didn’t get my intention right and installed the new system together with the old one. After the end-of-install-reboot I got a system with all RPMs duplicated. This messed the system up significantly. Apparently I got some of the old and some of the new configuration. I started to remove old RPMs by hand, but I fear it is not the Right Thing to do.
I recommend a new install with a formatted HD. An upgrade should do well, but I haven’t tried since in the past the upgrades I made worked fine, but left the system in an hybrid configuration – the new system content with the old system behavior/look.
I installed every RedHat version since 4 (maybe I installed 3 too) several times. I find that RH8/RH9 were easier to install than FC2. Maybe I have been just out of luck, but having an easier installation for RH rather than FC may be not so unintentional, since it would be quite a strong selling point.
I read on slashdot that FC seems to sport a number of defects and annoyances. Anyway I found a good faq site that should help a lot for my next installation and configuration twiddling.