![]() ![]() ![]() You can also list all partitions in a table, including current mountpoints: $ sudo blkid -o list dev/sda2 4096 41940991 41936896 20G Linux filesystemįind disk partitions in Linux using blkid Sector size (logical/physical): 512 bytes / 512 bytes To display disk partitions in Linux, run fdisk command with -l option as root or sudo user: $ sudo fdisk -lĭisk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors Display disk partitions using fdisk command in Linuxįdisk is a command line, dialog-driven program for managing partition tables and partitions on a hard disk in Linux. You can even display more details including filesystem type, UUID, Mountpoint etc., like below: $ lsblk -io KNAME,TYPE,SIZE,MODEL,FSTYPE,UUID,MOUNTPOINTĪlternatively, you could use -fm option to display mountpoint, size, owner, mode: $ lsblk -fm 2. The above command will show the partition details in the first disk drive. In that case, just specify the disk device name like below: $ lsblk /dev/sda You may have more than one devices in your system. partition).ĭid you notice there is one more partition name sr0? It represents the ISO image mounted as an optical medium. If you look under the Type column in the above output, it shows the type of the device i.e. List disk partitions in Linux using lsblk commandĪs you see in the above output, lsblk command lists one 20GB disk named sda, with two partitions namely sda1 and sda2. Sample output: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT To list disk and partition information with lsblk command, simply run it without any options: $ lsblk It reads the sysfs filesystem and udev db to collect information of disks and partitions and displays the output in tree-like format. The lsblk utility is used to display information about a specified block device as well as all available block devices, along with their partitioning schemes in Linux. List disk partitions in Linux using lsblk command First, we will start with lsblk command line utlity. There are many ways to view disk partitions in Linux. If you want to know more details, a quick web search may yield many relevant results. Knowing Linux disks and partitions name is just enough for the purpose of this guide. The same applies to the subsequent disks added to the system. In layman terms, s refers to the interface (SATA, SAS, or SCSI), d is for disk, a is for the device id, and the number is for partition id. For example, sda1 is the first partition in the first SCSI hard drive, sda2 represents the second partition of the first disk drive, sdb1 is the first partition in the second hard drive and so on. The partitions on each disk are represented by appending a decimal number to the disk name. sd is originally for referring scsi disk devices, however it is now used to refer SATA devices and any removable devices in general. You might be wondering what sda does stands for.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |