Best way to archive & delete an old filesystem?

I keep a pair of linodes running as a production/replacement pair, that is, one server is built out as a new production system and after migrating production data from old to new, the old server is eventually built out as the next new production system and the cycle repeats.

That's all well & good. The issue is that I have an old 18GB filesystem (a retired production system) that I want to archive by copying to a local machine. I don't want to boot the old production system; I just want to copy the offline filesystem to local hardware so I can safely delete it from my linode instance.

If I was doing this with real hardware, I'd use dd on an unmounted disk partition then compress it into an archive, copy the compressed disk image to a different box, then delete the old partition from the original disk.

Again, this is easy with dd, bzip2, scp, and fdisk, and (as I've just discovered) you can use this method by mounting the old filesystem/partition on the new configuration as (say) /dev/xvde or some higher unused device. Reboot and it's accessible. If you have enough free disk space, you can mount /dev/xvde on /mnt, tar up the important stuff, copy this archive to local disk and safely delete all the stale data from Linode. Depending on how full the old filesystem was, this can save a lot of space and bandwidth over carting around large, sparsely-populated disk images.

On the other hand, if you don't have enough free disk space on a linode for that method, you can always ssh in and use rsync, dd, or tar to pipe a disk image or files back to your local machine, praying the connection doesn't drop.

Problematically, this method means you still have to tweak your running linode's configuration and reboot. This is not a huge deal if you're doing this on a secondary server as in my case, but as a mostly-ex-sysadmin I get twitchy about rebooting servers to make "small" configuration changes. I'm protective of my uptime… ;)

The pack rat in me wants to save the old data but keeping archive data on live servers is wasteful; it's a stupid use of shared resources, it slows down migration, and it can interfere with Linode upgrades since keeping inactive 32-bit instances around makes you ineligible for some free upgrades (incentivizing migration like this is absolute fricking genius BTW.)

Is there a (good) way of archiving a filesystem without rebooting?

PS: Yes, I solved my original problem midway through writing this but I'm still curious if there's a simpler, better way of doing what I'm trying to do.

3 Replies

@arclight:

I'm protective of my uptime… ;)

You shouldn't be. In this day and age of constant patches, a high uptime doesn't mean you're a good sysadmin, it means you haven't patched recently.

My employer (large multinational) considers an uptime over something like 120 days to be a break and 180 days to be a critical one.

@glg:

You shouldn't be. …

I know, but to be fair, most updates today don't require a reboot. OS vendors & designers have done a pretty decent job of pushing stuff out of system space into user space where it can be patched without too much disruption.

If you don't want to reboot and fool around with your node, I'd say create a new node and copy the disk image over to it via the manager. (You can do that without rebooting or shutting down.) Then you can deploy a minimal distro or boot up rescue mode and dd/tar/rsync/scp to your heart's content. As a bonus, if you need to, you can use a larger plan so you have enough disk space to tar everything or whatever.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct