A block storage service functions as a hard drive provided over the network. Developers can use block storage services to store files, combine multiple devices into a RAID array, or configure a database to write directly to the block storage device. Block storage offers a different set of capacities than object storage, which allows developers to store unstructured data using an HTTP API. Developers working on complex applications often need to take advantage of both options.
For more resources about block storage, please visit:
A complete list of our block storage-related tutorials, questions, and other educational resources can be found on our block storage tag page.
Part of the Series:
How To Build a Website With HTML
This tutorial series will guide you through creating and further customizing this website using HTML, the standard markup language used to display documents in a web browser. No prior coding experience is necessary but we recommend you start at the beginning of the series if you wish to recreate the demonstration website.
When arranging elements in an HTML document, it’s important to understand how these elements take up space on a webpage. Certain elements can take up much more space on the webpage than the content they contain. Understanding the behavior of different element types will help you anticipate how they affect the position of other elements on the page.
In general, there are two different types of elements—inline-level elements and block-level elements—whose spacing defaults behave differently from one another. Below, we’ll describe how the default settings of these elements determine their position on the webpage and relative to the position of nearby elements.
Inline elements are elements whose horizontal width is determined by the width of the content they contain. The <strong> element and the <em> element we covered in the last tutorial are both examples of inline elements.
We can use Firefox’s Web Developer Inspector to inspect the size of HTML elements on a webpage. (If you are using Chrome, you can use the Developer Inspect Elements tool instead but this tutorial will give instructions for Firefox’s Web Developer tool.)
Return to the index.html file that you loaded in your browser. If you need to reload it and don’t remember how, refer to the instructions Loading an HTML File in your Browser from the last tutorial.
Then navigate to the Tools menu item in the top menu bar and select “Web Developer/Inspector.” Selecting this menu item will open up the Inspector interface that allows you to inspect the HTML and CSS of a webpage. Next, hover your cursor over the text My strong text, which should highlight the text in light blue. This highlighting shows the full extent of the space occupied by the element that your cursor is hovering over. As you may have expected, the element’s occupied space is just large enough to contain its text content:
Unlike block-level elements, which we’ll cover in the next section, inline elements do not take up their own line of horizontal space. Thus, inline elements will rest side by side on a webpage if you do not specify a break with an additional HTML element, such as the line break <br> element. This sizing default is often convenient, as you may want to mark up single words in a paragraph with an inline element such as <strong> or <em> without pushing subsequent text to the next line.
Try adding the <br> tag in between your two lines of code in the index.html file. (You will need to return to your file in the text editor.) Note that the <br> element only requires an opening tag and does not wrap around any text:
Save and reload the document in your browser to check your results. You should receive something like this:
My strong text My emphasized text
Your two phrases should now be on separate lines as they are now separated by the line break element <br>.
If you use the Firefox Web Developer Inspector to check the size of the elements, you can confirm that the width of each of the text elements is still determined by the width of the text content:
Block-level elements behave differently than inline-level elements in that they take up an entire line of horizontal space on a webpage. This means that they automatically start on a new line and that they automatically push subsequent elements onto a new line as well.
For example, the HTML heading elements (<h1> through <h6>) are block-level elements that automatically place their content onto a new line and push any content that follows onto a new line. Each of these six heading elements represent a different heading size.
Let’s study how this works in practice. At the bottom of your index.html file, try pasting in the highlighted code snippet:
Save your file and reload it in the browser. You should receive something like this:
Let’s now inspect the block-level heading elements to study how they differ from the inline-level text elements above. Open up the Firefox Web Developer Inspector and hover over each of the elements to inspect their occupied space as indicated by the blue highlighting. You should be able to confirm that the occupied horizontal space of each of the inline-level elements is determined by its text content, while the occupied horizontal space of each of the block-level elements stretches across the entire web page:
Block-level elements will always push inline-level elements down to the next line, even if you write those HTML elements on the same line of the HTML document. To confirm this for yourself, try writing a block-level element and an inline-level element on the same line of your index.html file. Erase the existing content from your file and add the following code snippet:
Can you guess how this HTML code will render in the browser? Save your file and reload it in the browser. You should receive something like this:
Notice that the heading element <h1> has started on a new line and pushed the subsequent text element to a new line even though the elements were written on the same line in the HTML document.
You should now have an understanding of how inline-level and block-level elements are positioned and how they affect the position of nearby elements. Remembering their distinct behaviors can be useful when arranging HTML elements in the future.
We’ll continue learning about new inline and block elements in the tutorials ahead.
Use promo code DOCS10 for $10 credit on a new account.
What is Block Storage
Block Storage is a type of persistent cloud data storage that is similar to a traditional block device, like the hard drive in a PC. With Block Storage, your data is divided into blocks, which are the small, discrete units that Block Storage can read from and write to. These blocks are assigned unique identifiers, but these are generally not human-readable, so a filesystem is usually installed which maps your files to the underlying blocks they correspond to. This relationship is also analogous to your PC’s filesystem and hard drive.
A Block Storage Volume houses these blocks of data. Volumes can be attached to a cloud computing instance, which makes its data and filesystem available to the instance. If your instance is running Linux, then mounting a Volume’s filesystem is just like mounting any other filesystem.
Volumes are stored separately from your cloud instances, but inside the same data center, and they are attached via the data center’s private networking. A Volume can be detached from a cloud instance and its data will persist, even if the cloud instance is deleted. The Volume can also be re-attached to a different instance (though only one attachment at a time is possible). Volumes can also be increased in size at any time, independent of an instance’s built-in storage.
Benefits and Limitations
A Block Storage Volume augments the raw storage capacity of a cloud instance, which can be useful if your storage needs are greater than your computing demands. Because a Volume is scalable, it can adapt as your data grows in size. Additionally, all data stored with Linode Block Storage is replicated three times, so your Volumes are highly available and fault tolerant.
While the health and uptime of Linode Block Storage is closely monitored by Linode Support, we still recommend making separate backups of your Volumes.
Because Volumes are directly connected to an instance, their I/O speeds are much faster than those of an alternative storage solution like Object Storage. As well, the nature of Block Storage allows you to read and write small parts of your data, which means that you can incrementally update your files. This is in contrast to Object Storage, which requires a full re-upload of a file to update it.
Some aspects of Block Storage lead to natural limitations. In particular, a Volume needs to be attached to a cloud instance for its data to be accessible. In comparison, a file stored in Object Storage can be downloaded by any internet connected client at any time.
Below you will find some of the more popular use cases for Block Storage.
Databases require quick read/write operations, and Block Storage Volumes are mounted directly to a cloud instance’s filesystem, so there is a minimal delay in writing and retrieving data. Growing businesses often have increasing data storage demands, so it’s also important for a database to be scalable. A Volume that stores your database can be resized to meet your storage needs.
Block Storage Volumes can be detached from a cloud instance just as easily as they are attached, meaning that it’s possible to create hot-swappable drives with Block Storage. This is useful if you need to perform the same kind of tasks across a fleet of instances with the same data.
While the Block Storage service has full support for hot swapping, it is important to follow the detachment instructions outlined in our Using Block Storage guide. If a Volume is not safely detached, there is a risk of data loss for the Volume.
Containers, like those created with Docker or inside Kubernetes Pods, can benefit from having some type of persistent storage. This helps to keep a container’s size down and makes it easy to maintain data outside of the normal lifecycle of the container or Pod.
If you are using Docker, you can use the Docker Volume Driver for Linode to create a Docker volume from a Block Storage Volume. Similarly, if you are using Kubernetes you can use the Container Storage Interface (CSI) Driver for Linode Block Storage to create a Persistent Volume Claim that’s backed by a Block Storage Volume.
Running Cloud Software
In a climate where ownership over one’s data is an important need for many individuals and organizations, hosting your own cloud software is a great use case for Block Storage. Create and mount a Block Storage Volume, install an application like OwnCloud, and point its data folder to a location on your Volume. If you ever run out of space on your Volume you can always increase its size.
Storage for Media Library Applications
There are a few media library applications, most notably Plex, that offer media streaming functionality to internet enabled devices. The media libraries these applications serve can quickly grow in size, depending on the number of movie and audio files they contain. Using a Block Storage Volume can provide you with storage capable of growing with the needs of your library.
Various stages of the software development lifecycle can create large amounts of temporary data, such as buffers, builds, and cache and session data. While this data might only exist for a short period of time, it requires and utilizes storage space. Creating a Block Storage Volume just for ephemeral data is a good use case for times when the storage supplied with your instance is not enough, or for when you need extra space for a short period of time.
Having backups of your data is always a good idea, and Block Storage Volumes make for scalable and quickly accessible backup mediums. Store anything that you might need to quickly transfer to another instance, or anything that you might need at a moment’s notice.
You can boot from disk images installed to a Block Storage Volume. This provides a cost effective means of maintaining an image that can be attached to a new Linode. For example, you could save money by creating and removing on-demand Linode instances that boot from a Volume. As well, you can boot from a Volume to access and recover an instance whose normal operating system may not be running as expected.
Linode provides a built-in Rescue Mode feature, but maintaining your own rescue Volume can allow you to include the recovery tools you prefer to use.
For more information on how to use Block Storage, consult our How to Use Block Storage with Your Linode guide.
Find answers, ask questions, and help others.
This guide is published under a CC BY-ND 4.0 license.