![Linux List Partitions Ubuntu Techhyme](https://techhyme.com/wp-content/uploads/2022/11/Linux-List-Partitions-Ubuntu-Techhyme-1024x671.jpg)
The purpose of this guide is to list all disk partitions, and their sizes on a Linux operating system. This will help you identify what hardware storage you have available, how the disks are partitioned or sliced, and what sizes each of them are.
1. The lsblk Command
The lsblk command will show all storage devices connected to your system, their configured partitions, and the sizes.
Command: lsblk
The screenshot below shows us that we have one hard drive identified as sda, with a size of 150 GB. You can see its partitions and their sizes listed under the disk (sda1, sda2 and sda3).
2. The fdisk Command
The fdisk command is another way to retrieve the same information.
Command: fdisk -l
Below that, you can see the partitions, their sizes, and what the partitions are used for (Logical/Physical, BIOS, Linux filesystem, etc).
3. The df Command
The df is a good way to see all the partitions on the system in a clean way, but it does not list unpartitioned block devices. It will also show the partition size, percentage currently in use, and where the partition has been mounted.
Command: df -h
We recommend using the -h attribute to put the output in human readable format.
E.g.
- Filesystem – /dev/sda3
- Total Size – 147G
- Used – 12G
- Available – 127G
- % in use – 9%
- Mounted on – /
4. With GUI Method
All Linux distros and desktop environments should also include a GUI application that can also be used to view disk and partition information.
In Ubuntu, this utility is simply called “Disks.” This could vary on other distros, but should not be hard to find in the menus. In windows 10/11, You can find the same feature under Settings -> System -> Storage.
In this article, we saw how to list all disks, partitions, and sizes on a Linux system using both command line and GUI method.
You may also like:- How To Install Python 2.7.18 From The Source
- How To Parse SSH Authentication Logs with Logstash
- A Comprehensive Guide to File System Commands in Linux
- Essential File Compression Commands in Linux
- Secure Shell (SSH) Protocol – A Comprehensive Guide
- Monitoring Active Connections in Kali Linux Using Netstat
- How To Easily Crack Wi-Fi Password
- 6 Most Useful Windows Command Prompt Commands
- Ripgrep – Searching for Specific File Types and Beyond
- Insert and Create Data in Elasticsearch