Mauriat Miranda     mjmwired

Linux Kernel Documentation

Within every release of the official kernel source from kernel.org there is a provided /Documentation directory. This directory contains various notes, guides, tips, documentation, explanations and otherwise useful information. Majority of this content is provided in pure text format.

I thought it would be convenient if I could navigate through this infomation on the internet. So I decided to host it myself.

Information on my Kernel Documentation pages

Linux Kernel Documentation

I converted every file into web formatted pages with the following features:

  • All URL’s are converted to clickable links (anchors). (There are some bugs)
  • All email addresses have been (simply) obfuscated.
  • Every page is connected to the directory in which it resides.
  • All files have line numbers to easily point to specific content.
  • Line numbers can be temporarily disabled to allow for east cut-and-paste without numbers. (Javascript required)

I know that others have done this before, but I wanted to do this for my own personal usage and convenience. I wanted to be able to link to content easily from my own Linux Resources guides and documentation.

I tried to put in as many features as I thought would be helpful for myself as well as others. However I wouldn’t mind adding more features for others.

I will try to update with every new kernel release that has updated documentation files.

Finally I want to express my appreciation and respect for every person who has contributed to the Linux kernel and to open source projects in general. The content provided is from the official kernel source and copyrighted its respective authors.

Moving a Fedora Installation

With the recent purchase of a new harddrive I did not want to re-install every operating system on my previous drive. Since I dual boot with Windows, I first attempted to copy Windows. I tried multiple solutions and Norton Ghost met my requirements however a problem in 48bit LBA (Logical Block Addressing) in Windows 2000 caused too many problems. In the end I re-installed Windows. (Note: Linux does not have this problem). After Windows, I continued to my Fedora Core 5 installation.

Linux can be just “copied” and should work. I decided to test that out!

  1. First I made sure that through the Windows installation I left the required space on the new harddrive for Linux.

  2. I booted with FC5 CD 1 and selected linux rescue. This should provide enough tools. It gives a prompt to mount an existing Fedora installation. However I selected “Skip”.

  3. I created all the partitions I wanted for the new harddrive (see the previous post for my layout). I used fdisk to partition and mkfs to format the partitions to EXT3. It is important to remember to create a SWAP partition!.

    Note: Most people will only have 1 or 2 partitions: the main / and /home.

    Note: It is much easier to use a LiveCD with a graphical tool (gparted or Knoppix) to create the partitions.

  4. After the partitions were created, I had to copy - which takes the longest time. I needed to mount both old and new partitions to copy. My new 300GB drive is /dev/hda and previous 120GB drive will be /dev/hdb (mounted read-only). It is important to note the proper partition numbers for each drive!

# cd /mnt
# mkdir fc5.old
# mkdir fc5.new
# mount -t ext3 -o ro /dev/hdb10 fc5.old
# mount -t ext3 -o rw /dev/hda7 fc5.new
# cp -a /mnt/fc5.old /mnt/fc5.new

I had to repeat the copying step for each additional partition I copied (i.e. /home)

  1. Next I had to edit (using nano) the grub booting setup (/boot/grub/grub.conf) and the filesystem mounting information (/etc/fstab). (See update note below.) This was the trickiest part.

Edit grub:

# nano /mnt/fc5.new/boot/grub/grub.conf

Grub requires the root and kernel lines to be modified: Since /dev/hda7 is (hd0,6) I changed root (hd0,9) to root (hd0,6). The kernel also requires a root= parameter which can take a label or device. Previously my root device was /. So the change I made was from:

kernel /boot/vmlinuz-2.6.16-1.2080_FC5 ro root=LABEL=/

to:

kernel /boot/vmlinuz-2.6.16-1.2080_FC5 ro root=/dev/hda7

Edit fstab:

# nano /mnt/fc5.new/etc/fstab

