Andrew Pollock: [tech] LVM, you've done it again
The good thing about having kept a blog these last few years, is I have a
searchable record of hardware changes.
Recently, I noticed a few disk errors on caesar, and I was
wondering how old that disk was. I disk some searching, and found via this post
that the disk in it was a hand-me-down from when I decommissioned
daedalus Mk I. One of the reasons I decommissioned it when I did,
was the RAID-1 was exhibiting some strange errors during resynchronisation,
and I didn't want to leave the country leaving behind an ageing problematic
server with my stuff on it.
I'd previously been unable to fault either 120 Gb disk under some light
testing with badblocks, so I just reused them, and so around
October 2005, I put the larger disk in caesar. So this disk has
seen a fair bit of use, originally in daedalus, and then in
caesar for another 20 months. It's allowed to fail, it's served me
well.
Anyway, so I bought a 750 Gb drive a couple of weeks ago, because one thing
that I've wanted to do with caesar was do remote backups of
daedalus, and there just wasn't enough space to do that, so I went
for as big as I could find, and essentially repeated the same trick as last
time, to upsize:
- Power down, attach new disk as a slave
- Boot into single user mode
- Unmount everything, remount root read-only
- sfdisk -d /dev/hda sfdisk /dev/hdb to copy the partition table (I use a root, swap, LVM, three partition layout)
- dd if=/dev/hda1 of=/dev/hdb1 bs=1M to copy the root filesystem to the new disk
- mkswap /dev/hdb2 to put the swap signature on what will become the new swap device
- cfdisk /dev/hdb and blow away the third partition and recreate it using all of the available space (there's probably a programmatic way of doing this, but hey, it's not exactly hard to do in cfdisk either)
- pvcreate /dev/hdb3 to put an LVM signature on the new LVM physical volume
- vgextend base /dev/hdb3 to tell LVM there's two disks in the volume group for the time being
- Remount the root filesystem read-write
- rm /boot/grub/device.map and run /usr/sbin/grub-install /dev/hdb to install GRUB in the MBR of what will become the new boot disk
- Power down, swap the disks around so that the new disk is now primary and the old disk is now the slave
- Boot into single user mode again, unmount everything except root
- pvmove /dev/hdb3 /dev/hda3 to relocate all of the allocated physical extents off the old disk onto the new one
- Twiddle thumbs for a couple of hours. Admire artwork on computer's motherboard (did you know Compaq EVO's have a picture of a car on their motherboards? A map of Texas?)
- vgreduce base /dev/hdb3 to take the old disk out of the volume group
- pvremove /dev/hdb3 to remove the LVM signature from the old disk
- Power down and remove the old disk
- Reboot into multi-user mode and profit from all the additional free physical extents





Meanwhile, Gian-marco, my future flat mate, had spent the day packing up
everything that was left in my old flat, where I had left an utter mess.
A colleague of mine was to sublet the place starting that Saturday, so there
were roughly 48 hours left to empty and clean it, and to hand it over. There
are more pleasant things in heaven and earth than to have someone else empty
your flat for you.
Morphine is a really crazy drug. Most people think of it as fuzzy and often
joke about taking it if only they could get their hands on it. Having made the
experience, I'd rather not take it again unless I have to. Watching television
turned out to be impossible, even the weather report went too fast for me.
Visitors appeared sort of blurry, I would often not follow the things they
said, and it was definitely impossible to entertain thoughts for prolonged
periods of time, or to engage in any sort of productive thinking. Organising
a cleaning lady for my old flat and giving instructions to my cousin, who
would hand over the flat took all my energy
On Friday, I was to have an important business meeting with three people, so
I organised a room in the hospital and asked the nurses to put me on optional
morphine so I could be a bit more present during the meeting. As
a consequence, I could press a button once every ten minutes for a dose of
morphine, and with this new level of control, I began to reduce the drug
amount in my blood gradually.
The meeting did not take place in the end but I came to regret my choice to
reduce the morphine at around midnight, when the pain in my knee became
unbearable. I kept pressing the button for more morphine like a madman, but
the device would only deliver a new shot every 10 minutes. The nurse was not
authorised to change that and instead gave me other pain and sleep medication,
but not even the combination of morphine, Tramal (an opiod), Novalgin,
Mefenacid, and Paracetamol could dampen the level of pain, and so I spent
almost three hours in real agony, biting the pillow with tears running down my
cheeks, until finally the medication won, I became indifferent (thanks to
Temesta) and drifted off into sleep.
After breakfast the next morning, the morphine applicator suddenly had a fit,
started beeping, and pumped more drug into my body than it should have. It
took me about 20 minutes or maybe an hour (who knows ) to put my brain
together, realise what had happened, and come up with a way to lift my finger
to the button to call the nurse. Despite the horrible night, I told them to
remove the morphine because I'd rather stand the pain than have my brain
mushed like that, plus there are always plain morphine injections delivered by
humans instead of machines.
In fact, the next night I could feel the pain approaching and since it's
easier to suppress pain than it is to remove it, I asked for a sleeping pill
and a morphine injection. The injection did three things: first, it hurt so
much that my knee immediately became pain-free while nerve central was
occupied trying to figure out what the heck had just happened in my right
thigh. Second, it did not take three minutes to kick in, and it kicked in so
strongly that I just barely realised that my head was suboptimally positioned
on the pillow and the lights still on, but failed to do anything about it.
I did not wake once until breakfast. And third, I am glad to know that
morphine does actually (still) work. Pain is complex, fascinating, useful,
sometimes even pleasurable to some, but when you know the cause and you'd
rather make it stop, it's comforting to know that there are ways the
previous night had instilled some doubt in me.
From then it was all downhill and I left the hospital after eleven days on
Thursday, got by without pain medication the same day and off the sleeping
pills the next night. Two days later I was already racing around town in my
wheel chair:
By now I can actually walk again, albeit slowly, and even though I still
cannot lift heavy stuff or get my hands wet, my hands are a lot better; on 21
May, the casts shall be removed and I'll be able to bend my knee again, but it
may take up to a year to return to sports, such as running, to which I had
just become addicted. In fact, I can comfortably claim that I had just
reached an acceptable level of fitness just before the injury. Tough luck.
My mother has come to Zurich twice already to help unpack and with her
invaluable help, as well as the help of Gian-marco and several others, we are
actually almost done moving in. Ironically, it's actually quite annoying to
sit and watch others do your work; I would have helped as well, had the roles
been inverted, and yet I am still greatly indebted. Human relations tend to be
funny like that.
Let me end with two points: first,
Four pictures of the new tray. The person is my cousin's
assistant.
That's the clicker, right under that SAQ brochure about Italian wines. DOH! Moral of the story: attach your car-alarm clicker very carefully to your keychain. Sure, not much of a moral, but it's what I learned today.
tags: