Saturday, October 28, 2006

hdparm To No Avail

Strange thing. I wanted to see about boosting the hard drive throughput on my little home fileserver (consisting of three Western Digital WD3200JB 320GB drives) but my hdparm tweaks resulted in no appreciable gains in performance over the default Ubuntu Server settings.

hdparm -X69 -m16 -d1 -c1 -u1 /dev/hda /dev/hde /dev/hdf

Resulting in these custom settings for each drive (as shown here for hda):

/dev/hda:
multcount = 16 (on)
IO_support = 1 (32-bit)
unmaskirq = 1 (on)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
geometry = 38913/255/63, sectors = 625142448, start = 0

hdparm -Tt /dev/hda returns the following with both the default Ubuntu settings and with barely any noticeable difference with my custom settings for each of the three drives:

/dev/hda:
Timing cached reads: 252 MB in 2.01 seconds = 125.24 MB/sec
Timing buffered disk reads: 104 MB in 3.01 seconds = 34.57 MB/sec

Based on documents I have read I expected to see a substantial increase in performance over the default settings. I think I will find that it probably has more to do with the limitations of my GA-6VEML mainboard and the Promise Ultra100 TX2 card then the drives...

Tags:

Thursday, October 26, 2006

Oracle Taking On Red Hat?

First (as I recall) there was White Box Enterprise Linux. Then came CentOS. Now it seems it's Oracle's turn to get into the game. What game is that? Why, taking Red Hat Enterprise Linux source code, stripping out all of Red Hat's trademarks, recompiling and repackaging it as your own distribution.

Introducing Oracle Unbreakable Linux. (Unbreakable Linux--I like the sound of that. Hope it can live up to this rather dramatic titular claim...)

Imitation, the sincerest form of flattery? Maybe this is just a bit over the top though? Don't misunderstand, it's all perfectly on the up & up. Nothing legally or ethically wrong with this approach--after all, the code is all covered under the GPL licensing. And the key here isn't even a new distro based on someone else's codebase. Who really cares anyway? Selling distros isn't where the money is in Linux anyway. It's the support contracts that count, and that is precisely the game Oracle wishes to join. This is a step right in that direction for Oracle I suppose but it will make the former "friends" direct competitors.

Interesting developments but not totally unexpected, and indeed probably good for the late adopters. The more warm & fuzzy corporations feel about commercial support, the more likely they will be to move forward with Linux integration. It ain't 1995 anymore...

PS You can download it from this link after registration.

Tags:

Saturday, October 21, 2006

PostScript & GIMP For Windows

Setting up Print to PostScript & the option to open these files for editing with GIMP in Windows 2000.

Requirements:
Download and install the current versions of GTK+, GIMP, and GPL GhostScript for Windows.

Set up a Print to File PostScript printer driver
  1. Start --> Settings --> Printers --> Add Printer
  2. Click Next in the Welcome to the Add Printer Wizard dialog box
  3. Select Local Printer. Clear the checkmark in the Automatically detect and install my Plug and Play printer
  4. Click Next
  5. Select Use the following port and choose FILE: in the list under that option in the Select the Printer Port dialog box
  6. Click Next
  7. In the Add Printer Wizard dialog box under Manufacturers select HP
  8. In the Printers field in the same dialog box select HP Color LaserJet 8500 PS
  9. Click Next
  10. In the Name Your Printer dialog box enter PS Printer in the Printer Name field
  11. Select No for the Do you want your Windows-based programs to use this printer as the default print? option
  12. Select Do not share this printer in the Printer Sharing dialog box
  13. Click Next
  14. In the Print Test Page dialog box Select No
  15. Click Next
  16. Click Finish in the Completing the Add Printer Wizard

Set the GS_PROG environment variable
  1. Start --> Settings --> Control Panel --> System
  2. In the System Properties dialog box select the Advanced tab
  3. Click the Environment Variables button
  4. Click New in the User variables for username section
  5. Enter GS_PROG in the Variable Name field in the New User Variable dialog box
  6. Enter C:\Program Files\gs\gs8.54\bin\gswin32c.exe in the Variable Value field in the New User Variable dialog box (if you installed GhostScript in the default location, otherwise modify this value as needed)



  7. Click OK --> OK --> OK to save the settings and close the System Properties dialog

You are now ready to print to PostScript and open the resulting file for editing with Gimp!

Tags:

Ubuntu Kernel Builds In A Virtual Machine

Use VMPlayer and Ubuntu server to create a virtual build system to compile custom Linux kernels for Ubuntu (and Debian?), quickly & easily.

