Block Storage Attach On Boot


SpinUp recommends that you set up your Block Storage volume to attach on boot.

Prerequisites

You need to have a Cloud Server with a Block Storage device attached. The following guides go into detail on how to accomplish these steps:

Create Cloud Server

Create Block Storage Volume

Attach Block Storage Volume

Mounting on boot

After your volume is attached and mounted, you must ensure the volume is automatically mounted each time your server is rebooted.

Reference the appropriate tab below:

Make the volume persistent on a Linux® server

Step 1: Modify fstab

  • Add the following line to /etc/fstab/:
  
      

echo "/dev/xvdb /opt/block-storage-mount ext4 defaults,noatime,_netdev,nofail 0 2" >> /etc/fstab


  

Step 2: Detach

  • Detach the Block Storage volume:
  
      

umount /dev/xvdb /opt/block-storage-mount/


  
  • Verify the mount is detached:
  
      

df -h
(out)Filesystem      Size  Used Avail Use% Mounted on
(out)/dev/xvda1       20G  1.9G   17G  10% /
(out)devtmpfs        482M     0  482M   0% /dev
(out)tmpfs           493M     0  493M   0% /dev/shm
(out)tmpfs           493M   19M  474M   4% /run
(out)tmpfs           493M     0  493M   0% /sys/fs/cgroup
(out)tmpfs            99M     0   99M   0% /run/user/0


  

Step 3: Verify auto-attach

  • Issue a mount all command:
  
      

mount -a


  
  • Verify the Block Storage volume mount:
  
      

df -h
(out)Filesystem      Size  Used Avail Use% Mounted on
(out)/dev/xvda1       20G  1.9G   17G  10% /
(out)devtmpfs        482M     0  482M   0% /dev
(out)tmpfs           493M     0  493M   0% /dev/shm
(out)tmpfs           493M   19M  474M   4% /run
(out)tmpfs           493M     0  493M   0% /sys/fs/cgroup
(out)tmpfs            99M     0   99M   0% /run/user/0
(out)/dev/xvdb        74G   53M   70G   1% /opt/block-storage-mount


  

Make the volume persistent on a Microsoft® Windows® server

Generally, attaching, mounting, and formatting the volume on your Windows server also makes it persistent.

Feel free to review the How-To Guide on attaching for these steps.

Next steps

At this point, the system should automatically mount your Block Storage volume to your Cloud Server every time you reboot.

Feel free to check out some of our other How-To Guides on Block Storage and the other fantastic SpinUp products.


Related Content