Knowledge Base
Tutorials
Tutorials
  • How to install Joomla 4.2.2 on Ubuntu 20.04?
  • How to set and execute environment and shell variables in Linux?
  • How to employ Docker containers?
  • How to access PostgreSQL Image?
  • How to add and delete users on Ubuntu 20.04?
  • How to add swap space on Ubuntu 20.04?
  • How to back up, restore, and migrate a MongoDB database on Ubuntu 20.04?
  • How to configure additional SSH keys to your public cloud instance?
  • How to configure static IP on Ubuntu?
  • How to create a CLI with Python Fire on Ubuntu 22.04?
  • How to create a new user and manage permissions in MySQL?
  • How to create an instance with Terraform?
  • How to import and export a MongoDB database on Ubuntu 20.04?
  • How to install 7zip on Ubuntu 20.04?
  • How to install AIDE on Ubuntu 22.04?
  • How to install Anaconda on Ubuntu 20.04?
  • How to install and use Docker on Ubuntu 20.04?
  • How to install and use Elinks on Ubuntu 20.04?
  • How to install and use PostgreSQL on Ubuntu 20.04?
  • How to install Android Studio on Ubuntu 22.04?
  • How to install Angular on Ubuntu 20.04?
  • How to install Ansible on Ubuntu 20.04?
  • How to install Apache Kafka on Ubuntu 20.04?
  • How to install Apache Maven on Ubuntu 20.04?
  • How to install Asterisk on Ubuntu 20.04?
  • How to install Atom Text Editor on Ubuntu 20.04?
  • How to install Blender on Ubuntu?
  • How to install CFEngine3 on Ubuntu 20.04?
  • How to install Code::Blocks on Ubuntu 20.04?
  • How to install Composer on Ubuntu 22.04?
  • How to install Curl on Ubuntu 20.04?
  • How to install Desktop GUI on Ubuntu 20.04?
  • How to install Discord on Ubuntu 22.04?
  • How to install Django on Ubuntu 20.04?
  • How to install Docker Compose on Ubuntu 20.04?
  • How to install ELK on Debian 10 or Debian 11?
  • How to install Fail2ban on Debian 10?
  • How to install FFmpeg on Ubuntu 20.04?
  • How to install Flask on Ubuntu 20.04?
  • How to install Fish Shell in Ubuntu 20.04?
  • How to install Gedit on Ubuntu 20.04?
  • How to install Git on Ubuntu 20.04?
  • How to install Gitea on Ubuntu 20.04?
  • How to install Gitlab on Ubuntu 20.04?
  • How to install Go on Ubuntu 20.04?
  • How to install Google Chrome on Ubuntu 20.04?
  • How to install Gradle on Debian 10?
  • How to install Gradle on Ubuntu 20.04?
  • How to install Grafana on Ubuntu 20.04?
  • How to install Hadoop on Ubuntu 20.04?
  • How to install Homebrew on Linux?
  • How to install JAVA with APT on Ubuntu 20.04?
  • How to install Julia on Ubuntu 20.04?
  • How to install Jupyter on an Ubuntu Linux VM?
  • How to install Kdenlive on Ubuntu 20.04?
  • How to install Logwatch on Ubuntu 20.04?
  • How to install MariaDB on Ubuntu 22.04?
  • How to install Memcached on Debian 10?
  • How to install Microsoft Edge Browser on Ubuntu 22.04?
  • How to install MongoDB on CentOS 7?
  • How to install MongoDB on Linux?
  • How to install Mono on Debian 10?
  • How to Install Mono on Ubuntu 20.04?
  • How to install Mozilla Firefox on Ubuntu 20.04?
  • How to install MySQL on Ubuntu 22.04?
  • How to install Nagios on Ubuntu 20.04?
  • How to install Nginx on CentOS 8?
  • How to install Nginx on Ubuntu 22.04?
  • How to install Node.js on Ubuntu 22.04?
  • How to install NVIDIA CUDA on Ubuntu 20.04?
  • How to install Nvidia Optimus Driver on Ubuntu 22.04?
  • How to install OpenCV on Ubuntu 20.04?
  • How to install Perl on Ubuntu on 22.04?
  • How to install Pacman on Ubuntu 20.04?
  • How to install phpMyAdmin on Ubuntu 20.04?
  • How to install PIP on CentOS 8?
  • How to install Plex media server on Ubuntu 20.04?
  • How to install Podman on Ubuntu 20.04?
  • How to install Poetry on Ubuntu 22.04?
  • How to install Postman on Ubuntu 20.04?
  • How to install ProcessWire on Ubuntu 20.04?
  • How to install PyQuery package on Ubuntu 20.04?
  • How to install Python 3 on Ubuntu 22.04 and set up a programming environment?
  • How to install Python on Windows 10 using UI and Windows command prompt?
  • How to install R on Ubuntu 20.04?
  • How to install Ruby on Rails on Ubuntu 20.04?
  • How to install Ruby on Ubuntu 20.04 and setup programming environment?
  • How to install Rust on Ubuntu 22.04?
  • How to install Samba on Ubuntu 20.04?
  • How to install Skype on Ubuntu 20.04?
  • How to install Rancher on Ubuntu 20.04?
  • How to install Slack on Ubuntu 20.04?
  • How to install Springboot on Ubuntu 20.04?
  • How to install Spyder IDE in Ubuntu?
  • How to install Steam on Ubuntu 20.04?
  • How to install Strapi for Production on Ubuntu 20.04?
  • How to install TeamViewer on Ubuntu 20.04?
  • How to install TensorFlow on Ubuntu 20.04?
  • How to install Apache Web Server on Ubuntu 20.04?
  • How to install the Deno JavaScript Runtime on Ubuntu 20.04?
  • How to install Open LiteSpeed Web Server on Ubuntu 22.04?
  • How to install Sublime Text Editor on Ubuntu 20.04?
  • How to install tix package on Ubuntu 20.04?
  • How to install Vagrant on Ubuntu 20.04?
  • How to install Vim on Ubuntu 20.04?
  • How to install VirtualBox on Ubuntu 20.04?
  • How to install VLC Media Player on Ubuntu 20.04?
  • How to install VMware Workstation Player on Ubuntu 20.04?
  • How to install vscode on Ubuntu 20.04?
  • How to install Webmin on Ubuntu 20.04?
  • How to install Wine on Ubuntu 20.04?
  • How to install WordPress on Ubuntu 20.04?
  • How to install Xibo on Ubuntu 20.04?
  • How to install Zoom on Ubuntu 20.04?
  • How to install Yarn on Ubuntu 20.04?
  • How to keep Ubuntu 22.04 servers updated?
  • How to monitor system authentication logs on Ubuntu 20.04?
  • How to perform basic administration tasks for Storage Devices in Linux?
  • How to set up Jenkins on Ubuntu 20.04?
  • How to setup OpenVPN on Ubuntu 20.04?
  • How to setup time synchronization on Ubuntu 20.04?
  • How to setup a UFW on an Ubuntu or Debian Cloud Server?
  • How to setup SSH keys in Ubuntu 20.04?
  • How to SSH terminal through MobaXterm and PuTTY in Windows?
  • How to Use Ansible to Install and Set Up Docker on Ubuntu 20.04?
  • How to view system users on Ubuntu 20.04?
  • How to make OpenStack accessible through CLI?
  • How to make Block Storage available for Linux?
  • Script for automated incremental backups
  • How to configure a Git repository using Linux CLI?
  • How to enable remote access on MySQL?
  • How to Mount a S3 Bucket on Linux Instance?
  • How to access MySQL database credentials?
  • How to create an incremental backup using CLI?
  • How to set up web-based SQL server on OpenStack instance using SQL image?
Powered by GitBook
On this page
  • Overview
  • Prerequisites
  • Using df to determine Storage Capacity and Usage
  • Finding Information about Block Devices with lsblk
  • Working with Filesystem Mounts
  • Conclusion

Was this helpful?

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

PreviousHow to monitor system authentication logs on Ubuntu 20.04?NextHow to set up Jenkins on Ubuntu 20.04?

Last updated 1 year ago

Was this helpful?

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.

  • 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

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

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

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

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

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.

  • 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

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

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

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

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.