# How to make Block Storage available for Linux?

### Overview

In a computer's file-sharing system, **mounting** typically refers to making the file system accessible to a number of users. MS Windows has the option to automatically mount discs. However, Linux does not and hence require a storage device to be mounted (attached) to the operating system manually before it can be used. This mounted storage is subsequently used to build a filesystem and store data.&#x20;

In this tutorial, we'll help you know how to mount the attached volume on an Ubuntu instance. &#x20;

### **Prerequisites**&#x20;

* An Ubuntu instance&#x20;
* Attached volume&#x20;
* Code editor&#x20;
* Good internet connectivity&#x20;

### **Get Started**

**Step 1**: Login as: **ubuntu**&#x20;

**Step 2: Listing Disk Partition Table**&#x20;

i. Execute the below command to see the list of mounted file systems as well as file systems in RAM, usage percentage, availability, and the path it's mounted on. This command displays the details in 'human-readable' size format, i.e., gigabytes, megabytes, and kilobytes. Moreover, it will help us draw the difference in the partition table in the last (step 10).&#x20;

```
df –h
```

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/679_888.png" alt="" height="400" width="1520">

ii. Run the following command to get the report of the device's major and minor numbers, block size, amount of free and total space on the device, as well as information on all available or specified block devices.

```
lsblk
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/497_1.jpg" alt=""><figcaption></figcaption></figure>

**Step3:** **Create Disk partition**&#x20;

The Linux command **fdisk**, commonly referred to as format disc, is used to create and modify the disc partition table. It is used to examine, create, delete, modify, resize, copy, and transfer partitions on a hard drive. &#x20;

Use the following commands to create a disk partition for your volume.&#x20;

i. **Sudo -i**&#x20;

ii. **fdisk /path** \<give the path of your attached volume>&#x20;

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/498_2.jpg" alt=""><figcaption></figcaption></figure>

**Step 4:** Type **m** for help, and you'll be prompted to a list of commands.&#x20;

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/499_3.jpg" alt=""><figcaption></figcaption></figure>

**Step 5: Building Partition Tables:**&#x20;

i. Enter **n** for adding a new partition. &#x20;

&#x20;  Linux has two partition styles, namely:&#x20;

* **Primary partition:** The computer's operating system(s) are located on the primary disc, which is a bootable partition. &#x20;
* **Extended partition:** The extended partition is non-bootable; these are used to store data and often have numerous logical partitions.&#x20;

ii. Enter **p** for selecting the number of primary partitions, which range from 1 to 4, and default value of 1. Then, you may choose the sectors of your choice; else, it'll pick the default values. Here, we have taken the default values.&#x20;

iii. Enter **w** to write table to disk and exit.&#x20;

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/500_4.jpg" alt=""><figcaption></figcaption></figure>

**Step 6:** **Creating a File System**&#x20;

Use the following command to create an ext4 file system from disc partitions, which is used to build a Linux file system on a device.

```
mkfs.ext4 /path  
```

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/501_5.jpg" alt=""><figcaption></figcaption></figure>

**Step 7: Creating a drive for mounting volume**&#x20;

Volume is always mounted on a drive. For that, we'll create a drive with the following command.

```
1. mkdir  /new_mount   

2. lsblk –fs 

3. Copy the UUID (Universally Unique Identifier) for your just-created partition (here it is vdc1). 
```

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/502_6.jpg" alt=""><figcaption></figcaption></figure>

**Step 8:** **Creating a configuration file**&#x20;

Use the following command to edit the configuration file. Here, we are using nano code editor.&#x20;

```
nano /etc/fstab 
```

This file has some default settings, which need to remain untouched. You need to fill the following details into the file:&#x20;

* **UUID** (already copied from the partition table in Step.7)&#x20;
* **Path** of drive (refer to step.7)&#x20;
* File system type, i.e., **ext4**&#x20;
* Settings- **default**&#x20;
* **0**- If you want the volume backup&#x20;
* **1**- If you want the volume bootup at the startup&#x20;

&#x20;![](http://customer.acecloudhosting.com/index.php?rp=/images/kb/645_index-1.jpg)

**Step 9: Mounting the volume**&#x20;

i. Reload the daemon using the command:&#x20;

```
systemctl daemon-reload 
```

ii. Mount the volume&#x20;

```
mount –a 
```

**If the below error appears**

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/511_8.jpg" alt="" height="38" width="800">

**Use the following command for mounting:**&#x20;

```
sudo mount /path /drive 
```

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/506_9.jpg" alt=""><figcaption></figcaption></figure>

**Step 10:** **Verifying the volume mount**&#x20;

The following commands will show our drive in the Disk partition table, which was missing earlier in step 2:&#x20;

```
df -h 
```

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/510_10.jpg" alt=""><figcaption></figcaption></figure>

```
lsblk --fs 
```

&#x20;

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/509_11.jpg" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.acecloud.ai/knowledge-base/tutorials/how-to-make-block-storage-available-for-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