The filesystem list (fstab) is similar to grub. I needed to make a change for 3 partitions: /, /home and SWAP. (Any NTFS or FAT32 partitions can also be listed here).

Changed from:

LABEL=/       /            ext3    defaults   1 1
/dev/hda13    swap         swap    defaults   0 0
LABEL=/home   /home        ext3    defaults   1 2

to:

/dev/hda7     /            ext3    defaults   1 1
/dev/hda15    swap         swap    defaults   0 0
/dev/hda13    /home        ext3    defaults   1 2
  1. The final step was to re-install grub so that the partition can actually boot. I have grub on the / partition (/dev/hda7) instead of the MBR (/dev/hda). To install grub I did the following:

    # chroot /mnt/fc5.new/
    # grub-install /dev/hda7
    
  2. I rebooted and I went to Windows and proceeded to install bootpart to use the NTLDR to boot grub as stated in my FC5 Install Guide. (However had I installed to the MBR, this wouldn’t be needed.) Once setup in Windows, rebooted again and booted into Fedora!

Now this took a little tinkering. I accidentally made some mistakes on partition sizes when formatting and accidentally set the wrong values in both grub and fstab. So I had to go back and forth a few times. Luckily I had the old harddrive with a perfect backup.

This was an interesting experience. It did save me the time to do a full re-install of Fedora and to install all the updates and additional configuration. This time it took a few hours to get correct, but next time I imagine I could do it in 30 minutes or so.

Hopefully someone else can learn from this.

Update: Step 5. above can be simplified if the e2label command properly is properly used. Example:

# e2label /dev/hda7  /
# e2label /dev/hda13 /home

This should allow for the new drive to use the same labels as the old drive. However using the physical device partition numbers (/dev/hdX) is gauranteed to work, whereas sometimes labels can get confusing (or fail).

Posted in: FC5, Fedora, Linux, Setup,

Partitioning for 300GB

My new Seagate Barracuda 300GB hard drive just arrived. I’ll need some time to redo my entire computer (currently there are 4 operating systems). Whenever I purchase a new harddrive (about once ever 2 years) I always put some serious evaluation into how I will partition it.

Some points I consider

  • Windows is primary operating system
  • A second Windows should be possible
  • Windows should have at least seperate ‘applications’ and ‘work’ partitions
  • Multiple Linux distributions should be possible (2-3)
  • Swap partition can be shared in Linux
  • At least /home partition should be shared in Linux

In truth I only have about 3-4 GB of actual work and about 6-8 GB of media to save. I also do not play any games or do any major video editting which leaves for a great deal of flexibility.

The 300GB is misleading. Given 300x1000^3 bytes, you will actually have about 279GB since each KB is 1024 bytes and so forth.

My current scheme for 279GB:

  • NTFS - Primary - 16GB - Windows 2000 (currently using)
  • NTFS - Primary - 16GB - Windows XP (testing only)
  • NTFS - Primary - 16GB - Open (possibly Windows Vista?)
  • Extended - remaining
    • NTFS - 40GB - Applications (shared all Windows)
    • NTFS - 40GB - Data/Work (including all saved materials + including Media)
    • EXT3 - 14GB - Linux 1 - Latest Fedora Core Release
    • EXT3 - 14GB - Linux 2 - Previous Fedora Core Release
    • EXT3 - 14GB - Linux 3 - Latest Fedora Core Test Release
    • EXT3 - 14GB - Linux 4 - Possible x86_64 (pending hardware purchase)
    • EXT3 - 14GB - Linux 5 - to be determined
    • EXT3 - 14GB - Linux 6 - to be determined
    • EXT3 - 32GB - /home - shared
    • EXT3 - 32GB - /data - shared
    • SWAP - 2GB

