# How to perform basic administration tasks for Storage Devices in Linux?

{% embed url="<https://youtu.be/tdKUHqQJugc>" %}

### **Overview**

Linux offers a wide variety of tools for managing storage. However, only a small number are utilised for regular administration and upkeep. You will learn about some of the most popular tools for managing storage devices, mount points and file systems in this tutorial.

### **Prerequisites**

There are certain prerequisites that need to be met before you begin.&#x20;

* Ubuntu 20.04 or any other Linux OS.
* Non-root sudo user privilege.
* Knowledge of basic linux commands.

### **Using df to determine Storage Capacity and Usage**

The capacity and current utilization of the connected storage devices are frequently the most crucial details you need to know about your system's storage. Use the df utility to determine the overall amount of storage space that is available as well as the drives' current utilization. This normally outputs the data in 1K block format, which isn't always helpful. To print in readable human units, add the -h flag:

```
df -h
```

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1172_1.-System-admin.png" alt="" height="427" width="800">

The other listings/entries (tmpfs, devtmpfs) make use of the tmpfs or devtmpfs filesystems, which are temporary memory systems that are treated like permanent storage. Entering the following will remove these results:

```
df -h -x tmpfs -x devtmpfs
```

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1173_2.-System-Admin.png" alt="" height="429" width="800">

This output provides a more concentrated view of current disc utilization by removing some pseudo-devices and special devices.

### **Finding Information about Block Devices with lsblk**

**Block Device:** A storage device that receives or writes in blocks of a certain size is referred to as a "block device" in general. Almost all non-volatile storage devices, such as hard disc drives (HDDs), solid state drives (SSDs), and others, fall under this term. The filesystem is physically stored on a device called a block device. How data and files are kept is determined by the filesystem.

Information about block devices can be viewed using the lsblk tool. In general, the lsblk command can be used to show information about the drive itself, as well as the partitioning information and the filesystem that has been written to it. The exact capabilities of the utility rely on the version that is installed.

Without sudo, lsblk will show device names, major and minor device numbers (used by the Linux kernel to monitor drivers and devices).

```
sudo lsblk
```

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1174_3.-System-Admin.png" alt="" height="426" width="800">

The NAME, which corresponds to the name of the device under /dev, the SIZE, the TYPE, and the MOUNTPOINT are typically the most important elements of the output.

You can use the --fs flag on some versions to retrieve information more pertinent to managing discs and partitions:

```
sudo lsblk --fs
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1175_4.-System-Admin.png" alt=""><figcaption></figcaption></figure>

**Note:** If your system does not support the --fs flag, you can manually duplicate the output by specifying a specific output with the -o flag. To obtain the same information, use the command line option -o NAME, FSTYPE, LABEL, UUID, MOUNTPOINT.

To learn more about the disc topology, type:

```
sudo lsblk --t
```

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1176_5.-System-Admin.png" alt="" height="427" width="800">

### **Working with Filesystem Mounts**

You might engage in mounting more regularly. The filesystem is made accessible to the server at the chosen mount point by mounting it. A directory under which the new filesystem can be accessed is referred to as a mount point.

Mount and Umount are the two complementing commands that are typically used to control mounting.

* **Mount:** The mount command is used to include a filesystem in the currently selected file tree. No matter how many physical devices make up a Linux system, the system as a whole uses a single uniform file structure.&#x20;
* **Umount:** A filesystem can be unmounted with the umount command (note: this is umount, not unmount). The findmnt command can also be used to learn more about the state of mounted filesystems at the moment.

**1. Using the mount Command:**

The easiest way to use mount is to supply a formatted disc or partition together with the mount point to which it should be attached:

```
sudo mount /dev/sda1 /mnt
```

<img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1177_6.-System-Admin.png" alt="" height="29" width="800">

The last parameter, known as the mount point, should almost always be an empty directory because it determines where in the file hierarchy the new filesystem should be connected.

You can use the -a option to mount every filesystem listed in the /etc/fstab file:

```
sudo mount -a
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1178_7.-System-Admin.png" alt=""><figcaption></figcaption></figure>

**2. Listing Filesystem Mount Options**

Use the findmnt command to view the options used for a particular mount. For instance, if you used findmnt to inspect the read-only mount from the previous example, it would appear something like this:

```
findmnt /mnt
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1179_8.-System-Admin.png" alt=""><figcaption></figcaption></figure>

**3. Unmounting a Filesystem**

You can unmount a specific filesystem with the umount command. The command's default form is to name the mount point or device of a presently mounted filesystem.

**Note:** Ensure that no files on the mount point are used and that no programs, including your active shell, are running inside the mount point:

```
cd ~
sudo umount /mnt
```

<figure><img src="http://customer.acecloudhosting.com/index.php?rp=/images/kb/1180_9.-System-Admin.png" alt=""><figcaption></figcaption></figure>

### **Conclusion**

The majority of the tools you require for routine system administration duties should be covered by this list. You can manage the storage devices on your server by becoming familiar with a few basic linux tools.

&#x20;


---

# 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-perform-basic-administration-tasks-for-storage-devices-in-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.
