Thursday, October 9, 2008

Boot FreeBSD with Grub

If you have installed FreeBSD (or any operating system) and a partition and then later installed Linux (or any operating system with Grub) on another partition and can't get the latter to boot the former, add this line to /boot/grub/menu.lst

# For booting FreeBSD
title FreeBSD 7.0
root (hd0,1)
chainloader +1
In this case, the partition was /dev/sda2 which contained FreeBSD. Modify it for your needs.

Wednesday, October 8, 2008

Coraid documentation

I was able to do quite a bit of technical writing with Coraid. It is useful for those of you using AoE technology. I wrote all of the quickstart documentation here:

http://www.coraid.com/RESOURCES/Quickstart-Documentation

Also, I wrote the driver installation guides here:

http://www.coraid.com/SUPPORT/AoE-Drivers

A Tag Cloud that works with Blogger

I have spent a great deal of time trying to find a Tag Cloud generator that works with Google Blogger. Finally, I found one.

http://www.compender.com/2007/12/simple-tag-cloud.html

LVM snapshots

Here is a script to create LVM snapshots in Linux. It is a skeleton only provided for your modification and my reference, but I am using AoE storage as my PV.

#create PV

pvcreate /dev/etherd/e1.0

#create VG

vgcreate cascade /dev/etherd/e1.0

#create LV

lvcreate cascade -n original -L 500G

#make XFS filesystem

mkfs.xfs /dev/cascade/original

#mount (and use) LV

mount /dev/cascade/original /mnt

#freeze filesystem (will hang processes that are using IO on /mnt)

xfs_freeze -f /mnt

#create snapshot of original (works best if it is the same size)

lvcreate -s /dev/cascade/original -n backup -L 500G

#mount snapshot

mount -o nouuid,ro /dev/cascade/backup /mnt2

#backup directory with rsync or backup utility

#unmount LV

umount /mnt2

#remove snapshot

lvremove /dev/cascade/backup

#additional information is found here: http://arstechnica.com/articles/columns/linux/linux-20041013.ars and here: http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html

Wednesday, October 1, 2008

List largest (or smallest) files

If you want to find the largest files in a directory which are consuming precious space, you can use the following command:

openSuSEServer:~ # du -kh /var | sort -n | tail

then, to sort the smallest files, use the inverse command:

openSuSEServer:~ # du -kh /var | sort -n | head