Some notes I would like to mention from experience and what I’ve researched.

  • Bootable Partitions - There are no /boot partitions required since the newer bootloaders (i.e. grub) and modern BIOS’s do not impose any limitations on booting from an Extended partition. However Windows has always been fussy, hence I leave them on a Primary partition regardless.
  • Multiple Distributions - I am not sure if I need space for 6 different distributions, although if I do purchase an AMD 64bit system in the near future, then this will be required as I may wish to test as many 64bit Linux distributions as 32bit.
  • Multiple Windows - Additionally I’m not sure if I wish to test 2 alternate Windows versions. Currently Windows 2000 suits my needs, but future hardware may force me to use XP or something else.
  • NTFS vs FAT32 - Currently FAT32 is read and write in Linux, however NTFS is read-only. There are some options for write to NTFS, but I don’t find them very reliable. Using FAT32 in the past has caused data loss multiple times, hence I no longer use it.
  • SWAP - I recall reading that you should have at least as much swap as you do have physical memory to support things like Software Suspend to Disk (S4 - “Hibernate”). I currently have 1GB memory, if I upgrade to 2GB, I may require more space.
  • LVM - Logical Volume Management - I lack experience in LVM but with my current configuration, every single operating system can at least read every other partition (e.g. EXT3 in Windows). I am unsure how I can achieve this using LVM.

There will probably be some reassigned space before I decide on the final layout, but I am sure the above will work well for me.

I am not recommending the above for anyone! This is only just some planned out reasoning so that I never really have to sacrifice any properly configured operating system so I can try or experiment with a new OS. For anyone who may comment about emulation or virtualization - I do not feel it is practical to truly test certain aspects of the OS.

Posted in: Devices, Miscellaneous, Setup,

PHP4 on Fedora Core 5

Apparently some developers still require PHP4 on their web servers. The previous method for doing so on Fedora Core 4 (FC4) was to use the FC3 RPM’s. (A formal procedure was provided by the guide: PHP4 on FC4.)

Since the release of FC5, the dependancies and outdated linking from the FC3 RPM packages may be difficult to resolve. It is recommended to recompile the PHP4 SRC.RPM and link it to the running software provided in FC5. However, there are some needed changes to the SRC.RPM. There is a modified source RPM package provided on the following guide:

PHP4 on Fedora Core

Steps provided should work for FC5 as well as FC4. There are some precompiled binary RPM’s provided as well.

These have only been tested by myself. I would appreciate it if anyone can report as to how well these work!

Posted in: FC4, FC5, Fedora, Hosting, PHP,

To Deutschland

When I started this blog it was a “fork of thoughts” from my main blog with a focus on software and linux. So how does a trip to Germany fit it? I decided I would try to take note of the basic differences I observed in computing. Granted Windows is used in far more public places that people realize (i.e. flight status monitors), but people don’t realize that Linux is used in just as many in on different scales.

Curious experience with in flight movie service.

When I flew to India in 2004 the airline carrier I flew provided a service similar to television. There were several “channels” which one could browse through and select, so that everyone viewing that same channel would be watching the same thing. However on this trip, the airline carrier had entertainment on demand service. There were several options: Movies, Music, Information and Games. Using your hand control you could watch any movie (fast forward, pause, stop) or select through hundred of songs or a few games. So the network in place had to provide 250 or more(?) unique feeds to passengers. How was this accomplished? Linux of course.

Sadly, I wish I did not know that. Why? The only reason I was able to determine this, was because the in-seat displays would reboot. Often! For a breif moment you could see the Linux penguin on the kernel boot information and then if you knew what you were seeing, there was a flash of the “X” cursor (which is part of the X-server) before the navigation system launched. Once running it was very nice but stabilty is just as nice. My system as well as the person next to me, infront of me and 2 of the 3 main public screens rebooted at least once.

Of course, this is all really irrelevant. A poorly configured system really has nothing to do with its components, but for a multi-million dollar (possibly global) deployment, the bugs should be out of the system! Glad to see Linux out there, but people might get a bad impression. That is … if they knew.

Posted in: Devices, Linux, Miscellaneous,