In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the sblk command under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The English name of the sblk command is "list block", which lists information about all available block devices and also shows the dependencies between them, but it does not list information about RAM disks.
Lsblk installation
If you don't have the lsblk command on your Linux system, it doesn't matter, it's easy to install.
Yum install util-linux login replication login replication lsblk common parameters detailed explanation [root@mysql ~] # lsblk-- help option:-a,-- all prints all devices-b,-- bytes prints SIZE-d in bytes rather than readable format,-- nodeps does not print slave devices (slave) or placeholder devices (holder)-D. -- discard discarding ability when printing-- e,-- exclude excludes devices based on the primary device number (default: memory disk)-I,-- include only displays devices with the specified primary device spare number-f,-- fs outputs file system information-h,-- help usage information (this information)-- I,-- ascii uses only the ascii character-m -- perms output permission information-- l,-- list uses output in list format-n,-- noheadings does not print header-o,-- output output column-p,-- paths prints full device path-P,-- pairs uses key= "value" output format-r,-- raw uses native output format-s -- inverse reverse dependency-- topology output topology information-- S,-- scsi output information about SCSI devices-h,-- help display this help and exit-V,-- version output version information and log in to copy lsblk usage examples
Get the block device, displayed in a tree
Log in and copy [mysql@mysql ~] $lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 100G 0 disk |-sda1 8:1 0 1G 0 part boot`-sda2 8:2 0 99G 0 part |-centos-root 253 disk 0 087G 0 lvm |-centos-swap 253 lvm 1 0 2G 0 lvm [SWAP] `- centos-home 253 disk 2 0 10G 0 Lvm homesr0 11:0 1 4.3G 0 rom login replication
The important column names are explained here. For more information, you can use lsblk-help to view the 1.MAJ:MIN: this column shows the primary and secondary device numbers 2.RM: displays the removable device. 0 indicates non-mobile device, 1 indicates removable device 3.RO: read-only, 0 indicates not read-only, 1 indicates read-only
Get full path and permissions of block device
[mysql@mysql ~] $lsblk-mpNAME SIZE OWNER GROUP MODE/dev/sda 100G root disk brw-rw---- |-/ dev/sda1 1G root disk brw-rw---- `- / dev/sda2 99g root disk brw-rw---- |-/ dev/mapper/centos-root 87g root disk brw-rw -|-/ dev/mapper/centos-swap 2G root disk brw-rw---- `- / dev/mapper/centos-home 10G root disk brw-rw----/dev/sr0 4.3G root cdrom brw-rw---- log in and copy
From the above results, you can clearly see the users and groups to which each block device belongs, as well as permissions.
IO scheduling algorithm for getting block devices
After logging in, copy [mysql@mysql ~] $lsblk-tNAME ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE RA WSAMEsda 051205125121deadline 128 4096 32m |-sda1 051205125121deadline 128 4096 32M`-sda2 05120 0 512512 1 deadline 128 4096 32m |-centos-root 051205125121128 4096 32m |-centos-swap 051205125121128 4096 32m `- centos-home 051205125125121128 4096 32Msr0 0 2048 0 2048 2048 1 deadline 128 128 0B login replication
Thank you for reading! This is the end of the article on "how to use sblk commands under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.