Particularly useful for compiling kernels on faster machines for slower target system--which is exactly why I did this! Compiled custom kernels for a VIA C3 box on my AMD64 system. It saved me a lot of time and works marvelously well.

What you need:
  • The specifications for the target system for which you are going to build a custom kernel. Processor type, chipset information, etc. Google the model number of your mainboard to find the needed user manual and/or specs for your system.
  • VMPlayer
  • Build a Virtual Machine with EasyVMX
  • Ubuntu Server. Why? Fast, easy installation in the virtual environment. No need for all the extemporaneous desktop stuff, just a clean command line environment to compile kernels.
First, navigate to EasyVMX and configure your build system. These are the options that I chose as shown in the configuration file & image (click for a readable version) that follows. After downloading the Ubuntu Server iso image, you can either burn it to CD and install it to your VM from your drive or copy the .iso file into your VM directory & install it as a virtual CD:



#!/usr/bin/vmplayer

# Filename: Ubuntu_Build_Server.vmx
# Generated 2006-10-18;08:17:44 by EasyVMX!
# http://www.easyvmx.com

# This is a Workstation 5 or 5.5 config file
# It can be used with Player
config.version = "8"
virtualHW.version = "4"

# Selected operating system for your virtual machine
guestOS = "ubuntu"

# displayName is your own name for the virtual machine
displayName = "Ubuntu_Build_Server"

# These fields are free text description fields
guestinfo.vmware.product.url = "http://www.easyvmx.com/"
guestinfo.vmware.product.class = "virtual machine"

# Number of virtual CPUs. Your virtual machine will not
# work if this number is higher than the number of your physical CPUs
numvcpus = "1"

# Memory size and other memory settings
memsize = "320"
MemAllowAutoScaleDown = "FALSE"
MemTrimRate = "-1"

# Unique ID for the virtual machine will be created
uuid.action = "create"

# Remind to install VMware Tools
# This setting has no effect in VMware Player
tools.remindInstall = "TRUE"

# Startup hints interfers with automatic startup of a virtual machine
# This setting has no effect in VMware Player
hints.hideAll = "TRUE"

# Enable time synchronization between computer
# and virtual machine
tools.syncTime = "TRUE"

# First serial port, physical COM1 is not available
serial0.present = "FALSE"

# Optional second serial port, physical COM2 is not available
serial1.present = "FALSE"

# First parallell port, physical LPT1 is not available
parallel0.present = "FALSE"

# Logging
# This config activates logging, and keeps last log
logging = "TRUE"
log.fileName = "Ubuntu_Build_Server.log"
log.append = "TRUE"
log.keepOld = "1"

# These settings decides interaction between your
# computer and the virtual machine
isolation.tools.hgfs.disable = "FALSE"
isolation.tools.dnd.disable = "TRUE"
isolation.tools.copy.enable = "TRUE"
isolation.tools.paste.enabled = "TRUE"

# First network interface card
ethernet0.present = "TRUE"
ethernet0.virtualDev = "e1000"
ethernet0.connectionType = "nat"
ethernet0.addressType = "generated"
ethernet0.generatedAddressOffset = "0"

# Settings for physical floppy drive
floppy0.present = "FALSE"

# Settings for physical CDROM drive
ide1:0.present = "TRUE"
ide1:0.deviceType = "cdrom-raw"
ide1:0.startConnected = "TRUE"
ide1:0.fileName = "auto detect"
ide1:0.autodetect = "TRUE"

# Settings for the optional virtual CDROM, ISO-image
ide1:1.present = "TRUE"
ide1:1.fileName = "ubuntu-6.06.1-server-i386.iso"
ide1:1.deviceType = "cdrom-image"
ide1:1.mode = "persistent"
ide1:1.startConnected = "FALSE"
# Set the line about to TRUE if you wish to install from .iso file

# First IDE disk, size 4Gb
ide0:0.present = "TRUE"
ide0:0.fileName = "Ubuntu_Build_Server.vmdk"
ide0:0.mode = "persistent"
ide0:0.startConnected = "TRUE"
ide0:0.writeThrough = "TRUE"

# END OF EasyVMX! CONFIG


