Linux

Cloning A Linux (maybe others) System

I used to use partimage to backup and clone machines I had setup, however, this requires the disks be the exact same size and you can't resize partitions (easily at least). Now I've discovered the nice rsync tool combined with the System Rescue CD cloning a drive can be quite easy including moving to smaller/bigger partitions.
First start by booting both computers with the Rescue CD. It's easiest to connect them together with an Ethernet crossover cable, but a network switch will work too. Set both of their ip addresses (make sure they're on the same subnet, but different values):

Two Interfaces each running a DHCP Client

I recently had a case where I had a Linux server with two Ethernet cards in it that were both configured using DHCP. The issue I ran into was that eth0 was my gateway to the Internet and when eth1 would get it's DHCP values it was overwriting both my domain name server entries and default route (gateway) information and preventing access to the Internet. The DNS issues are easily solved in Redhat Enterprise (or in my case Centos) by adding PEERDNS=no to /etc/sysconfig/network-scripts/ifcfg-eth1, however the default route/gateway issue was much bigger. The dhclient program can get it's parameters from a file called /etc/dhclient-eth1.conf (or whatever interface you want). I saw that it has a nice feature to tell dhclient just which options to accept from the server using the request keyword. So I created a /etc/dhclient-eth1.conf that looked like this:

Make SELinux Allow Access To Home Directories

I'm trying to setup a secured Asterisk server and enabled SELinux to set everything up properly. My server uses Polycom phones that will be centrally provisioned from the server through FTP. Well, I was having a hell of a time figuring out why I got this error message when trying to login:


500 OOPS: cannot change directory:/home/polycom
Login failed.

So I looked at /var/log/audit/audit.log and realized that SELinux was blocking me. The easy fix was to execute the following as root:


setsebool -P ftp_home_dir=1

Fix GRUB booting after installing a M$ WinBlows product that took out your MBR without asking

I know this documented everywhere, but I figured I'd put it out myself as well. Especially with all the Vi$ta installations going on now wiping out the nice multi-boot machines we have. First, make sure you have a live CD of some sort. I like to always carry a copy of the System Rescue CD. It's small and can be put on a thumbdrive if desired.

  1. Boot the Live CD of your choice. Get it to the point of having a root shell prompt (or be able to execute commands as root with sudo).
  2. Create a directory in mount that we will use to CHROOT into (basically running as if you booted from your machine instead of the live CD).

Getting the Dell 5510 (aka Novatel Merlin XU870) Working in Ubuntu

Attached is a patch that will update the airprime driver to recognize the Dell 5510 card. The airprime driver is an improved driver over the standard usbserial driver, which will limit the speeds available for downloading over a high speed wireless WAN network such as Cingular's HSPDA network. This is not my work (although I fixed the patch to the correct device id for the Dell 5510 Cingular 3G data card). The original patch was downloaded from Andy Gay’s airprime improvement patches. This patch is good for the current kernel I'm running, which is 2.6.17-11-generic. Instructions for this patch are as follows:

  1. Make sure you have the following packages installed: build-essential linux-headers linux-source

  2. sudo apt-get install build-essential linux-headers linux-source
  3. Extract (if you haven't already) the source tar ball:

  4. cd /usr/src

Syndicate content