6. Block Storage#

This week we’ll begin to separate the various forms of data in our application into different storage media. Separation of our application data is critical to our application’s ability to scale. This week you’ll update your project to separate the storage in /var/www/html onto the cloud version of an extra hard disk. You’ll also learn how to format and mounts disks on Linux using the command line. This will be mostly a practice run for next week when we create a space for structured storage in an SQL database.

Labs#

Capacities and Filesystems#

After you’ve done the labs you should be able to implement an additional disk on your VM with the following features:

  • 10 GB of storage

  • Formatted with the ext4 filesystem

  • Mounted on /var/www/html

Keep track of your steps and document the results.

Project Documentation#

To meet the project requirements for this week you have to accomplish and document the following tasks:

  1. Create a persistent disk for storage of your application code and state

  2. Attach the storage to your VM

  3. Format and mount the persistent disk

  4. Update /etc/fstab to make sure the disk is mounted at boot

Check Your Progress#

I have written a script that will help you make sure that your project is on track so far. You can download it to your own computer if you want to look at it but it’ll be easier to run on Google Cloud Shell. In the cloud shell command prompt download the script with this command:

$ wget https://www.lifealgorithmic.com/_downloads/306593209aa730d05b1505eb7301329f/milestone-6-check.py 
$ chmod u+x milestone-6-check.py

You just downloaded a Python executable. You can execute it like this:

$ ./milestone-6-check.py

The script will analyze your cloud resources and print out some information. It will show you an error if it finds a problem. Submit the output of this program along with the milestone documentation.