New Laptop
What I _actually_ wanted to write about was installing Debian on my new laptop, in a geeky kind of way.
It’s been about 2 years since I did anything other than a clean install on a machine, and in that time it seems things have come along a little. The new machine is a Thinkpad, so all the dull hardware compatibility stuff is up on ThinkWiki as per. They also have some handy instructions on how not to destroy all your data.
Good news!!! QtParted is now able to resize NTFS, which has been a long time coming and means I no longer have to blitz the XP install that came with the laptop. It’s supported on the most recent Knoppix CD and, being determined and stubborn as is my wont, I decided I’d try and do the install manually from there instead of trying something more conventional like a Netinst CD.
Step 1: Burn the Knoppix CD. Straightforward enough
Step 2: QtParted. The Thinkpad comes with an NTFS partition at the start of the drive and a recovery partition at the end, so the rest is yours to play with. My first thought was just to make the rest LVM, but I couldn’t for the life of me make grub install to an LVM partition. Second attempt involved a little boot partition and an LVM root, which seems to work better.
Step 3: debootstap debian into the LVM partition. Something like…
mke2fs /dev/sda2 # The boot partition
tune2fs -j /dev/sda2
pvcreate /dev/sda3 # The LVM partition
vgcreate vg /dev/sda3
lvcreate -L10G -n slash vg
mke2fs /dev/vg/slash
tune2fs -j /dev/vg/slash
mkdir /tmp/bootstrap
mount /dev/vg/slash /tmp/bootstrap
mkdir /tmp/bootstrap/boot
mount /dev/sda2 /tmp/bootstrap/boot
debootstrap etch /tmp/bootstrap http://ftp.uk.debian.org/debian
chroot /tmp/bootstrap
apt-get update
apt-get install linux-image-2.6.18-5-686
exit
grub install --directory=/tmp/bootstrap/boot /dev/sda
et voila, as ze French would ‘ave it. Well, ish. Turns out that doesn’t work. Even if you persuade grub to do the right thing it is, it seems, the devil’s own job to create an initrd that’ll boot with an LVM rootfs (can’t find a good link to explain rootfs). I’m sure there are people that can make that happen. I didn’t really have the patience or the knowhow.
Step 4: Give up, install from the Netinst CD. It just works, and supports all the LVM goodness you could ever wish for.
Step 5: Copy /home from your old machine. One of the really lovely things about Linux is that once you’ve copied your home directory to your new machine, the place really does feel like Home (fsvo ‘once’. You still need to make sure you have roughly the same packages installed).
What most impressed me, though, was that having allocated only 10GB as the initial rootfs I was able, while everything was mounted and running, to resize things. Turns out that lvextend and resize2fs can both be run on the mounted filesystem, which makes having to choose the ‘right’ size for the initial partitions completely redundant. I now have nice /home, /var, /, and /var/warez partitions and needn’t worry about any of them running out and time soon since I still have 30GB unused in the LVM. Should also prevent the ol’ “/var/cache/apt/archives ate my entire disk and I didn’t realise” problem that I often have with Debian. It ought to be as simple as just removing the files in there from time to time, but I never seem to realise until the disk is full. Limiting /home also has the advantage that I’ll know when it becomes un-backup-able in advance of my disk filling up.
So there was that. I’m a happy bunny now with my new lappy. In other news, alsaconf autodetects soundcards and s2disk suspends to disk first time (and resumes!). I could bitch about having to compile my own kernel because of cutting-edge wireless ipw3945 stupidity, but I won’t. I’ve entertained you long enough.
That was me writing about Linux. Because we’re still in a ‘getting to know you’ phase, I’ve been heavy on the hyperlinks. I don’t know who you are or how much you know, and I wouldn’t want anyone to feel excluded by the use of jargon, idiom and turn of phrase. I’ll stop extending that courtesy just as soon as it gets boring (in about 10 minutes). If in doubt, Wikipedia, then Google, then Urban Dictionary. Can’t lose.