Friday, March 7, 2008
Switch from LSI Logic to BusLogic driver
Because of this, we have had the need to switch these from using the LSI Logic driver to use the BusLogic driver. The problem is that the original initial ram disk (initrd) is built with the LSI Logic driver and must be changed. I decided to document the steps required to do this. If you don't take these steps, the server will encounter a kernel panic on reboot after changing the VM to use the BusLogic HBA.
1) Update /etc/sysconfig/kernel with the BusLogic driver. Change the line that reads:
INITRD_MODULES="mptspi reiserfs dm_mod"
to read:
INITRD_MODULES="BusLogic reiserfs dm_mod"
2) Make a backup copy of the initrd file that is currently in use.
cp initrd-2.6.5.77-default initrd-2.6.5.77-default.preBusLogic
3) Rebuild the initial ram disk file to incorporate the changes made to /etc/sysconfig/kernel by running mkinitrd as root.
mkinitrd
Note: You can pass additional options to the mkinitrd command to use a specific kernel. By default it will build an initrd for all the kernel versions in /boot. This is sufficient for the servers in my environment.
4) Update the virtual machine to use the BusLogic HBA
Use the VirtualCenter Client
- Shutdown the VM
- Right click on the VM and select Edit Settings
- Select SCSI Controller 0 and click the Change Type button
- Select the BusLogic radio button and click OK
- Click OK to exit the Virtual Machine Properties
- Power on the VM
- Answer the "change the adapter type for scsi0:0 disk" by selecting the Yes radio button and clicking OK
Thursday, January 24, 2008
What's that line in /proc/mounts?
How to add disk space with LVM on Linux
The general steps are:
- Physically put the disk in the server and make it available either in an array or some other way.
- Use fdisk to create new partition on the disk.
- Extend existing volume group onto new partition.
- Extend existing logical volume onto new space.
- Extend filesystem.
- Physically put the disk in the server and make it available either in an array or some other way.
- This can vary widely depending on what hardware you are on, so we will not cover this portion in this tutorial. You may want to use Google to search for how to do this on your hardware.
- Use fdisk to create new partition on the disk.
- As root run fdisk on the new disk. For example you would run fdisk /dev/sdc.
- On this new disk you will create a new partition. Inside of the fdisk program you create a new partition by typing the letter "n" followed by the enter key.
- It will then ask you if you want it to be a primary partition or an extended partition. For this example we will just assume we want it to be a primary partition. To do this we type the letter "p" followed by the enter key.
- Next it will ask for the starting point and ending point of this partition. For this example, we will simply select the defaults by hitting the enter key twice.
- If you want to view the details of the new partition, you can type the letter "p" from the fdisk prompt.
- Next we need to change the type for this new partition. We do this by typing the letter "t" followed by the enter key.
- It asks to enter in what type we want it to be. We need it to be of the Linux LVM type. The Hex code for Linux LVM is 8e. We type in "8e" followed by the enter key and it will tell us that it changed the system type for this partition to Linux LVM.
- We then need to save these changes and exit fdisk. We do this by typing the letter "w" (for write) followed by the enter key.
- Use pvcreate to lay down the "setup" on the physical partition.
- This sets up physical extents and other things that LVM needs. The command we run is "pvcreate /dev/sdc1"
- Extend existing volume group onto new partition.
- For this example we are going to assume that we have an existing volume group named rootvg. We can display information about this volume group using the vgdisplay command. If we type "vgdisplay" without any arguments, it will display all the volume groups. If we just want information about the "rootvg" volume group, we would type "vgdisplay rootvg".
- To extend the rootvg volume group onto the new partition, we use the vgextend command. Type "vgextend rootvg /dev/sdc1" followed by the enter key. This will extend the rootvg volume group onto the new partition, /dev/sdc1.
- Extend existing logical volume onto new space.
- For this example we are going to assume that we have an existing logical volume on the rootvg volume group that is named homelv. The full path to this logical volume would be "/dev/rootvg/homelv". We can view information about this logical volume by typing "lvdisplay /dev/rootvg/homelv".
- To extend this existing logical volume onto the new space we use the lvextend command. Type "lvextend -L +20G /dev/rootvg/homelv /dev/sdc1". This command says that we want to increase the /dev/rootvg/homelv logical volume by 20GB. This is only possible if /dev/sdc1 is a member of volume group rootvg and there is enough free disk space on it.
- The last thing we need to do is increase the filesystem.
- Which command we use to increase the filesystem depends on what filesystem type we are currently using. If we are using reiserfs, we will use the "resize_reiserfs" command. If we are using ext3, we will use either the "ext2online" or the "resize2fs" command. On RHEL 5, we can use the "resize2fs" command, which will recognize that the filesystem is currently mounted and perform an "on-line" resize.
- On both resize_reiserfs and ext2online, the size is optional. If we want the filesystem to take up all the available space on our logical volume, we don't need to put the size. To extend the filesystem type either "ext2online /dev/rootvg/homelv" or "resize_reiserfs /dev/rootvg/homelv".
Monday, November 26, 2007
Wrong permissions breaks ssh.
Wednesday, March 7, 2007
Automatically unlock the default keyring on FC6
If you have NetworkManager in use on Fedora Core 6, you have probably seen this dialog box:

I got tired of entering my password every morning to unlock the default keyring, so I went looking for a solution. What I found was a module for use with PAM that would supply my system password to gnome-keyring for me. The module is called pam_keyring.so.
On Fedora Core 6 the steps that I used to implement this were:
1) As root install the module and it's documentation:
# yum install pam_keyring
2) Insert the following two lines into /etc/pam.d/gdm:
auth optional pam_keyring.so try_first_pass
session optional pam_keyring.so
Note that order is important in the gdm file. This is what my /etc/pam.d/gdm file looks like with the additions:
auth required pam_env.so
auth optional pam_keyring.so try_first_pass
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session optional pam_keyinit.so force revoke
session include system-auth
session required pam_loginuid.so
session optional pam_console.so
session optional pam_keyring.so
Now the system no longer prompts me for the default keyring password when I log in.