Linux handy block device viewing tool lsblk

Source: Internet
Author: User

Before looking at Linux under what pieces of equipment, usually with Fdisk or the direct ls/dev/to see very inconvenient. This tool belongs to Util-linux-ng package, it is installed on Rhel 6.1, it is good to use directly. Ubuntu is also available under the high version.

This tool, in particular, lists all the block devices, and also shows the dependencies between them.

"lsblk" is the list of block devices. In addition to RAM, the block device is displayed neatly in a standard tree-like output format.

[Email protected]:~# lsblkname   maj:min RM   SIZE RO TYPE mountpointsda      8:0    0 232.9G  0 disk├─sda1   8:1    0  46.6G  0 part/├─sda2   8:2    0     1K  0 part├─sda5   8:5    0   190M  0 Part/boot├─sda6   8:6    0   3.7G  0 Part [swap]├─sda7   8:7    0  93.1G  0 part/ Data└─sda8   8:8    0  89.2G  0 part/personalsr0     11:0    1  1024M  0 rom

The "lsblk-l" command displays block devices in list format (not tree format).

[Email protected]:~# lsblk-lname maj:min RM   SIZE RO TYPE mountpointsda    8:0    0 232.9G  0 disk sda1
   
    8:1    0  46.6G  0 part/sda2   8:2    0     1K  0 part sda5   8:5    0   190M  0 Part/bootsda6   8:6    0   3.7G  0 Part [swap]sda7   8:7    0  93.1G  0 part/datasda8   8:8    0  89.2G  0 part/personalsr0   11:0    1  1024M  0 rom
    

Note: LSBLK is the most useful and easiest way to learn the name of a newly inserted USB device, especially when you are working on a disk/block device on a terminal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.