My x86-64 home server box has 4TB of raw storage capacity, recently doubled from 2TB. That could have been more trouble than it was worth, as we start hitting limits.

There are several problems.

  • There is no way to manage more than 2 TB of space with the normal MS-DOS partition table. The GUID partition table scheme can do it, and Linux can use it.
  • The machine's (Dell PowerEdge 2900) BIOS can only boot from an MSDOS-labelled disk. update: A future version of grub may work around this, relying on the fact that GPT boot table has a MBR-like fake boot sector too.
  • 2TB of the raw disk space has already been partitioned and a good fraction filled. Backing up and restoring everything was not an alluring option. I want to migrate in-place!
  • The whole 4TB of raw space has been already assigned to the sole RAID5 array (including a hot spare disk - 3TB usable). There was no room to make a new small virtual disk just to boot from and use the msdos disk label.

My solution has several parts.

  • USB. Arrange to boot off a "small" 1GB flash drive. (We keep an image of that usb drive on the hard drive for a backup.) It is mounted under /boot as usual, and is kept up-to-date by grub automatically. /boot/grub/device.map may need to list the USB drive's BIOS name - probably (hd0), and the disk controller's BIOS may need to be turned off, to make sure the USB drive wins the boot-y-lympics. Check that the initrd image still includes the disk controller's driver, as that's where the root partition etc. will be. (Alternatives would have included booting off of a floppy or a bootable CD, but neither would be automatically maintained as the machine undergoes kernel upgrades.)
  • Gather information about old partition table. Record the current bounds of all the existing partitions, measured in sectors: Make a backup of the old table, in case things go wrong.
    # sfdisk -uS -l /dev/sda
    Disk /dev/sda: 364407 cylinders, 255 heads, 63 sectors/track
    Units = sectors of 512 bytes, counting from 0
    
       Device Boot    Start       End   #sectors  Id  System
    /dev/sda1   *        63    208844     208782  83  Linux
    /dev/sda2        208845  80324999   80116155  83  Linux
    /dev/sda3      80325000 2766441194 2686116195  83  Linux
    /dev/sda4     2766441195 2927091194  160650000   f  W95 Ext'd (LBA)
    /dev/sda5     2766441258 2927091194  160649937  82  Linux swap / Solaris
    # dd if=/dev/sda count=1 of=/boot/SDA-MBR-BACKUP
    

    Of these, the first three (type 83) partitions are valuable. Take careful note of the "Start" and "End" columns.

  • Boot to single-user. Or boot from a livecd, or installation cd, or whatever can give you GNU Parted.
  • Write new disk label:
    # parted /dev/sda
    (parted) unit s
    (parted) mklabel gpt
       ... contemplate warnings, then approve ...
    (parted) mkpart primary ext3 63 208844
    (parted) mkpart primary ext3 208845 80324999
    (parted) mkpart primary ext3 80325000 2766441194
    (parted) quit
    

    Double-check those numbers, then reboot.

  • Get some confidence in the preserved filesystem data. Run fsck; use the machine as if nothing happened.

Finally, you can extend the partitions (resize2fs), add new ones, with the machine running, and the full storage available to play with.

Posted Tue Jun 5 12:07:00 2007 Tags:

In another late night grocery shopping outing, the usual 70’s / 80’s muzak played on the PA system.

As I wondered up and down the strategically organized aisles, designed to maximize my time and thus spending, the music dragged one part of my brain back in time. Briefly, I recollected the circumstances of first hearing those tunes, all those years ago.

Then it hit me. That’s exactly what they want! More than soothing nostalgia: it’s time travel. Combine this with quantum theory, find the music of the early universe, play it in the grocery store, then poof! We’re there with the protostars of the Bing Bang.

Posted Fri Jun 22 14:19:00 2007 Tags:

The subject exclamation is heard frequently during our afternoon family walks around the block. Eric yells out this phrase (or one of a few similar others), syllable by syllable, when he wishes to track down the sources of an echo. Confused passerbys just tilt their heads in wonderment. I guess they can’t hear backwards.

Posted Fri Jun 22 20:08:00 2007 Tags:

An extreme web performance bug with my new gallery2 setup is new evidence that bind9 views are a good idea.

What happened was that the public web server was partially misconfigured to send out URLs for CSS and such tidbits, containing a host name that only made sense on our home (internal) network. Being a true-blooded creature, of course this name resolves to an RFC1918 internal address. Being a lazy sysadmin, this name is resolvable on our external DNS server.

See the problem? We mistakenly ask faraway web browsers to refer to a name that resolves, but only to an internal address – one that will definitely not reach my machine from the outside. How badly this blows up depends on the client network. Where no 192.168.* network is nearby, this results in quick little errors, and barren web pages. Where there is such a network nearby, and it’s firewalled strangely, those CSS fetch attempts may take a whole TCP connection timeout to get rejected. Repeat once per web page, and you get … minutes or more of wait time.

The cure? Twofold: fix the web application’s outgoing URLs; separate the internal & external DNS tables, so that even if an internal host name gets out, it will get detected as an error right away.

Posted Tue Jun 26 19:11:00 2007 Tags:

Roseanne Barr is getting into the act of amateur punditry. She clearly needed more cranial engagement when she wrote this:

IMPEACH THE PRESIDENT AND THE VICE PRESIDENT, THEY ARE TRAITORS TO AMERICA, . . . SAVE THE DROWNING PEOPLE IN NEW ORLEANS! ANYONE WHO MENTIONS PARIS HILTON ONE MORE TIME MUST DIE!

With that extra cup-o-joe that morning, or with some psych counselling, she might have skipped that last part – where she calls for her own death.

Posted Sat Jun 30 06:32:00 2007 Tags: