Monthly Archives: April 2011

Upgrading Debian Lenny to Squeeze

Upgrade to Debian Squeeze if you have some Linux experience this upgrade should be fairly straight forward. Please read everything and do not skip steps unless you know what you are doing. You may be left with a system that will not boot. Please also consult the official Debian upgrade guide if you run into any problems or conflicts:


Debian upgrade guide


Create a list of installed packages and check the list for deinstalled packages this is an optional step to make sure you have a clean system:

uninstall=$(dpkg --get-selections > /root/package.list.lenny ; cat /root/package.list.lenny | grep deinstall |awk {'print $'1}) ; aptitude purge $uninstall

Check for half installed packages:

dpkg --audit

Remove Backuports and APT Pinnings Check for non debian sources and change them to the squeeze repo if available

Replace lenny entries with squeeze replace volitile with squeeze-updates:

Also make sure to add non-free and contrib in case your server needs the firmware-linux-nonfree package. This is a example sources list for squeeze if you live in Germany:

############################################################
deb http://ftp.hosteurope.de/pub/linux/debian/ squeeze main contrib non-free
deb-src http://ftp.hosteurope.de/pub/linux/debian/ squeeze main contrib non-free

deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free

deb http://ftp.hosteurope.de/pub/linux/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.hosteurope.de/pub/linux/debian/ squeeze-updates main contrib non-free
#############################################################

Update sources:

apt-get update

Check to see if you have sufficient disk space:

apt-get -o APT::Get::Trivial-Only=true dist-upgrade

Preform a minimal System Upgrade:

apt-get upgrade

Install the new kernel important otherwise your system may not boot because of the new udev version choose your kernel:

apt-get install linux-image-2.6-amd64

This would install the 64bit Debian Kernel

Check the Kernel Install:

dpkg -l "linux-image*" | grep ^ii

Upgrade udev:

apt-get install udev

If you see any firmware warnings make sure to install the firmware-linux-nonfree or the firmware-linux package before you reboot:

apt-get install firmware-linux-nonfree

or

apt-get install firmware-linux

Preform a system Upgrade or full upgrade:

apt-get dist-upgrade

Change init scripts to inssrv this is normally done automatically:

dpkg-reconfigure sysv-rc

Reboot the system

After first reboot Install Grub 2 to MBR:

upgrade-from-grub-legacy

rm -f /boot/grub/menu.lst*

Clean up and remove downloaded packages removing the downloaded packages is a optional step:

apt-get autoremove

rm -f /var/cache/apt/archives/*.deb

This step is also optional remove obsolete packages with deborphan helps to keep your system clean:

install deborphan:

apt-get install deborphan

Use deborphan to remove obsolete packages check the list first:

deborphan --guess-all

Then remove the obsolete packages:

deborphan --guess-all | xargs aptitude -y purge

Thats it you should have a clean system running Debian Squeeze

Manage HP Raid Controllers with hpacucli

This document is a quick cheat sheet on how to use the hpacucli utility to add, delete, identify and repair logical and physical disks on the HP Smart array controller. Some of these commands may need slight modifications. Please do not just copy and paste if you are not 100% sure what you are doing you may lose all of you data.


Utility Keyword abbreviations
Abbreviations chassisname = ch
controller = ctrl
logicaldrive = ld
physicaldrive = pd

drivewritecache = dwc

hpacucli utility
hpacucli # hpacucli

# hpacucli help

Note: you can use the hpacucli command in a script

Controller Commands
Display (detailed) hpacucli> ctrl all show config
hpacucli> ctrl all show config detail
Status hpacucli> ctrl all show status
Cache hpacucli> ctrl slot=0 modify dwc=disable
hpacucli> ctrl slot=0 modify dwc=enable
Rescan hpacucli> rescan

Note: detects newly added devices since the last rescan

Physical Drive Commands
Display (detailed) hpacucli> ctrl slot=0 pd all show
hpacucli> ctrl slot=0 pd 2:3 show detail

Note: you can obtain the slot number by displaying the controller configuration (see above)

Status

hpacucli> ctrl slot=0 pd all show status

hpacucli> ctrl slot=0 pd 2:3 show status

Erase hpacucli> ctrl slot=0 pd 2:3 modify erase
Blink disk LED hpacucli> ctrl slot=0 pd 2:3 modify led=on

hpacucli> ctrl slot=0 pd 2:3 modify led=off

Logical Drive Commands
Display (detailed) hpacucli> ctrl slot=0 ld all show [detail]
hpacucli> ctrl slot=0 ld 4 show [detail]
Status hpacucli> ctrl slot=0 ld all show status
hpacucli> ctrl slot=0 ld 4 show status
Blink disk LED hpacucli> ctrl slot=0 ld 4 modify led=on
hpacucli> ctrl slot=0 ld 4 modify led=off
re-enabling failed drive hpacucli> ctrl slot=0 ld 4 modify reenable forced
Create # logical drive – one disk
hpacucli> ctrl slot=0 create type=ld drives=1:12 raid=0

# logical drive – mirrored
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14 size=300 raid=1

# logical drive – raid 5
hpacucli> ctrl slot=0 create type=ld drives=1:13,1:14,1:15,1:16,1:17 raid=5

Note:

drives – specific drives, all drives or unassigned drives
size – size of the logical drive in MB
raid – type of raid 0, 1 , 1+0 and 5

Remove hpacucli> ctrl slot=0 ld 4 delete
Expanding hpacucli> ctrl slot=0 ld 4 add drives=2:3
Extending hpacucli> ctrl slot=0 ld 4 modify size=500 forced
Spare hpacucli> ctrl slot=0 array all add spares=1:5,1:7