As a recent cost saving measure I downgraded my Linode to the Nanode plan. I was actually only using around 25GB of the 50GB disk I had available anyway on the previous plan, it’s just that I had it spread out over three 10GB partitions (/home, /usr, /) and then I kept another couple of disks for a NetBSD install image and a scratch disk I could use when in rescue mode (so I could download a new NetBSD image and extract it for copying to the install disk).

I.e. day to day I could easily fit in 25GB… I just needed the extra for upgrades. Now Linode have block storage (they’ve had it for ages… I move slowly) I can add a volume or two just for when I need to upgrade stuff and then remove it afterwards. That’s my plan anyway.

Memory-wise I was also sitting within 1GB of RAM. The most memory intensive thing I ran was the Keybase client for, very rarely, chatting to people. I can just not use it and I should be fine with only 1GB RAM.

To scale down I needed to get my 10GB root partition down to a 5GB disk. You can’t scale down raw disk images on Linode so I roughed out a plan in my head for doing this along the lines of:

  1. Add new, smaller 5GB disk for root (since I had enough spare on the larger plan)
  2. Also add a new, temporary, disk to dump to
  3. Reboot in single user. Don’t mount /usr and /home
  4. Dump old root to the temp disk, e.g: dump -0af /dump/root.dump /
  5. Restore dump to new root disk, e.g: cd /newroot; restore -rf /backup/root.dump
  6. Adjust Linode config to boot off the new root disk and reboot to check it works
  7. Shutdown Linode
  8. Remove all other Linode disks so I’m within 25GB
  9. Resize
  10. Restart

It didn’t quite work. I forgot / realised too late simply dumping and restoring root would not result in a bootable disk (maybe it would if I was better with disklabel) so I had to tweak things a bit. I’d also glossed over the details of setting up new disks so somewhere in the middle of the above I also did:

  1. Create a Linode configuration that boots my NetBSD install image, but also has the new 5GB disk attached
  2. Install NetBSD to this new 5GB disk (which also made adding swap easier)
  3. Reboot again with old root in single user mode with new 5GB disk attached
  4. Mount root as read/write so I could do stuff: mount -u /
  5. Partition dump disk disklabel -i -I wdX, etc
  6. Add filesystem: newfs /dev/wdXa
  7. mkdir /dump and mount /dev/wdXa /dump
  8. Dump out old root
  9. Mount new root and delete everything under it
  10. Restore the dump of old root in that mount
  11. Reboot a config using the new root to check it all works

It wasn’t too stressful in the end and worked pretty well. I messed up my bootblocks again and only have Glish working right now, but will fix that again at a later (upgrade) date.

When I started on Linode, and had less money than I have now, I was paying $20 a month; Probably the exchange rate was pretty good then though. I’ve been at the $10 plan for years. Seems crazy I’m now on the $5 plan. But it’ll all help with the cost of running shoes… I could do with two new pairs already.