Archive for the ‘Linux’ Category

It’s Time to Make the Switch

Wednesday, April 1st, 2009

I have been using Linux primarily since 2000 and exclusively since 2003.  In that time, I have found Linux to be a robust and well-supported OS, as long as you stick to compatible hardware.  Windows, on the other hand, was always suffering from self-inflicted wounds or fundamental vulnerabilities.  I was so much more productive in Linux than I was in Windows that it was really a no-brainer.  However, I came to a realization recently: Windows’ many flaws drive the economy.

If it weren’t for Windows, we wouldn’t have so many anti-malware companies vying for your purchase, we wouldn’t have Geek Squad, and large companies wouldn’t have entire divisions dedicated to just keeping Windows from falling apart.  In short, Windows is where the money is, because Windows always needs TLC.  The same thing is reflected in technology shows and podcasts – the vast majority of questions are about Windows, because Linux users mostly don’t have problems, and the ones they have can be self-diagnosed and fixed.  If I were to continue on my path of using Linux and converting others to Linux, I would be chipping away at the enormous Windows service aftermarket, and people would lose their jobs.  I don’t want to be a part of that.

So, as of today, I am switching to Windows so that I can learn how to fix its inherent flaws and get a slice of that Windows support pie.  I’ll be careful to fix them temporarily, since the real money is in not addressing the underlying problems.  After all, if fixing the cause were the goal, people would just have switched to better OSes long ago.

Free Virtualization in Linux

Sunday, October 26th, 2008

There are lots of ways to create virtual machines in Linux, and I heard about some of them at CPOSC.  In the course of helping someone learn ways to run Windows XP virtualized inside Linux, I found out about Virtualbox OSE.  It’s fairly easy to install and set up and start using.  Right now, I’m installing Fedora 9 on a virtual machine, just to see what the state of affairs is.

I know that lots of you out there use virtualization at home and at work, so I’d be curious to hear how Virtualbox OSE compares with the commercial and free solutions that you use.

UPDATE: Someone asked me on IRC if there was a server mode.  It does appear that there is.

Like an Onion Skin

Wednesday, September 10th, 2008

I saw that Valve was offering a cheap bundle of all the old X-COM games on Steam, and I decided to buy them, hoping they’d run in wine.  The Steam version was too new to show up on wine’s compatibility list, but it was less than $14, so I gambled.  Out of 5 games, 4 run in wine well enough to play, and 1 does nothing.  Here’s the insanity: The older DOS games were not actually ported to Windows, so the Steam version includes a Windows-based DOS emulator.  In my case, I’m running Linux and launching wine, which runs the Windows program, which launches the Windows-based DOS emulator, which runs the old DOS game.  And it works.  You’d sound like a zealot or a crazy person if you suggested that I try to run it that way on purpose, but this only serves to highlight how good wine is now.

Embedded Mobile Linux Talk

Tuesday, August 12th, 2008

I’m giving a talk tonight about the state of mobile Linux, and these are my slides.

Bride of Ubuntu

Thursday, May 1st, 2008

My wife was starting to have strange problems with her XP laptop which ended up being spyware/malware that grew and thrived in the petri dish that is Windows XP, an eXPerimental operating system by Microsoft, a convicted monopolist. Rather than go through the effort of joining the expensive and time-consuming arms race against malware on Windows XP, I booted the Ubuntu 8.04 live CD, rsynced her files to my RAID box, and then nuked Windows XP and installed Ubuntu 8.04.

She really doesn’t care what OS she uses, “as long as it works.” So far, it does. She doesn’t get strange windows popping up and ironically insisting that she buy software to fix her computer’s malware infections. Showing her how to run Firefox and OpenOffice in Ubuntu was 99% of the solution and took 20 seconds, and while the other 1% will realistically take most of the time and effort, it’ll be worth not having to worry about malware in Windows XP.

I do have one remaining problem that I have just begun to look into, involving really loud beeping and inconsistent wakeup from hibernation. Given the sheer volume of the Ubuntu community, I have confidence that I’ll resolve this soon, or at least work around it.

Ubuntu RAIDbox: Part 3

Friday, March 21st, 2008

In general, this part of the instructions assumes that you are using storage devices (disks and CF) that contain nothing that you care about. If this is not the case, please either first copy the data you want to keep to a safe location, or learn how to adapt these steps to preserve what you have.

Boot your RAIDbox hardware and launch the Ubuntu installation process.

  1. Choose Manual Partitioning
  2. For each disk displayed, delete every partition.
  3. Once complete, partition your CF card as a single ext3 partition with / as its mount point.
    1. Move the cursor to the single row underneath its drive descriptor, e.g. :
      IDE1 master (hda) - 8.0 GB TRANSCEND
              pri/log    8.0 GB     FREE SPACE
    2. Press ENTER
    3. Select Create a new partition and press ENTER
    4. Press ENTER to accept the default size, which is all of your disk space.
    5. Select Primary and press ENTER
    6. If Use as: is not Ext3 journaling file system, then
      Select Use as: and press ENTER
      Select Ext3 journaling file system and press ENTER
    7. If Mount point: is not /, then
      Select Mount point
      Select / – the root file system
    8. If Bootable flag: is not on, then
      Select Bootable flag: and press ENTER.
    9. Press ESC to return to the partition menu.
  4. For each hard disk, first create a 384 MB RAID partition at the end of the disk:

Move the cursor to the single row underneath its drive descriptor, e.g. :

SCSI4 (0,0,0) (sda) - 500.1 GB ATA ST3500841A
         pri/log  500.1 GB     FREE SPACE

Press ENTER

Select Create a new partition and press ENTER

Press BACKSPACE until the partition size field is empty. Then type 384 MB and press ENTER

Select Primary and press ENTER

Select END and press ENTER

Select Use as: and press ENTER

Select physical volume for RAID and press ENTER

Press ESC to return to the partition menu.

After all disks are complete, fill out the remaining space with another RAID partition:

Move the cursor to the row underneath its drive descriptor that shows FREE SPACE, e.g. :

SCSI4 (0,0,0) (sda) - 500.1 GB ATA ST3500841A
         pri/log  499.7 GB     FREE SPACE
        #1 primary  378.4 MB   K raid

Press ENTER

Select Create a new partition and press ENTER

Press ENTER to accept the default size, which is the rest of your disk space.

Select Primary and press ENTER

Select Use as: and press ENTER

Select physical volume for RAID and press ENTER

Press ESC to return to the partition menu.

Scroll back up to the top of the Partition disks page, select Configure software RAID and press ENTER.

If asked to Write the changes to the storage devices and configure RAID, select Yes and press ENTER.

To clear out results from previous attempts, select Delete MD device and press ENTER. Delete all devices until there are no more defined.

Once all MD devices are deleted, select Create MD device and press ENTER.

Select RAID5 and press ENTER.

Press BACKSPACE until the default number of active devices for the RAID5 array is deleted, then type 4 and press ENTER.

If the default number of spare devices for the RAID5 array is not 0, press BACKSPACE until the number is deleted, then type 0 and press ENTER.

One by one, move the cursor to each of the 4 lines that ends in 1 (e.g. /dev/sda1) and press SPACE to select it. When done, press ENTER.

Repeat the above steps, but this time, select all the lines that end in 2 (e.g. /dev/sda2) which should be the only 4 options remaining.

Select Finish and press ENTER.

When the partitioner is done, it’ll take you back to show you the results of your RAID work. From this point on, leave your actual disk partitions alone and only work with the RAID5 device entries. e.g.

RAID5 device #0 - 1.1 GB Software RAID device
      #1   1.1 GB

and

RAID5 device #1 - 1.5 TB Software RAID device
      #1   1.5 TB

Select the line under the smaller RAID5 device and press ENTER.

Select Use as: and press ENTER

Select swap area and press ENTER

Press ESC to return.

Select the line under the larger RAID5 device and press ENTER.

Select Use as: and press ENTER

Select Ext3 journaling file system and press ENTER

If Format the partition: is not set to yes, format it, then select it and press ENTER.

Select Mount point: and press ENTER

Select Enter manually

Change the default to /raid and press ENTER.

Press ESC to go back.

When back at the Partition disks screen, review your partitions one final time and then scroll down to select Finish partitioning and write changes to disk, then press ENTER.

The rest of the installation process is just like a normal Ubuntu installation, except with more simultaneous disk activity. When your system boots, Ubuntu will be entirely on the CF card, and your swap partition will be on one raid array, and a giant chunk of storage will be mounted at /raid.

The only thing that remains is to get /var off the CF as soon as /raid is mounted, because CF cards can only take a certain number of write cycles, and we don’t want logging to kill our boot disk.

Once your RAIDbox boots for the first time, log in as your main user account. If you run the command ‘df -h’ then you should see something like this:

Filesystem            Size  Used Avail Use% Mounted on

/dev/hda1             7.4G  660M  6.4G  10% /

varrun                188M   44K  188M   1% /var/run

varlock               188M     0  188M   0% /var/lock

udev                  188M  112K  188M   1% /dev

devshm                188M     0  188M   0% /dev/shm

lrm                   188M   34M  154M  19% /lib/modules/2.6.22-14-generic/volatile

/dev/md1              1.4T  198M  1.3T   1% /raid

As you can see, our CF disk is mostly underused, and we want to keep it that way to ensure a long life. More on that later.

Ubuntu RAIDbox: Part 2

Friday, March 21st, 2008

With the hardware assembled, the next step is to install Ubuntu Server 7.10. I did not want to use an optical drive, but if you want to hook up an optical drive and install from the CD, you can just insert Ubuntu Server 7.10, configure the BIOS to boot from the optical drive, reboot, and go to Part 3.

For the adventurous, here’s how to PXE boot Ubuntu Server 7.10 on your RAIDbox (or any PXE-capable machine, for that matter) from another Linux server on your LAN.

Pick a Linux machine on your LAN to act as the PXE server for the PXE boot process on your RAIDbox. I chose a server running 64-bit Ubuntu Server 7.04, but I anticipate any recent version of Ubuntu would have the same setup process. Here’s everything you need to do on the PXE server:

Download (or copy from another machine) the .iso file for Ubuntu Server 7.10.

Install dnsmasq and prepare the tftpboot directory:

sudo apt-get update
sudo apt-get install dnsmasq
sudo mkdir /tftpboot
sudo chmod 755 /tftpboot
sudo chown nobody: /tftpboot

Run these commands to extract needed files from the Ubuntu Server 7.10 image:

sudo mount -o loop /location/of/your/ubuntu-7.10-server-i386.iso /mnt
sudo cp -a -r /mnt/install/netboot/ubuntu-installer /tftpboot
sudo cp -a  /mnt/install/netboot/pexlinux.0 /tftpboot
sudo cp -a -r  /mnt/install/netboot/pexlinux.cfg /tftpboot

Edit /etc/dnsmasq.conf. The lines you add will look something like this. You need to provide an IP address that you want your RAIDbox to have, you need to specify the IP address of the PXE server you’re configuring, and you need to provide the IP address of the gateway you use to get to the internet, which is usually your LAN’s regular DHCP server. You must also list the MAC address of the network device you’ll use on the RAIDbox when PXE booting. (This makes sure no other devices on your LAN connect to the PXE server.) If your PXE server also has a human-readable name on your LAN, you can list it here. Otherwise, leave it blank.

dhcp-range=IPADDRESS.FOR.YOUR.RAIDBOX,IPADDRESS.FOR.YOUR.RAIDBOX,12h
dhcp-host=MAC:ADDRESS:OF:YOUR:RAID:BOX,IPADDRESS.FOR.YOUR.RAIDBOX
dhcp-boot=pxelinux.0,HUMAN_READABLE_NAME_OF_YOUR_SERVER,IPADDRESS.OF.YOUR.SERVER
dhcp-option=3,IPADDRESS.OF.YOUR.GATEWAY
enable-tftp
tftp-root=/tftpboot

Here’s how it might look:

dhcp-range=192.168.0.240,192.168.0.240,12h
dhcp-host=aa:bb:cc:dd:ee:ff,192.168.0.240
dhcp-boot=pxelinux.0,presence2,192.168.0.34
dhcp-option=3,192.168.0.10
enable-tftp
tftp-root=/tftpboot

(Re-)launch dnsmasq:

sudo /etc/init.d/dnsmasq restart

rsync for Windows: Quick and Easy

Tuesday, January 29th, 2008

If you have used UNIX/Linux/BSD for very long, then you know about rsync, which allows you to do incremental copies or backups between network-attached UNIX/Linux/BSD systems. Such a free facility is sorely lacking on Microsoft(R) Windows(tm), an expensive proprietary Operating System made by a convicted monopolist, Microsoft(R).

If you have an unencrypted filesystem on Windows(tm), and you need an easy way to do incremental backups of all your data, I recommend booting the Windows(tm) box with a KNOPPIX live CD, which will boot Linux on your Windows(tm) box without actually installing it. From there, you can access all your Windows(tm) data and rsync to another UNIX/Linux/BSD box, and, until you boot back into Windows(tm), you won’t need to use an OS made by a convict.