LVM Quick Reference: Setup, Extend, and Resize Filesystems

This is a personal quick-reference for working with LVM (Logical Volume Manager) on Linux. It covers the full lifecycle from creating Physical Volumes through extending Logical Volumes, and finally growing the filesystem on top. ...

February 1, 2026 · 5 min · 899 words · christian

Reset Master Boot Record (MBR)

Since I’ve been playing with my AutoYAST setup for the last few days, working out the kinks (for example SLES10 not being able to install into the MBR), I needed a way to zap the MBR (as in remove grub to see whether or not the installation would install a new loader). So after quickly googling, I found this: 1 dd if=/dev/zero of=/dev/hda bs=512 count=1 That actually does the trick. The loader as well as the partition table are gone after wards!

August 8, 2014 · 1 min · 82 words · christian

diskinfo

Get a list of all disks and show the serial numbers 1 2 3 4 5 6 7 8 9 10 #!/bin/bash if [ ! -x /usr/sbin/hdparm ] ; then echo "Missing hdparm" exit 1 fi for disk in /dev/sd?; do echo "$disk: `hdparm -I $disk | grep "Serial Number:" | awk '{ print $3 }'`" done

July 27, 2014 · 1 min · 57 words · christian

idle3 wrapper

Another wrapper (like mdstat), that’ll look through my Western Digital disks and fix any disk not having the head parking timeout set to a configured value. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #!/bin/bash FIRMWARE_TIMEOUT_SH=138 if [ ! -x /usr/sbin/idle3ctl ] ; then echo "idle3-tools is missing." exit 1 fi for disk in /dev/sd?; do # idle time should be set to: 138 (300s) # 138-128=10 # 10x30=300 seconds FIRMWARE_TIMEOUT_IS="$( /usr/sbin/idle3ctl -g $disk | awk '{ print $5 }' )" if [ "$FIRMWARE_TIMEOUT_IS" -ne "$FIRMWARE_TIMEOUT_SH" ]; then /usr/sbin/idle3ctl -s$FIRMWARE_TIMEOUT_SH $disk fi done

July 27, 2014 · 1 min · 104 words · christian

Linux: Convert Gigabyte into Blocks

I just googled again for a Gigabyte to Blocks converter when I stumbled upon this: 1 echo "(15*1024*1024*1024)/512" | bc Easy to use and yet handy.

November 2, 2009 · 1 min · 26 words · christian

Adapter bonding on Linux

Well, today I had a rather weird error. I was testing the adapter bonding on one of the boxen designated as Tivoli Storage Manager Server, when I noticed that the bonding wasn’t working as expected when simulating an error (that is unplugging one of the TP cables for the bond). Now, the bond had “mode=6 miimon=100” as options. After running “linux bond debug” through Google (which turned up nothing useful, besides one document on the Oracle Wiki about IOS/Linux adapter teaming), I figured “Hey, just lets test switching the arguments.” And guess what ? ...

October 16, 2008 · 1 min · 115 words · christian