md + lvm2

It's just beautiful what happens when you mix Linux md with lvm2. I just added two 15K 146G disks to my system. They show up as sdc and sdd. Now I do this:

for x in sdc sdd; do
    parted /dev/$x mklabel msdos mkpart primary 0 100% set 1 raid on print quit
cd /dev; MAKEDEV md
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
pvcreate /dev/md0
vgcreate raid1 /dev/md0
for x in agriffis amg; do
    lvcreate -L 50G -n $x raid1
    mkfs.ext3 -L $x -O dir_index /dev/raid1/$x
    echo "LABEL=$x /home/$x ext3 noatime 1 2" >>/etc/fstab
mount -a
That leaves nearly 50G of free space on the physical volume into which I can grow either filesystem eventually, or add a third, depending on future needs.

Commentify contest

A little while back (in April), we had a contest on #noise that started with David's post regarding a script to comment out words in a C file. The general applicability of this script is questionable, but it was still a fun contest. Here are the instructions:

  1. Write a command-line filter which will comment out all matches of a pattern given on the command-line, reading a C program from stdin and filtering to stdout. Whether the pattern is a literal, glob, regular expression is up to the contestant.
  2. The filter should ignore matches that are already contained within a comment (including C++ style comments) or double-quoted string.

The existing gawk implementation on David's blog is an interesting starting point, though it doesn't fulfill all the requirements above.

Sample I/O:

  1. simple:input /output ("add")
  2. wacky:input /output ("wacky")
  3. deranged:input /output ("int")

The final results are in now! In order of longest to shortest:

  1. http://n01se.net/paste/9Cc (owen, awk, 169 chars)
  2. http://n01se.net/paste/MX (chouser, perl, 91 chars)
    http://n01se.net/paste/Lf (bob, perl, 91 chars)
  3. http://n01se.net/paste/OI (agriffis, perl, 85 chars)
  4. http://n01se.net/paste/Kf (aaron+kanaka, sed+cpp, 52 chars)

A community blog by the members of n01se.net

May 2006 / June 2006 / July 2006 / October 2006 / February 2007 / May 2007 / July 2007 / February 2008 / March 2008 / May 2008 /

Powered by Blogger