Block Storage File System Recommendations


SpinUp recommends specific file systems for those new to the cloud.

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

Understanding file systems on Block Storage

At a high level, the file system on a computer relates to how the data is stored and accessed on the hard-drive disk.

There are advantages and disadvantages to each, and this article only scratches the surface on some of these to get you started with Block Storage. One of the big items that will determine the best file system for you is the type of data being stored. Will you be storing a lot of small files or only a few files but large in size.

File system choices per operating system

There are a lot of choices out there for file system types. Following is a breakdown of our recommendations on file system for both Linux® and Microsoft® Windows® systems.

Linux file systems

In general, if you are unsure about what file system to use, go with EXT4.

EXT4 is the general Linux file system and is highly durable and suitable for most needs. However, if you are feeling a little more adventurous, we do have some recommendations depending on the data being stored. In general, the rules of thumb for file systems are this:

  • Not sure? - If you are not sure, go with EXT4. This is a solid file system that has been proven time and time again.

  • Lots of small files - Are you creating a ton of little files? If so, ReiserFS might be best for you.

  • A few large files - Are you creating a small amount of files that contain a large amount of data? If so, choose XFS.

Apply the file system to Block Storage

Now that we have chosen a file system, we can apply it to the Block Storage volume. At this point, you need to have the Block Storage device attached to a Cloud Server.

  • Identify the Block Storage device:
CLI: Find Block Storage block ID

In the following command, /dev/xvda is the root disk and /dev/xvdb is the Block Storage disk. This should be the case for you, depending on how many Block Storage devices are attached to the Cloud Server.

  
      

fdisk -l
(out)
(out)Disk /dev/xvda: 21.5 GB, 21474836480 bytes, 41943040 sectors
(out)Units = sectors of 1 * 512 = 512 bytes
(out)Sector size (logical/physical): 512 bytes / 512 bytes
(out)I/O size (minimum/optimal): 512 bytes / 512 bytes
(out)Disk label type: dos
(out)Disk identifier: 0x000c413f
(out)
(out)    Device Boot      Start         End      Blocks   Id  System
(out)/dev/xvda1   *        2048    41943039    20970496   83  Linux
(out)
(out)Disk /dev/xvdb: 80.5 GB, 80530636800 bytes, 157286400 sectors
(out)Units = sectors of 1 * 512 = 512 bytes
(out)Sector size (logical/physical): 512 bytes / 512 bytes
(out)I/O size (minimum/optimal): 512 bytes / 512 bytes


  
Control Panel: Find the Block Storage block ID

In the Control Panel, you can identify the mount point under the Server or Block Storage information tab. The following image shows the Server Details page for Block Storage:

Apply the file system

  • Apply the file system to the Block Storage device.

This example applies EXT4 to the block device identified in the previous step. Depending on the Block Storage volume size, the apply process might take some time to apply the file system.

Destructive Operation Warning

This is a DESTRUCTIVE command, so verify that you are running this against the proper location of the Block Storage volume. Any data on the block device will be deleted permanently as part of the format operation.

  
      

mkfs.ext4 /dev/xvdb
(out)
(out)mke2fs 1.42.9 (28-Dec-2013)
(out)Filesystem label=
(out)OS type: Linux
(out)Block size=4096 (log=2)
(out)Fragment size=4096 (log=2)
(out)Stride=0 blocks, Stripe width=0 blocks
(out)4915200 inodes, 19660800 blocks
(out)983040 blocks (5.00%) reserved for the super user
(out)First data block=0
(out)Maximum filesystem blocks=2168455168
(out)600 block groups
(out)32768 blocks per group, 32768 fragments per group
(out)8192 inodes per group
(out)Superblock backups stored on blocks:
(out)        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
(out)        4096000, 7962624, 11239424
(out)
(out)Allocating group tables: done
(out)Writing inode tables: done
(out)Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done


  

Mounting the Block Storage volume

Before we mount the filesystem, we need to create the mount point.

This can technically be anywhere, but there are a few recommended places for external mounts. In this example, we created a folder in /opt/. You may also want to use /srv/ depending on your needs.

  
      

mkdir /opt/block-storage-mount


  

Now, we can attach the Block Storage volume to the mount point we just created.

  
      

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


  

Verify the 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


  

Windows file systems

In general, if you are unsure about what file system to use, go with NTFS.

NTFS is the default file system type for Windows and has proven itself as highly durable to suit most, if not all, needs.

Apply the file system to Block Storage

Now that we have chosen a file system, we can apply it to the Block Storage volume. At this point, you need to have the Block Storage device attached to a Cloud Server.

Find mount point via Disk Management
  • Identify the Block Storage device

Launch Disk Management by pressing windows_key + r to open the run box and then entering diskmgmt.msc. Press Enter. You should now have a screen that looks like the following image.

You should see two disks in the listing. Disk 0 is the primary boot disk, and Disk 1 is your Block Storage volume, if only one volume is attached.

  • Bring the drive online

The new Block Storage volume shows as offline (Disk 1) because it’s a a fresh hard drive. You need to bring it online by right clicking Disk 1 on the left and clicking online in the menu:

  • Initialize the drive

Destructive Operation Warning

This is a DESTRUCTIVE command, so verify that you are running this against the proper location of the Block Storage volume. Any data on the block device will be deleted permanently as part of the initialize operation.

Now that the drive is online, initialize the disk in the same way we brought it online. Right click Disk 1 on the left and click Initialize Disk in the menu:

A menu pops up with some options, with the main one being what type of partition style to choose. In most cases, the Master Boot Record (MBR) is fine:

  • Create a simple volume Right click Disk 1 in the Unallocated section of the disk. In the pop-up menu, click New Simple Volume.

Next, a pop up with a few different windows guides you through creating a simple volume. For the most part, you can leave all these values the same, but feel free to tweak any you want to modify.

First simple volume screen
Partition size
Assigning a drive letter

This is the second to last screen and has a few good options you might want to tweak.

  • File System - NTFS should work for 99% of applications, but feel free to change this.

  • Allocation Unit Size - the block size of data that the system stores on the disk. Do not change this unless you know exactly what you are doing.

  • Volume Label - Name that displays on File Explorer.

  • Quick Format - Generally, you want to do this unless you have some type of data deletion policy.

  • File & Folder Compression - Turned off by default, but you can turn it on to reduce storage space. This might cause some delay in accessing data, while Windows extracts the data seamlessly in the background as you access it.

Formatting Volume, File System Section, Partition Name
Summary screen
  • Accessing and viewing Block Storage volume

At this point, the volume should be online, be ready to take data, and be used.

Next steps

At this point, the Block Storage device should be formatted and mounted to your Cloud Server ready to take data.

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


Related Content