Network update: Leandra back online.

Jan 11, 2009

Maintenance on Leandra is finished. I took her offline around 2100 ESET5EDT on Saturday night to remove a dead DVD-ROM drive, remove a pair of 512GB memory modules that weren't doing anything, and swap out her 250 GB hard drive for a 500 GB drive. The RAID array has had 250 GB added to it; specifically, the logical volume holding everything but the /boot and / partitions has had 250 GB added to it. 15 GB from the free pool was added to /usr (so that more software could potentially be installed) and the rest of the free disk space was added to /home (where everyone's files and web content are kept).

In case you're curious about how I did it, the procedure is under the cut. If you're not interested, don't worry about it.

  1. Mark the partitions from /dev/sdb (the smaller hard drive) bad so they can be removed from the array: mdadm /dev/md0 --fail /dev/sdb1 && mdadm /dev/md0 --remove /dev/sdb1 (/boot)

  2. mdadm /dev/md1 --fail /dev/sdb2 && mdadm /dev/md1 --remove /dev/sdb2 (/)

  3. mdadm /dev/md2 --fail /dev/sdb4 && mdadm /dev/md2 --remove /dev/sdb4 ([this is the physical volume])

  4. Deactivate the second swap partition: swapoff /dev/sdb3

  5. Shut down, disconnect everything, perform hardware modifications.

  6. Boot into single user mode.

  7. Clone the partition table of /dev/sda to /dev/sdb: sfdisk -d /dev/sda | sfdisk /dev/sdb

  8. Add the new partitions to the mirrors: mdadm /dev/md0 --add /dev/sdb1

  9. mdadm /dev/md1 --add /dev/sdb2

  10. mdadm /dev/md2 --add /dev/sdb4

  11. Create a new swap partition on the second drive: mkswap /dev/sdb3 && swapon /dev/sdb3

  12. Wait for the mirrors to finish synching: while true; do cat /proc/mdstat; sleep 15; done

  13. Expand the LVM's RAID to encompass all of the new disk space: mdadm --grow /dev/md2 --size=max

  14. Expand the physical volume to encompass all of the new space in the RAID: pvresize /dev/md2

  15. Add 15 GB to /usr: lvextend -L+15G /dev/leandra/usr && resize_reiserfs /dev/leandra/usr

  16. Get an idea of how many extents are left unused in the physical volume so that /home can be maxed out: lvresize -L+600G /dev/leandra/home

  17. Take note of the number of extents that aren't in use (in Leandra's case, 60,690)

  18. Add the number of free extents to /home: lvresize -l+60690 /dev/leandra/home && resize_reiserfs /dev/leandra/home

  19. Reboot into multi-user mode.

  20. That's it.

This work by The Doctor [412/724/301/703] is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.