In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to check how linux has several hard drives, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
In linux, you can use the lsblk command to view several hard drives, which are used to list information about all available block devices and show the dependencies between block devices. By default, all hard disk information and partitions are listed in a tree with the syntax "lsblk [options]".
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
The lsblk command is used to list information about all available block devices and also shows the dependencies between them, but it does not list information about RAM disks. Block devices include hard drives, flash drives, cd-ROM and so on. The lsblk command is included in the util-linux-ng package, which is now renamed util-linux.
This package comes with several other tools, such as dmesg. To install lsblk, download the util-linux package here. Fedora users can install the package by using the command sudo yum install util-linux-ng.
Option
-a,-- all displays all devices.
-b,-- bytes displays the device size in bytes mode.
-d,-- nodeps does not display slaves or holders.
-D,-- discard print discard capabilities.
-e,-- exclude exclusion device (default: RAM disks).
-f,-- fs displays file system information.
-h,-- help displays help information.
-I-- ascii use ascii characters only.
-m,-- perms displays permission information.
-l,-- list is displayed in list format.
-n,-- noheadings does not display the title.
-o,-- output output column.
-P,-- pairs is displayed in key= "value" format.
-r,-- raw is displayed in the original format.
-t,-- topology displays topology information.
Example
The lsblk command lists all block devices in a tree by default. Open the terminal and enter the following command:
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 seven columns are named as follows:
NAME: this is the name of the block device.
MAJ:MIN: this column shows the primary and secondary device numbers.
RM: this column shows whether the device is removable. Note that in this example, the RM values of devices sdb and sr0 are equal to 1, indicating that they are removable devices.
SIZE: this column lists the capacity size information of the device. For example, 298.1g indicates that the size of the device is 298.1GB, while 1K indicates that the size of the device is 1KB.
RO: this item indicates whether the device is read-only. In this case, all devices have a Ro value of 0, indicating that they are not read-only.
TYPE: this column shows whether the block device is a disk or a partition on the disk. In this example, sda and sdb are disks, while sr0 is read-only storage (rom).
MOUNTPOINT: this column indicates the mount point of the device.
The above is all the contents of the article "how to check how many hard drives in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.