Archive for May, 2009

How do I upgrade a Linux distribution?

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

It is a good idea to follow this checklist when upgrading:

- Log in as root.
- Make a copy of the /etc directory to some place where it won’t be distroyed (e.g., zipdrive). This will let me have a look at your previous setup in case I encounter problems.
- Make a backup of any valuable data in the /home directory. This is just in case something went really wrong, for example, if I happened to format a wrong partition.
- Determine and write down the mountpoints on your filesystem using the “diskfree” command:
df
For example, if on the system it shows that the /home my home directory is mounted on a separate hard drive partition called /dev/hda9. and the directory /usr/local is on /dev/hda8. I will write this info on a back of an old envelope.

- Perform the installatation of Linux, but tell the installer to mount the partitions /home and /usr/local at their previous (existing) locations. DO NOT re-format these two partitions. This is critical if you want to preserve your data.
- Boot the new installation and check that it works.
- For each user on the system, create a login with the old name and old user ID number, for example,
ls /home/Shafkat/* -l (check the user ID for account “shafkat” in the file listing of her home directory),
useradd Shafkat -u 503 (create a user acount “shafkat” with with an example uid “503″).
The users will have to select new passwords. If you have lots of users, instead of re-creation of all the accounts you would edit the old and new versions of three files: /etc/passwd, /etc/shadow and /etc/group and copy-paste the relevant user information from the old files to their newer versions (one lines per user in each of the two files, one line per group in the third file).
- From each user home directory, delete the potentialy troublesome setup files, e.g.: “.kde”, “.ICE*”, etc. Good oportunity to delete any junk too. Some setup files may be troublesome because the new version of kde is likely to perform better with the most recent default settings (it will create them on first startup). E.g.,
cd /home/shafkat
rm -fr .kde
- Make sure that each remaining file in the home directories belongs to the appropriate user. For example:

cd /home/shafkat
chown -R shafkat *
chgrp -R shafkat *

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

How do I crash Linux?

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

The command as provided below will prove useful if you really want to crassh:

cp /dev/zero /dev/mem

As root, you can even erase all the files on your system with a similarly innocuously looking one-liner (don’t do it):
rm -fr /

This is not to say that Linux is easy to crash, but that the system administrator (”root”) has the complete power over the system. You can make MS Windows unusable by trashing some files from C:\WINDOWS OR C:\WINDOWS\SYSTEM directory. An important distinctions that makes Linux resiliant is that the user and administrative accounts are separated. Regular users can touch only the files they own, and similarly the programs which users run can only junk user-owned areas, no matter how buggy or malicious a program might be. The separation of “administrative” and “user” accounts adds to system complexity, yet it also makes the Linux system truly multi-user. This is unlike the old MS Windows approach. With the latest version of MS Windows, Microsoft moves more towards the UNIX approach. An old saying comes to mind: “those who do not know UNIX are destined to re-invent it”.
Conclusion: do not use the root account for routine work. Add a regular-user account as your first administrative task and use this account for your experimenting with Linux and regular work.

Here is how to do it (as root):
adduser shafkatshahzad
passwd shafkatshahzad
[enter a good long password with a number in the middle]
[reenter the same password without a mistake]
exit
[login as shafkatshahzad]
The root account is for administration and setup only. As root, I would not do things/run programs that I do not exactly understand what they do. At least not on a computer that I plan to use for real work. Really. I would definitely not browse the net as root (that is an absolute security no-no).

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Make a USB Boot CD for Ubuntu

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

The tutorial guide will provide you with a step-to-step guidance on how to make a USB Boot CD for Ubuntu. This USB Boot CD can be used to boot a Ubuntu 8.10 USB flash drive on computers with a BIOS that does not natively support booting from USB. The boot CD contains a grub bootloader that loads the initrd and vmlinuz kernel from the CD and then proceeds to locate the filesystem on the USB flash drive. Because the USB drivers are preloaded from the initrd on the CD, the USB flash drive can then easily be detected.
Could also be used to Boot Ubuntu from a USB Flash Drive on Apple Mac, Macbook and, Macbook Pro.
It is important to note that this USB Boot CD should work on most older systems. However, it has been noted from testers that some systems with hardware that only supports USB 1.0 may not work.
The tutorial guide can be used to boot flash drives created using the USB Ubuntu 8.10 tutorial.

USB Boot CD for Ubuntu 8.10 creation essentials
It is a good idea to make a note of USB Boot CD for Ubuntu 8.10 creation essentials. These are as below:
• PC with a BIOS that does not support booting from USB
• Working CD Drive and USB Port
• Ubuntu 8.10 Live CD
• USB flash drive with Ubuntu 8.10 preinstalled

How to Create a CD to Boot Ubuntu from USB
The following process will enable you to create a Boot CD that can be used to Boot Ubuntu 8.10 from a USB Flash drive on systems that do not natively support booting from USB.
1. Insert the Ubuntu 8.10 Live CD and restart your computer, booting from the CD
2. Open a Terminal and type mkdir -p ubcd/boot/grub
3. Type cp /usr/lib/grub/i386-pc/stage2_eltorito ubcd/boot/grub
4. Type gedit ubcd/boot/grub/menu.lst
5. Add the following information to your menu.lst file and save it to ubcd/boot/grub
title Run Ubuntu 8.10 from USB DISK
root (cd)
kernel /boot/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper noprompt cdrom-detect/try-usb=true persistent quiet splash
initrd /boot/initrd.gz
boot
6. Type cp /cdrom/casper/initrd.gz ~/ubcd/boot
7. Type cp /cdrom/casper/vmlinuz ~/ubcd/boot
8. Type mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o usbcd.iso ubcd
9. Burn the usbcd.iso to a CD

Booting from the USB Boot CD
1. Shutdown your computer
2. Insert both the Boot CD and the Ubuntu 8.10 USB flash drive
3. Set your BIOS or Startup Menu to boot from CD
4. Start your computer (booting from the CD)
If all the instructions as provided in this tutorial guide are being followed, then CD should load the necessary USB drivers, detect your
USB device and proceed to boot Ubuntu 8.10 from the flash drive.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

USB KNOPPIX 5.1.1 persistent install from Linux

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

The tutorial guide will provide you with a step-to-step instructions on how to install Knoppix 5.1.1 to a USB flash pen drive. It is also possible to use the persistent feature after completing this tutorial allowing you to save changes back to the stick. Knoppix is a fully featured Linux distribution based on Debian. It was created by Klaus Knopper. Knoppix has always been feature packed, including hundreds of useful tools and applications not included by default with most other Live Linux distributions.

USB Knoppix installation essentials:
It is important to note the USB Knoppix installation essentials. These are provided below:
• Knoppix 5.1.1 ISO
• CD Recorder
• 1GB or larger USB stick

Knoppix 5.1.1 USB Installation process:
Now, let’s go through the installation process:
1. Download the Knoppix 5.1.1 ISO and burn it to CD
2. Insert a 1GB or larger USB flash drive
3. Restart your Computer and boot from the Knoppix CD
4. Open up a terminal and type sudo su
5. Type fdisk -l note which drive is your USB stick (I.E: sda) Throughout this tutorial we use x as our flash drive letter. Replace x with your actual flash drive letter. For example, if your flash drive is sdb, replace x with b.
6. Type umount /dev/sdx1
7. Type fdisk /dev/sdx
1. type p to show the existing partition and d to delete it
2. type p again to show any remaining partitions (if partitions exist, repeat the previous step)
3. type n to make a new partition
4. type p for primary partition
5. type 1 to make this partition one
6. hit enter to use the default first cylinder
7. type +750M to make the partition 750 MB
8. type a to make this partition active
9. type 1 to select partition one
10. type t to change it’s file system
11. type 6 to select the fat16 file system
12. type n to make another new partition
13. type p for primary partition
14. type 2 to make this the second partition
15. hit enter to use the default first cylinder
16. hit enter again to use the default last cylinder
17. type w to write the new partition table
8. Type umount /dev/sdx1 to ensure the partition is unmounted
9. Type mkfs.vfat -F 16 -n usb /dev/sdx1 to format the first partition
10. Type umount /dev/sdx2 to ensure the partition is unmounted.
11. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
12. Remove and reinsert your USB flash drive
13. Type mkdir /tmp/usb
14. Type mount /dev/sdx1 /tmp/usb
15. Type cd /cdrom
16. Type cp -rf KNOPPIX boot/isolinux/* /tmp/usb
17. Type cd /tmp/usb
18. Type mv isolinux.cfg syslinux.cfg
19. Type cd
20. Type umount /tmp/usb
21. Type syslinux -sf /dev/sdx1
22. Reboot your computer and set your system BIOS or Boot Menu to boot from the USB device. Save your changes and restart your PC, booting from the USB device.

If all the guidance is being followed as provided in this tutorial guide, then you should now be able to boot Knoppix 5.1.1 via your USB stick. Proceed to use the Knoppix Persistent feature to save your changes back to the stick

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Qemu Persistent Knoppix

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

The tutorial guide will provide you with a step-to-step instructions on the process of running Knoppix persistently from a portable USB flash drive using Qemu from a Windows 98, XP or Vista host PC without ever rebooting. Most of your personal settings and changes are automatically saved back to the stick and restored at boot via the Persistence image. This is accomplished using Qemu emulation software in conjunction with a persistent virtual hard disk image file for saving and restoring changes.

Qemu Knoppix basic essentials:
It is important to note the Qemu Knoppix essentials. These are provided below:
• 1GB + USB flash drive
• A Windows Host computer
• Knoppix ISO
• QKB.exe

Qemu Knoppix USB installation procedure:
Now, let’s go through the installation process.
1. Download QKB.exe and run, a QKnoppix folder is created
2. Download the Knoppix Linux ISO and move it to the QKnoppix directory
3. Click the LaunchKP.bat from the QKnoppix folder to start Knoppix
4. Press Enter at the boot prompt
5. At the Knoppix-Configuration prompt, to use the home persistence option, Click OK

If all the instructions and guidance is being followed as provided in the guide then you should now be booting into Knoppix via Qemu

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Linux Mint 6 KDE Flash Drive Install via CD

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

The tutorial guide will provide you with a step-to-step instructions on how to put Linux Mint 6 Felicia KDE on a USB Flash Drive via the USB-Creator (created by Ubuntu). The Linux Mint 6 KDE edition is based on Kubuntu 8.10 Intrepid Ibex, the Linux 2.6.27 kernel and, Xorg 7.4. The KDE version of Linux Mint ships with KDE 4.2 and Amarok 2.0.

USB Linux Mint 6 KDE creation essentials:
It is important to note the USB Linux Mint6 KDE creation essentials. These are provided below:
• 2GB or larger USB device
• LinuxMint-6-KDE.iso (+ a torrent client to perform the download)
• DVD Reader/Burner

Installing Linux Mint 6 KDE to a USB Flash Drive via the Live CD
Now, let’s go through the installing process.
1. Download the LinuxMint-6-KDE.iso.torrent
2. Proceed to download the ISO using your favorite torrent client
3. Burn the ISO to a DVD
4. Start your Computer from the Linux Mint DVD
5. (1) Click the Linux Mint Start Menu Icon (2) From the search box, type term (3) click the Terminal option that appears
6. From the Terminal, (1) Type sudo su and press Enter. Then Type apt-get install usb-creator and press Enter
7. Once the USB Creator screen appears, insert your USB Flash Drive
8. (1) Select your USB disk to use from the list (2) Select the option Stored in reserved extra space and (3) drag the slider for the capacity you would like to use for storing changes persistently (4) Click Make a Startup Disk
9. The USB Creator will now proceed to install Linux Mint 6 KDE edition to your USB device
10. Once installation has finished, click Quit
Correcting the Linux Mint 6 KDE syslinux.cfg file:
Although the installation is complete. The syslinux.cfg file still needs to be modified to allow for persistence.
1. Download (right click and save link as) the new syslinux.cfg file that contains the persistence menu option
2. Copy the new syslinux.cfg file to the syslinux directory on your USB device, overwriting the old syslinux.cfg file
3. Finally, reboot your system, remove the Linux Mint DVD and set your boot options to boot from the USB device
If all the instructions are followed as provided in the tutorial guide then you should now be presented with your very own USB Linux Mint 6 KDE edition that will allow you to save and restore your basic changes.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

USB Ubuntu NetBook Remix Install via Windows

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

The tutorial guide will provide you with a step-to-step instructions on installing USB 9.04 NetBook Remix to a Flash Drive by using Windows. Ubuntu offers their own Ubuntu Image Writer. This tool enables a user to create a Ubuntu NetBook Remix USB Flash Drive from a disk image. The Portable Ubuntu NetBook operating system can then be run portably from the Flash Drive without installing or installed to your Netbook from the Flash Drive. USB Ubuntu NetBook Remix Flash Drive installation is simple.

How to Install Ubuntu NetBook Remix on USB from Windows
Now, let’s follow the steps as required to install Ubuntu NetBook Remix on USB from Windows.
1. Download the Ubuntu 9.04 NetBook Remix Image to your desktop
2. Download the Disk Imager (used to copy the image to USB) and unzip the package to your desktop
3. Insert your USB device, making note of it’s drive letter
4. From the Disk Imager folder, click Win32DiskImager.exe
5. (1) Browse to the ubuntu-9.04-netbook-remix-i386.img file on your computer (2) Select your USB device from the dropdown (3) Click the Write button to copy the image to your USB device.
6. Once the Disk Imager has completed, restart your computer, set your BIOS Options or Boot Menu to boot from the USB device and reboot
If everything is followed in the tutorial guide, then you should now have a Portable USB Ubuntu 9.04 NetBook Remix that you can run as an alternate Live operating system from the USB device or install on your Netbook via the built in Ubuntu Netbook Installer.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

USB Kubuntu 9.04 Persistent Install (Windows)

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 16th, 2009

The tutorial guide will provide you with a step-to-step instructions on how to install Kubuntu 9.04 to a USB flash drive using our custom batch installer within Windows. A product of canonical ltd, Kubuntu 9.04 features the popular, elegant and awe inspiring KDE desktop environment. This tutorial makes use of the casper persistent loop file (casper-rw) for saving and restoring most preferences, changes and downloads.
USB Kubuntu 9.04 Flash Drive Creation Essentials:
It is important to note the USB Kubuntu 9.04 flash drive creation essentials. These are provided below:
• Windows PC to perform conversion
• Kubuntu 9.04 ISO
• 2GB or larger USB flash drive (Fat32 formatted)
• Ku904p.exe (contains the files to do the conversion)

Creating a Live Kubuntu 9.04 USB Flash Drive:
Now, let’s go through the process of creating a live Kubuntu 9.04 USB flash drive.
1. Download and run KU904p.exe, extracting the contents to your PC. A KU904p folder is automatically created
2. Download the Kubuntu 9.04 torrent and proceed to download the ISO using your favorite bittorrent client
3. place the Kubuntu 9.04 ISO in the KU904p folder on your PC
4. From the KU904p folder on your PC, click KU904.bat and follow the onscreen instructions
5. Once the script has finished, restart your PC and set your BIOS or Boot Menu to boot from the USB device, save your changes and reboot
You should now be able to boot from your own Live USB Kubuntu 9.04. In addition any changes that you make should be saved and restored on subsequent boots.
Persistence size: The default casper-rw loop file that becomes the partition for saving changes is only 1GB. If you have room and would prefer to use more space for saving changes you can download one of the following zip files and extract the new casper-rw file to your USB device, replacing the old one.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists

Installing Debian Linux 2.2 (Potato)

Posted in How To's by Shafkat Shahzad, M.Sc - Senior Technical Content Manager on May 7th, 2009

The tutorial guide will provide you with information about how to install Debian Linux 2.2 (Potato)
The Potato (2.2) version comes on 3 CDs because it includes not only the operating system but nearly 4,000 packages containing software for applications, utilities, and OS enhancements

Installing the OS

The following procedure was developed installing the Debian “potato” (2.2r3) release on a Pentium II-233 clone with 128 meg of RAM, a 4-gig IDE hard-drive, and an IDE CD-ROM drive connected as the master on the secondary IDE channel. If you are installing Debian (or any Linux distro for that matter) on a name-brand system, which are inherently proprietary, you may run into some problems. In these cases it’s best to check the support pages on the hardware vendor’s Web site. Using the following routine on hardware with different configurations may also result in different prompts or windows appearing. It’s important to READ the information presented on the various screens during the installation.

If you’re using an older Pentium system with an older BIOS that doesn’t allow for booting off of CDs, you’ll have to use a Windows system to create two boot floppies. (They even have boot disk images for the old 1.2-meg 5.25-inch floppy drives if that’s what’s set up as the A: drive on your soon-to-be Debian system.) To create the boot floppies on a Windows system get two formatted diskettes and:
1. Put the Debian CD #1 in the Windows system CD drive and a blank formatted floppy in the floppy drive.
2. Open a DOS window and switch to the CD drive. On most systems this will be the D: drive so type in the letter D followed by a colon and press Enter.
3. Go to the directory containing the disk creation program by typing in the following at the DOS prompt:

cd \dists\potato\main\disks-i386\2.2.23-2001-04-15\dosutils

(The part of the path in blue may be different on your system. Use Windows Explorer to go down the directory tree on your CD to verify the above path.)
4. If your A: drive is a 1.44-meg 3.5-inch floppy, enter the following two commands to create the two floppies:
rawrite2 -f ..\images-1.44\rescue.bin -d a
(insert the second floppy)
rawrite2 -f ..\images-1.44\root.bin -d a
5. Label the two disks “Boot Disk #1″ and “Boot Disk #2″ in the order they were created. If your A: drive is a 1.2-meg 5.25-inch floppy drive, replace the blue part of the above commands with images-1.20

Now that you’ve got everything you need you can go to the system you’ll be installing Debian on and begin the installation procedure.
1. Insert CD #1 into the CD-ROM drive and boot the system off of it. In the case of a non-bootable CD-ROM drive you still want to insert CD #1 in the drive but also insert the floppy Boot Disk #1 in the A: drive and boot the system. (You’ll be prompted for the floppy Boot Disk #2 during the boot process.) The Welcome screen appears so hit Enter. The Release Notes screen is displayed with Continue highlighted so hit Enter and the Installation Menu will appear

The Installation Menu has two parts - upper area has a Next: and Alternate: and possibly an Alternate1: selection - lower part is the steps that you will progress through using the Next: selection
2. If your hard-disk has existing partitions blow them away now (this includes any existing Linux partitions if you’re redoing an install):
o Arrow down to Alternate1: Partition a Hard Disk and press Enter to run the cfdisk partitioning utility. If you’re installing Debian onto the first hard-drive, highlight /dev/hda (for IDE drives) or /dev/sda (for SCSI drives). If you only have one hard-drive it will already be highlighted. Pressing Enter will display a screen about Lilo limitations. If you have an older system (which will have an older BIOS) you should read this.
o Pressing Enter with Continue highlighted will start cfdisk and the existing partitions will be displayed. (The up and down arrow keys will hightlight partitions in the upper part of of the cfdisk display. The left and right arrow keys highlight the available menu selections in the lower part of the display.) Use the arrow keys to highlight them and select Delete. After all partitions have been deleted, be sure to select the Write selection to update the partition table or nothing will change.
o After writing the updates to the drive’s partition table you’ll be back at cfdisk’s main screen. Highlight the Quit selection and press Enter to return to the Installation menu.

3. With the Next: Configure the Keyboard highlighted, press Enter and U.S. English (QWERTY) will be highlighted. Just press Enter if this is your desired selection and you’ll be returned to the installation menu with the Next: step highlighted.
4. This next step partitions the drive you may have just unpartitioned above. With the Next: Partition a Hard Drive selected press Enter.
o The first screen displays the list of connected hard-drive(s). Usually there’s only one drive and it’s already highlighted. If you have more than one IDE drive select /dev/hda for IDE drives or /dev/sda for SCSI drives and press Enter.
o The Lilo warning about 8-gig or larger drives on older systems with an older BIOS is displayed with Continue highlighted so just hit Enter to start cfdisk.

Note: The top part of the cfdisk display lists the partitions and free space and you use the up and down arrow keys to select those. The lower part of the display are the available menu options and you use the left and right arrow keys to select those.
o You should have a single line that says Pri/Log Free Space with the total free space on the disk displayed on the right. Right arrow over to the New selection and press Enter.

Note: You need to create a root partition and a swap partition (for virtual memory). You typically want a swap partition with a size that is double the amount of RAM in your system. For example, if you have 64 meg of RAM, you’ll want a swap partition that’s 128 meg in size. Be sure to set a root partition size which leaves enough free space for the desired-size swap partition.

Note also: If you have a large disk, you may want to leave a gig or two free for partitioning as other file types. As you will see, cfdisk can create a huge variety of partitions and you may want to try creating a FAT16 (DOS), Win95 (FAT32), or NTFS partition later to experiment with exchanging files with other platforms. For example, with a 4-gig disk I’ll size the primary (Linux) partition to 3 gig. With a 256 meg swap partition, this leaves a little less than 1 gig free for later experimentation.
o With Primary highlighted press Enter but don’t accept the default partition size value. This default is the entire disk and you won’t have any room left for a swap partition. Enter a size in megabytes using the considerations mentioned above (3000 MB in my example).
o Once you’ve entered a value and press Enter you’ll be given options as to where to locate the primary partition. Accept the default Beginning option and press Enter and the new partition will be displayed.
o Press the down arrow key to highlight the free space and use the right arrow key to highlight the New selection and press Enter and again accept the Primary selection by pressing Enter.
o The default partition size value is whatever disk space remains. Enter the desired size of your swap partition (I used 256 due to my system having 128 meg of RAM) and press Enter. You will again be presented with the location selection and you can just accept Beginning and press Enter.
o With this new partition highlighted, arrow over to the menu selection Type and press Enter which will display some of the different partition types cfdisk supports. Note at the bottom of the screen is a prompt that says Press a key to continue and when you do even more partition types will be displayed.

At the bottom of this second screen of partition types you’ll see the Enter file system type: with the value defaulted to 82. This is the Linux Swap type which is what we want to just hit Enter.
o You should now have listed the root partition, the swap partition, and any free space remaining. Be sure to arrow over to the Write menu selection and press Enter so that all your changes get written to the disk’s partion table.
o Once the partition table is updated arrow over to the Quit selection and press Enter to exit out of cfdisk and return to the installation menu.

5. The installation menu will automatically highlight the Initialize and Activate a Swap Partition (hda2) so you can just press Enter. If you want to scan for bad blocks (a good idea even with new drives) Tab to No at the prompt asking you if you want to skip the scan and press Enter, and then answer Yes at the Are you sure? prompt.
6. You are then prompted to initialize the Linux Native partition (the first parition you created - hda1). When you select to do this you are asked if you want to retain Linux 2.0 kernel compatibility. Accept the default Yes and press Enter.
7. You are again presented with the option of skipping the scan for bad blocks. Again, Tab to No and press Enter, and again answer Yes to the Are you sure? prompt. After this, answer Yes to the prompt to mount the root file system.
8. The next item in the installation menu is Install Operating System Kernel and Modules. This is where it gets a little strange. You’ve probably already booted off the Debian #1 CD, but it still asks you where the install files are located so you have to select the cdrom option. And then, even though it’s already in the drive it tells you to put the CD in the drive. Just hit Enter.
9. Configure Device Driver Modules is where you are given the chance to load additional drivers. First you’re asked if you have any drivers on floppy disks. Just accept the default Yes answer to skip this. Then you are presented with a list of module categories which allow you to add some goodies to your system.

Each category has a bunch of modules listed and you have to highlight them and press Enter to install them. If you are prompted for any “Command line arguments” just leave it blank and press Enter.

Install the listed modules from the following categories. Don’t try and install any hardware drivers for hardware that isn’t installed and ready.
o fs - The following are modules you’d want if this would be a system which is not going to be directly connected to the Internet such as an internal file, print, or application server. For our purposes, select all of the following:
 binfmt_aout - for backward compatibility
 binfmt_aout - (same as above)
 nfs - for UNIX/Linux network file storage
 nfsd - (same as above)

(Note that lockd is selected automatically with nfs.)
Note: When installing 2.2r5 I got an error when selecting the binfmt_aout module and submitted this to the Debian bug tracking system. If you encounter an error when selecting this module, de-select by press Enter again while it is still highlighted. This will remove the + next to it. Not having it installed shouldn’t be a problem.
o ipv4 - The following modules are for a system which would be connected to the Internet for firewall or proxy capability (but not needed if this will be a network file server). For our purposes, select the following:
 ip_masq_ftp - kernel support for firewall functionality
 ip_masq_irc - (same as above)
 ip_masq_mfw - (same as above)
 ip_masq_portfw - (same as above)
 ip_masq_raudio - (same as above)

 net - select ppp support (useful for more than just modems) and if you’re connecting your system to a network select your NIC driver if it’s listed. Many times it’s easy to figure out which driver you need because the driver name coincides with the name of the NIC. However this is not always the case. The driver is often based on the chipset used by the card, not the card manufacturer or model. In the table below are some common NICs and the driver you need for them.

Note: Many drivers will prompt you for command line options. If you have a good hub or switch and a decent card, you should not have to enter any command-line options for the cards to work. They auto-negotiated a 100 mb, full-duplex connection.

NIC is not one of the ones listed above you may find it, and its corresponding driver name, in the Ethernet HOWTO list.

Note that I’ve had problems using some SMC cards (9432 in particular) were you get errors saying “too much work at interrupt” and the card does not work properly. Your safest bet is to use a 3Com 3C509-B (ISA) or 3C905 (PCI) card. They’re widely supported, I’ve never had a problem with them, and they’re readily available on eBay.
10. Because you selected net modules, the next step in the installation menu is to Configure the Network.
o Enter a hostname for your system. If this is going to be an Internet server, use a name that describes its function (ex: “www” or “mail”). If it’s going to be in an internal domain in your company, use a name that uniquely identifies it. If this is going to be a home Web/e-mail server using dynamic DNS you’ll want to pick something that’s really unique. If not, you can just accept the default “debian” name.
o If you installed a NIC driver the eth0 (ethernet 0) selection will appear. Press Enter to continue.
o Select the No response to the question asking you if you want to use DHCP or BOOTP.
o Next you have to enter an IP address for your system. If you’re installing this machine on an existing network, MAKE SURE IT’S AN AVAILABLE IP ADDRESS!. If you choose an IP address that’s used by another system you’ll cause all kinds of problems. (You can use a different system to try and ping the address you plan to use to make sure there are no replies to it.) If you don’t know what IP address to use don’t accept the default since it’s commonly assigned in home networks.

Note: If you’re installing this machine on an existing network, even a home network, try this:
 Go to a Windows machine that’s also on the network
 Open a DOS window
 At the DOS prompt type in winipcfg or ipconfig (one of them should work) and see what the IP address of the machine is
 Think of an address for your Linux system where the first three “octets” are the same. For example, if the Windows machine has an address of 192.168.10.23, the address for you Linux machine should be 192.168.10.xxx (you make up a number for “xxx” from 1 to 254)
 Try to ping the number you come up with. For example, if the number you come up with for xxx is 45, at the DOS prompt type in ping 192.168.10.45 and make sure there are no responses to the ping. This means the address isn’t being used by another system so you can use it for your Linux system.

o The subnet mask will be automatically calculated for you based on the class of the IP address you entered and it should be OK as long as you’re not on a subnetted LAN.
o Enter a gateway address if you know what it is (the default route off your network). If it’s a home network you probably not have a gateway (unless you have a cable/DSL router). Don’t just accept the default entry as a system that’s not a gateway may already have this address. The procedure above using a Windows system already on the network may display a default gateway address. If not, just back-space out the default value and press Enter leaving the field blank.
o You will then be prompted for a domain name. Enter your domain name if you already have one. If you’re just playing around, use your last name (for example smith.net). You’ll see why on the Internet Servers page. If you accepted the default “debian” host name earlier, your system will then be referred to as “debian.smith.net”. Don’t worry about conflicting with a real domain that may have that name since this machine won’t have a DNS record created on any ISP’s DNS server.

Note: There are up to three types of “domains” to consider when you are asked for a domain name in Linux. If this will be a system in your Internet domain space, naturally you would use that name. Companies can also set up an internal domain space which has the same type of naming hierarchy as the Internet domain naming system. This type of domain name can be anything you want because it is not visible to the outside world nor do you have to “register” the name with any domain naming authority. In other words, a company can have a public (Internet) domain name (registered through someone like Network Solutions) and a private (internal) domain name. They can be the same or they can be different.

The third type of domain are familier to those who work with Windows NT networks. These domains only have a single-word domain, not the dotted hierarchy found on the Internet and in internal Linux/UNIX networks. Linux does not support these type of domains. However, starting with Windows 2000, Windows servers also started using the dotted hierarchy domain naming convention. If you have any such Windows servers on your network, your Linux system can be put into this domain space (i.e. be given the same dotted domain name as your Windows 2000 servers).
o At the prompt for a DNS address, enter the address of one of your ISP’s DNS servers. (Most companies don’t have heir own DNS servers and will usually use the DNS servers of their ISP or WAN service provider.) Here again you don’t want to just accept the default because that address may be used by another machine on the network which isn’t a DNS server. If you’re not sure of your ISP’s DNS server addresses, just backspace out the existing address and leave it blank.
Note: If you enter your ISP’s DNS server address, some network-related functions (like establishing a telnet session) may operate slowly until your get your system connected to the Internet so it can “see” the ISP’s DNS server. However, this is the only viable entry to use on networks that don’t have their own DNS server.
11.
12. Back at the installation menu Install the Base System is highlighted which only involves confirming the cdrom as the source of the files.
13. Once installed you now Configure the Base System which involves making several selections:
14. For the timezone select your country in the left column (if you’re in the US, choose “US” and not “America”) and press Enter and then select your time zone in the right column.
15. Tab over to the No selection when the prompt appears asking you if your hardware clock is set to Greenwich Mean Time.
16. The next three selections refer to setting up the system to boot up.
o Select Make Linux Boot Directly From Hard Disk
o Select the default Install Lilo in the MBR
o You don’t need to Make a Boot Floppy so arrow down to Alernate: Reboot the System press Enter and answer Yes to the confirmation.

Be sure to remove the CD as the system reboots to force it to boot off hard-drive. This next phase of the OS installation will install some basic software and configure some basic OS operations. You may see some errors messages in all of the text that’s displayed during the boot process. Don’t worry about those at this point.
17. The first series of dialogs will be password and account related. Note that the cursor will not move and nothing will be displayed when you enter passwords.
o First you’ll be asked if you want to use MD5 passwords. Use default No selection.
o Next you’ll be asked if you want to use shadow passwords. Use the default Yes selection.
o Then you’ll be prompted to enter, and re-enter, a password for the root (super-user) account. REMEMBER IT.
o Finally you’ll be be asked to to create a non-root user account entering the username, full name, and password. Create one for yourself.

18. When asked if you want to remove the PCMCIA files accept the default Yes answer.
19. When asked Do you want to use PPP to install the system? use the default No answer.
20. At this point the apt (package installer) configuration begins. Before continuing, place the CD #1 back in the drive. What apt is going to do is scan the CDs and create an inventory of the packages on them and store it in a database for later use. Press Enter to accept the default cdrom selection.
21. After the CD #1 is scanned it will ask if you have another CD to scan. Pop in CD #2, Tab to the Yes selection and press Enter. Also do this for CD #3.
22. Once CD #3 has been scanned, remove it and and put CD #1 back in the drive. This time, accept the default No to the prompt asking if you have another CD to scan and press Enter.
23. When prompted to add another apt source accept the default No answer and press Enter.
24. The next window to appear is the System Configuration window where you are asked to choose between the Simple and Advanced configuration options. Accept the default Simple option and press Enter.
25. The Task Installer appears with a list of task packages you can select using the space bar. Only select following at this time:
o C++ Dev
o C Dev
o All four Gnome selections
o X Window System Core (don’t select “X Window System”)

Tab to Finish and press Enter.

The GUI setup begins….
26. Accept the default Yes to have anXious detect your video card and another window appears saying that a default X server has been selected based on the detected card. Take note of the X server that was selected! (For example, on my system it said “The s3v server will be installed.”) You may need this later. Then just press Enter.
27. In the font selection window xfonts-75dpi is already selected so Tab to OK press Enter
28. An “X terminal” is like a “MS-DOS Prompt” window in Windows 9x, basically just a window with a text-based interface in it so you can enter commands at the shell prompt while in the GUI. When the X terminal selection appears, you can’t see it because it’s further down the list but xterm is already selected so just Tab to OK and press Enter
29. On the Window Manager selection screen you can’t see it because it’s further down the list but twm is already selected so just Tab to OK and press Enter
30. Accept the default No to not install X Display Manager and press Enter
31. On the mouse selection screen, only use the Microsoft selection if you are using a serial mouse. Select PS/2 if your mouse is connected to a PS/2 port. Tab to OK and press Enter.
32. Accept default Yes to emulate 3 buttons by pressing Enter.
33. The location of the mouse driver appears with the default /dev/mouse displayed. If you’re using a serial mouse, change this to /dev/ttyS0. For a PS/2 mouse, change it to /dev/psaux and press Enter.
34. Press the Space Bar to select US/Standard keyboard unless you have one of the other models listed, Tab to OK and press Enter.

Next you’ll need to select the horizontal and vertical sync frequency ranges of your monitor. In both cases you want to use the Custom selection so you can enter the values that conform to your monitor.
35. For the Horizontal Sync Range arrow down to Custom and press space bar. Tab to OK and press Enter. Then enter the low and high horizontal sync range values separated by a dash (-) only. Example (for my 17″ Viewsonic monitor):

30-70

and press Enter. If you can’t find the horizontal sync range of your monitor, try using the #5 selection (800×600 60 Hz 640×480 72Hz).
36. For the Vertical Sync Range again arrow down to Custom and press the Space Bar. Tab to OK and press Enter. Enter the range using the same format as above (for my 17″ Viewsonic monitor I entered “50-180″) and press Enter. If you don’t know the vertical sync range of your monitor try using the #3 selection (50-100).
37. Accept the My Monitor default value by pressing Enter.
38. The Amount of Video Memory should already be selected from when anXious probed the card so just Tab to OK and press Enter and press Enter again to accept the default My Video Card value.
39. Press the Space Bar to select None for a clock chip value and Tab to OK and press Enter.
40. Unless you’re running a 486, accept the default No to probe a clock line by simply pressing Enter. If you have a 486 you may have an older video card so you may want to try Tab-ing to Yes and pressing Enter to see if the probe finds anything.
41. Accept the default 8bpp by Tab-ing to OK and pressing Enter.
42. If you have a 15″ monitor, you’ll waat to have only the 640×480 selected for the resolution. If you have a 17″ monitor have only the 800×600 value selected (i.e. de-select the 640×480 value) using the Space Bar. Then Tab to OK and press Enter.
43. For supported resolutions select the same resolution you selected above and no others. Then Tab to OK and press Enter
44. Accept the default path and file name for the configuration file by pressing Enter
45. The X Configuration Complete window appears with OK highlighted so just press Enter.

Done with the GUI setup
46. At this point it will tell you how many packages will be installed, how much disk space will be used, and asking you if you want to continue. The upper-case Y indicates that Yes is the default answer so just hit Enter.
47. You will be prompted to insert CD #1 which you put back in the drive in a previous step so just prsss Enter. (You’ll likely also get prompted to insert the other two CDs along the way).
48. You will then be asked if you have sound hardware installed. If you do, you can accept the default Yes to set it up if you want to but you probably won’t have much use for it. Otherwise just Tab to No and press Enter.

Note: At some point around here you may see a list of gnome and lib packages with a message about:
dpkg returned an error code (1)
The setup of these will come later in the process. Just blow past the error by pressing Enter.

Also: At some point you will likely see a prompt about:
No default X server previously set
and prompting you to use one that is listed. This should be the same X server you noted earlier in the installation (at the anXious probe). If it is, accept the default Yes answer by presing Enter. If it isn’t, answer No and enter the X server you noted earlier.
49. Next you see a message about helping you configure your mail system. Debian installs the Exim e-mail server software by default which is a shame. 99% of the UNIX/Linux world uses Sendmail. On the Internet Servers page we’ll remove Exim and install Sendmail but for now:
o Press Enter at the “Press Return” prompt
o Select option 5 to not configure Exim

50. You may get a prompt asking you if you want to retry because some:
packages failed to install
This is due to the earlier errors. Accept the default Y for this and press Enter.
51. If you get a prompt about erasing the .deb files accept the default Yes by pressing Enter.
THAT’S IT! Remove the CD and reboot the system by pressing the Ctrl-Alt-Del keys.

We’re not actually done with the initial setup of the system yet. The rest will be covered on the Packages page. For now though, try taking your new Debian system out for a spin around the block in the next section.

Logging In

As your system reboots a lot of messages will be displayed. With a faster system you won’t be able to read them all. You can use the Shift-PgUp and Shift-PgDn key combos to scroll through this previously-displayed text to look for any error messages, etc. Don’t be too concerned about error messages at this point. We still have to install and update the packages.

Once your system restarts you’ll be presented with a login prompt. Because Linux is a multi-user OS you have to indentify yourself to the OS via a login. Log in using the root username and the root password you entered during the install.

Once you log in the shell prompt debian:~# is displayed. The # indicates you’re logged in as root. (Non-root users get a $ prompt.) The debian is the hostname you gave to the system during the install. The ~ indicates that you have been placed in root’s home directory. Whenever you first log in you will see this prompt because every user defaults to their home directory at login. (User home directories are created automatically when the user accounts are created on the system.)

All non-root users have a sub-directory under the /home directory. The names of these home sub-directories for non-root users match the user names (ex: /home/fred). The root user is a little different. root’s home directory is off the root of the file system. Instead of /home/root it’s at /root. It’s important to understand that /root is the root user’s home directory. Don’t confuse it with the “root” of the file system, which is denoted by a single slash (/).

Since you’re in the root user’s home directory, look at the files the install routine created by typing in ls and pressing Enter. You won’t see anything because there’s nothing there. Kind of. There are no user files there. However, there are some system files there. Try typing in ls -laF and pressing Enter. You’ll see two files that start with a period, the .bashrc and .profile files. They’re both kind of the same thing, like a config.sys file on DOS systems.

The .bashrc file sets certain environment defaults when you use the bash shell. The .profile does the same thing, regardless of which shell you use. You can look at the contents of the .profile file by typing in

cat .profile

(’cat’ is the equivalent of the DOS TYPE command which just “types out” the contents of a text file on the screen.) As you can see, it’s mainly just the setting of the PATH variable and you can see what the value of your path is set to. Notice I said your path. In UNIX/Linux each user gets their own path.

Now lets look at the .bashrc file. Type in

cat .bashrc

There’s a little more here but most of it is commented out. In most UNIX/Linux configuration files any line that begins with a pound character (#) are comments (or are commands that have been commented out as in the case of numerous alias commands in the .bashrc file).

Note: There is one case where a line starting with a pound character (#) is not a comment. The very first line is shell scripts will look something like this:

#!/bin/sh

This is known as the “bang” or “shebang” line. It specifies the path to the shell that the script should be run in. (You can run a shell script under a different shell than the one you’re currently using.)

alias commands let you substitute one command for another, or “create” your own command. Note the line in the .bashrc file:

alias rm=’rm -i’

This just substitutes the standard alias command with itself but using the -i command-line switch. The -i command-line switch is interactive mode, which means it will prompt you for a confirmation whenever you use the rm command to delete a file (a safety measure).

You can also “create” your own commands by aliasing existing commands with a different name. For example, you could enter the following line in the .bashrc file:

alias zapfilz=’rm -i’

to “create” a zapfilz command.

Linux defaults it’s “virtual terminal” sessions (what you use when you are working at a shell prompt) to the “tty” (teletype) specification. However, some text editors don’t get along with the tty terminal type very well. They work better with a “VT100″ type of terminal. (The term “terminal” refers to the old “green screen” keyboard/screen devices that were commonly used with mainframes.) Since you tend to work with text files quite a bit in Linux, it would be beneficial to set our virtual terminal sessions to use the VT100 terminal type.

Lets use the infamous vi text editor to edit the .bashrc file to change our default terminal type to VT100. We’ll do this using an export statement.
1. At the shell prompt type in vi .bashrc to open the file in the editor and the contents will be displayed.
Note that there already is one export statement in the .bashrc file. This statement is what sets our shell prompt to display the hostname and current working directory.
2. Press the down arrow key until you get to a blank line in a file (the position of the command in the file isn’t important).
3. Press the ‘a’ key (for append).
Note: If you screw things up and you want to quit without saving, just press the following keys in the given order:

Esc : q ! Enter
4. Type in the following line (don’t start the line with a pound sign):

export TERM=’vt100′

5. Now press the following keys in the given order to save the changes and exit vi:

Esc : w q Enter
Note that what we just did changes a startup file. It won’t have any effect until the next time you log in. However, just enter that same command at the shell prompt and it will take effect immediately. Once your enter it at the shell prompt, you can make sure it took effect by entering this command at the shell prompt:

echo $TERM

You can also try entering this command the next time you log in to make sure that the statement you entered into the .bashrc file is correct. $TERM is the environment variable which stores the current terminal value. All environment variables are upper-case. You use the $ character in front of them to indicate you want to echo the contents of the variable. If you didn’t use the $ in the above command the word TERM would simply be echoed to the screen.

The vi editor is legendary in it’s difficulty to master. For one, it’s a line editor, not a full-screen editor. For another, it has an “edit” mode and a “command” mode. (We went into edit mode above when we pressed the ‘a’ key above, and went back to command mode when we hit the Esc key.) There are entire books written on vi. It’s only fair to mention though, that vi’s keystroke combinations were devised in such a manner that once you get really good with vi, you’ll rarely have to take your fingers off the “home” positions on the keyboard. The reason you want to at least become familier with vi is because every Linux and UNIX system will have it, no matter how old or eccentric a distro it is. That can’t be said about any other editor.

Keep in mind that changes made to the .profile only take effect when you’re logged in as the same user that you are logged in as when you make the changes. Each user has their own .profile file located in their home directory (but as the root super-user you can edit everyone’s .profile file if you want to set up a standard).

The same is true of the .bashrc file, except that, in addition to it only being valid for the current login, it is also only valid if you choose to run the bash shell. Likewise, every user that is set up to use the bash shell by default (which is the default shell in Linux) will have a .bashrc file in their home directory.

If you type in:

echo $SHELL

you’ll see that you are using the Linux-default bash shell.

Here’s something you can try. Log out of the system using the exit command. Start to log back in as root, but this time use the wrong password. You’ll simply get an error message saying it was incorrect and another login prompt. At this second login prompt, use the correct password. Right above the shell prompt you’ll see the message:

1 failure since last login

The “failure” the system is referring to is a login failure for the user account you just logged in as (works for all users, not just root). This is good to know as it will let you know if someone has been trying to hack in using this particular username.

What’s next? If your system is connected to a network you should try seeing if you can ping another workstation on your network. You can use the procedure in Step 10 of the installation above (using winipcfg or ipconfig) to find the IP address of any Windows system on your network. For example, if the address of another system on your network is 192.168.10.12 you’d type in

ping 192.168.10.12

and see if you get “64 bytes from” the address. Left on its own, Linux ping will just keep pinging so press Ctrl-C to end it.

If you don’t get any ping responses or get errors indicating that the “Network is unreachable” you can enter the ifconfig (not ipconfig as with Windows) and check the settings for your eth0 interface (this is the NIC). The lo interface is the local loopback which is only used for testing.

If no eth0 interface is listed, you want to check to see if the kernel driver module got loaded at boot up. Enter the lsmod command. You should see 3c59x or whatever driver you specified during the install listed.

If the module IS loaded (but eth0 doesn’t show up in the ifconfig list) it means that the kernel “sees” the NIC. It’s just not being brought up automatically at bootup. Check to see if it’s set to be brought up automatically by typing out the contents of the interface configuration file with the command:

cat /etc/network/interfaces

and look for the line:

auto eth0

If there is no line like this, or if “eth0″ isn’t on the line, or if it has a pound character (#) at the beginning of the line (commented out) that’s the problem. On the Packages we’ll install a text editor called ee. You can wait until this editor is installed to open this file and correct the problem or you can try to edit it using the vi editor.

If the module ISN’T loaded try loading it with the command:

modprobe 3c59x

Substitute the “3c59x” for the name of the NIC module you selected during the installation. After doing this you may also need to bring the interface up manually. Use the ifconfig command to see if eth0 is now listed. If not, bring it up with the command:

ifconfig eth0 up 192.168.10.50 netmask 255.255.255.0

substituting an address and subnet mask appropriate for your network. If you couldn’t load the module you may have specified the wrong driver module during the installation or your NIC may be bad or, if this is a used non-PCI NIC, may have had the default IRQ, etc. settings changed at some point.

Once everthing is working, back up your server using our backup page.

Solving Hard-Drive Problems

The one downside of using an older system to set up a Linux server is that the most likely devices to fail are the power supply and hard-drive. When a hard-drive starts to go bad on a Linux system you’ll usually find out about it when you boot the system.

The messages displayed when disk errors are encountered duing boot-up are pretty ominous, and a little confusing. You’re told to run fsck manually but not really told how. The command to mount a file system as Read/Write is also given and that’s NOT what you want to do. You’re given the choice of pressing Control-D for “normal startup” (which is actually just a reboot which won’t help the problem at all) or entering the root password for system maintenance. When presented with these errors and this choice, do the following:
• Enter the root password.
• Run the command fsck -fp /dev/hda1 (or whatever your root partition is).
• Repeat the above command until no errors are displayed.
• Reboot the system using the init 6 command.
• Run the command badblocks -sv /dev/hda1 (or whatever your root partition is). It will take awhile.

One way to tell if your hard-drive is starting to fail is to turn the system off for about 30 minutes. If you don’t have problems for the first hour or so of using, but then problems start popping up, the hard-drive is failing. That’s because failing hard-drives are more sensitive to heat and the hotter the drive gets the more likely it is to have problems. Replace these heat-sensitive drives ASAP.

While the above installation procedure got you an operational system, it’s pretty much bare-bones at this point.

Bookmark Us
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • MisterWong
  • Netvouz
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • Wists