Mount Volume as root file system?

My goal is to have a persistent VM that does not incur cost while it is "shutdown". I am thinking I can copy the root file system to a volume, and then automate these processes:

Startup:

  • Create linode w/ volume attached
  • Configure linode to mount volume at /
  • Reboot linode with new root (maybe we can even do it without a reboot)

Shutdown:

  • Delete linode

I'm thinking this can be automated with the linode API and stackscripts. Just messing around now with booting to a volume. I changed /etc/fstab to mount the volume at / but it didn't take effect on reboot. I don't know much about linux boot process, so I figured I'd ask here for suggestions while I dig into this.

1 Reply

I've done something like this before. You will need to change, in your configuration profile for your Linode, not /etc/fstab, that /dev/sda be your block storage volume. The root device you can keep as /dev/sda, then you ought to be able to boot off the block storage volume successfully.

You'll need to copy everything from the Linode disk over to the block storage volume, without copying the content of any tempfs file systems. Some examples would be /dev /proc /sys /tmp /var/run and any other mounted file systems that will be mounted on each boot.

As for creating a Linode that will boot off the block storage volume immediately, unfortunately, I don't think this is available through the Linode API, not without a bit more complexity than you suggest, that is. I would personally like a Linode without disk space for something like this, as the disk would be the block storage volume itself. Unfortunately, such a thing isn't available.

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