Install Ubuntu Server to your Virtual Machine via CD Rom or .iso file. The simple interface is very easy to navigate and you will be up and running in no time. Here are some of the defaults that I used. After installing it once you will probably be able to do it in your sleep...
  • English
  • United States
  • American English (keyboard)
  • hostname (of your choice)
  • Partition disks
    • Erase entire disk: IDE1 master (hda) - 4.3 GB VMware Virtual IDE
    • Write the changes to disks? Yes
  • Select your time zone
    • Is the system clock set to UTC? (probably not) No
  • Full Name for the new user: that's you!
    • Username for your account: totally up to you
    • Choose a password for the new user: remember this! It is not only your login password but you will need it for issuing commands as the root superuser with sudo.
  • The system installs... The CD ejects... Continue is highlighted... Remove the CD & press Enter. The VM reboots and you can now login.
Remember, the sudo password = your login password.

Now it's time to get the needed pieces for building kernels installed on your VM and ready to go.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-image-k7 (or the kernel that best suits your particular host system, or skip this if the standard server kernel is acceptable)
sudo telinit 6

Log back into the VM. If you are connected to the internet via broadband and don't want to deal with the install CD, remove it from the apt sources file:

sudo nano /etc/apt/sources.list


Comment out the following line near the beginning of the file by adding a # to the start of the line as follows:

# deb cdrom:[Ubunutu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted


Ctrl+x
Y [Enter] to save the changes

sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install kernel-package
sudo apt-get install libncurses5-dev
sudo apt-get install linux-source
cd /usr/src
sudo tar -xjvf linux-source-2.6.15.tar.bz2
sudo ln -s /usr/src/linux-source-2.6.15 /usr/src/linux
cd /usr/src/linux

sudo make clean
sudo make mrproper
sudo make oldconfig
sudo make menuconfig


Modify the kernel options as desired for your target system. Particularly you will probably want to go to Processor Type & Features and select the correct processor for your target system and save your new config when finished.



sudo make-kpkg clean
sudo make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers


Insert what you want in place of "custom" (lowercase) to identify your custom kernel.

Let the compiling begin!

cd /usr/src
ls


You should see your new custom kernel packages, for example:

kernel-image-2.6.15-custom_10.00.Custom_i386.deb
kernel-headers-2.6.15-custom_10.00.Custom_i386.deb

Copy these to your target system and install them with the following:

sudo dpkg -i kernel-image-2.6.15-custom_10.00.Custom_i386.deb
sudo dpkg -i kernel-headers-2.6.15-custom_10.00.Custom_i386.deb
sudo telinit 6

The system will reboot, and you can verify that you are running your new custom kernel with the command:

cat /proc/version

Credit goes to this doc for providing several pieces for this how-to:
http://ubuntuforums.org/showthread.php?s=0d310eadb229405b090ab3fab7090ab7&t=56835


Tags:

Thursday, October 12, 2006

Software RAID & mdadm

A quick note and a link I don't want to lose to a very useful article on Linux software RAID management:

mdadm: A New Tool For Linux Software RAID Management

I'll use this post as a placeholder for other relevant links.

Software RAID seems to be progressing nicely since my first attempts with it several years ago. It's generally a no-brainer to work with these days, but it was a much more intensive learning curve back then...

Tuesday, October 10, 2006

Pain In The Ubuntu

***Updates:
  • apt-get updateable to 6.06.1 with no boot up problems!
  • mondoarchive / filesystem backup commandline
  • Ubuntu Server 6.06.1 boot problem solved?
I finally got around to upgrading my little home fileserver. I have always wanted to do a software Raid5 setup for my data partitions and after my workstation HDD failed, I thought now was the time.

I have been using Ubuntu server edition for this box and I wanted to stick with it. I downloaded the latest stable version, Ubuntu Server 6.06.1 for this install. I installed the Promise Ultra100TX2 IDE controlled card that I had on hand, and purchase three new 320GB Western Digital drives for the project from ZipZoomFly (on a really good special).

All this HW is going into an old eMachines case (not ideal). I bought 3.5" to 5.25 mounting kits with cover fans to be able to mount two of the drives in the two external 5.25" slots. Out came the DVD & CD-Rom drives--not a big deal, there is an open IDE connection on the mainboard that I hooked the CD-ROM drive up to temporarily (once installed I remove the CD option from the apt sources.list) and all the drives should now stay relatively cool. A couple of new rounded IDE cables and I was ready to go one the HW side.

The last time I installed ubuntu server it was painless. The / partition was hda1 formatted as ReiserFS. The main data partition was RAID1 (mirror), also ReiserFS on two drives (no spare), add a swap partition and another non-RAID data partition and it was good to go. The drive space was somewhat limited--but for slapping together a bunch of "junk" lying around the house, it worked flawlessly (aside from the mainboard voltage problems--it got replaced).

This time I would do things a little differently:

PartitionhdahdehdgRAID LevelRAID DeviceTotal Useable
/8.1GB8.1GB8.1GB (S)
1 /md08.1GB
Swap255MB255MB255MBNoneNone765MB
/home61.7GB61.7GB61.7GB5 /md1123.4GB
/data250GB250GB250GB5/md2500GB

Pretty simple configuration. If one drive fails, I can continue on my way until a replacement is procured while maximizing my available usable space on the data partitions. The setup during the installation for this configuration was very easy. Instead of marking a filesystem for the partitions to be used in the RAID arrays you mark them as devices for RAID. Once completed you scroll to the top and use the configure software RAID option to set up the arrays. When that is done, you scroll down and find your arrays ready to be modified with filesystem options, mount points, etc. Nothing to it.

Unfortunately though, no matter what I did, no matter how I configured things--once the installation was completed the system would go to GRUB and start loading the kernel and then it would just reboot at that point. Endlessly until I turned it off. I can't begin to describe all of the attempts I made to get it to work over the last few days. I can't say why it won't work. Even when I set up the root partition as a non-RAID device, it would still do the same thing.

I conclude (and this is borne out in numerous posts around the net) that ubuntu-server 6.06.1 is broken when it comes to software RAID.

I simply ended up downloading ubuntu-server 5.10 and all is well. My setup is running exactly as I intended it to. I will wait until I am certain the software RAID conflicts in the later versions are fixed before upgrading.

What a total pain. I almost went with a completely different distro but as my little box here uses a lame VIA C3 processor that distro wouldn't even boot.

Update: Once installed as indicated above, I tar'd up the / filesystem into a file on /data and made the following changes to see if an upgrade vs. a clean install would get me into Dapper (6.06.1) without kill my boot up:


sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

sudo nano /etc/apt/sources.list

The file now reads:
#changed all the breezy references to dapper & comment out the cdrom entry:
# deb cdrom:[Ubuntu-Server 5.10 _Breezy Badger_ - Release i386 (20051013)]/ breezy main restricted

deb http://us.archive.ubuntu.com/ubuntu dapper main restricted
deb-src http://us.archive.ubuntu.com/ubuntu dapper main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://us.archive.ubuntu.com/ubuntu dapper universe
deb-src http://us.archive.ubuntu.com/ubuntu dapper universe

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
#deb http://us.archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
#deb-src http://us.archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu dapper-security main restricted
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted

deb http://security.ubuntu.com/ubuntu dapper-security universe
deb-src http://security.ubuntu.com/ubuntu dapper-security universe

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo telinit 6

That's all there was to it. Why a clean install would not work with my software RAID configurations, I still cannot say but the upgrade is done, and I am where I wanted to be in the first place...

I need to find the camera. The cobbled-together HW doesn't look too bad. I think the only original parts from the eMachine that it was originally is the case and a cable or two.

Update: mondorescue is my backup utility of choice to go from bare metal to full restore. After the upgrade above I did an apt-get install mondo and used it to build a root filesystem restore disk for the box with the following command line:

mondoarchive -Oi -d /data/mondo -s 4580m -E "/home /data"\ -0 -F -T /data/mondo/temp -S /data/mondo/scratch
  • -Oi Backup to .iso file(s)
  • -d dir or device to backup to--in this case, write the iso file(s) to /data/mondo
  • -s max size for the .iso files (it came out to 530MB so setting it for DVD was a little excessive)
  • -E Exclude. Exclude the /home & /data partitions--I just wanted a backup of the OS, not the user data.
  • -0 No compression (Default is 3)
  • -F Don't offer to make boot floppies
  • -T Path to temp directory
  • -S Path to scratch directory
I knew that an 8GB root partition was way overkill. 530MB of uncompressed backup proves that point! LOL

Update: Inspecting the kernel source .config file for the Ubuntu 6.06.1 server kernel I see that it is compiled for the Pentium Pro. No wonder it would just continuously reboot on my VIA C3 box!

Tags:

Sunday, October 01, 2006

Media On Demand

As I stated on a previous occasion, "...When moderate voices prevail and ...technology can be employed so that the consumer has on-demand access to media, AND the production companies can still get paid--we will all win."

Kudos to ABC for posting popular TV shows for on-demand viewing.

I hope more media companies follow suit. I will gladly sit through the commercials or pay a modest subscription fee for such a service. I think this model reasonably meets the needs of the consumer as well as the media producers. It is an ideal means of eliminating the "piracy problem". After all, who needs a local copy of anything really if you can access what you want on-demand via the net any time you wish.

No more lawsuits. No more making criminals out of your customers. Everybody wins.

Tags: