Boot from a Block Storage volume

Linode’s Block Storage service lets you attach additional storage volumes to your Compute Instances. In addition to storing files and media, you can also use a volume as a boot disk. This can provide a low-cost way to maintain an image that can be quickly attached to a Compute Instance and booted up when needed.

This guide outlines the steps needed to boot your Compute Instance from a Block Storage volume. These steps include creating a new volume, copying the primary disk to that new volume, and configuring the instance to boot from that volume. The process may be reversed in order to restore the primary disk from the volume.

Create the volume

Create a Block Storage volume and attach it to the desired target Compute Instance. Verify that the volume is the same size as (or larger than) the primary disk and is in the same data center as the instance. Review the View, create, and delete volumes for instructions on creating a new volume.

Copy the primary disk onto the volume

  1. Boot the Compute Instance into Rescue Mode and assign the volume to /dev/sdc (shown below). The primary disk should remain assigned to /dev/sda. If your device assignments are different, you may need to adjust the commands or steps in this guide accordingly. Review the Rescue and rebuild guide for more information on booting into Rescue Mode.

    Mount the Block Storage volume as /dev/sdc and reboot into Rescue Mode

  2. Connect to the Linode via Lish.

  3. Run fdisk -l to confirm the Compute Instance's primary disk and Block Storage volume are available as dev/sda and dev/sdc, respectively.

  4. Run the following pv command to copy the contents of the primary disk to the Block Storage volume. Respectively, the options -pte output a progress meter, the elapsed time, and the estimated time remaining.

    pv -pte < /dev/sda > /dev/sdc
    

Set the Block Storage volume as the primary disk and reboot

  1. Power off the Compute Instance.

  2. Edit the Compute Instance's Configuration Profile. Under the Block Device Assignments section, assign the /dev/sda device to your Block Storage volume (shown below). Confirm that the root device is set to /dev/sda (this is the default setting). If your volume was previously assigned to any other device, such as /dev/sdc, set the device to None. Save these changes. Review the Manage configuration profiles on a compute instance guide for more information on editing configuration profiles.

    /dev/sda set to Block Storage volume

  3. Power on the Compute Instance.

The Compute Instance should boot normally from the Block Storage volume. Keep in mind that Block Storage may not be as fast as the instance's local storage and, as such, performance may be different.