The lsblk command on Linux shows information from all connected block devices in the system. It is useful to view all connected disks whether they are mounted or not.
The most common options are:
partitions;
Example of use:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
Sda 8:0 0 64G
0 disk ? ?sda1 8:1 0 1G 0 part
/mnt sda2 8:2 0 63G 0 part 496
- cl-root 253:0 0 41 G
0 lvm/
#cl-swap 253:1 0 2G 0 lvm [SWAP] Home
sr0 11:0 1 1024M 0 rom
The -d option shows the information, without the partitions:
$ lsblk -d NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT da 8:0 0 64G 0 disk sr0 11:0 1 1024M 0 rom
The -f option may be useful to view the UUID of the devices:
$ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
da
? ?sda1 xfs 1c3b15b1-cd13 (...) /mnt
??sda2 LVM2_member gzxwoc-7ziass (...)
? ?cl-root xfs 602fcf7d-d716 (...) /
496 - cl-swap swap a873901e-5b33 (...) [
SWAP] ??cl-home xfs fcbdceb1-9053 (...) /home
sr0
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Share
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.