There are a few different ways to find out the specifications of a hard disk (also known as a hard drive) on a Linux system. Here are a few options:
lsblk
command: This command will show you a list of all the block devices (including hard drives) on your system, along with their size and other basic information. You can use the -o
flag to specify which fields you want to see, and the -b
flag to show the sizes in bytes. For example:$ lsblk -o NAME,SIZE,TYPE -b NAME SIZE sda 500107862016 ├─sda1 2048 ├─sda2 8384512 ├─sda3 8384512 ├─sda4 8384512 ├─sda5 8384512 └─sda6 49089613824
fdisk
command: This command allows you to view and modify the partition table of a hard drive. You can use the -l
flag to list the partitions on a particular hard drive, along with their sizes and other details. For example:$ sudo fdisk -l /dev/sda Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0x0009e354 Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 499711 497664 243M 83 Linux /dev/sda2 501758 19660543 19158786 9.2G 5 Extended /dev/sda3 19660544 29497344 9836800 4.7G 83 Linux /dev/sda4 29497472 976773119 947275640 453G 5 Extended /dev/sda5 29497536 39063551 9566016 4.6G 83 Linux /dev/sda6 39063552 976773119 937739568 448G 83 Linux
hdparm
command: This command can be used to view and modify various settings of a hard drive, such as its transfer mode, power management, and cache settings. You can use the -I
flag to show detailed information about a hard drive, including its model number, serial number, and other hardware details. For example:$ sudo hdparm -I /dev/sda /dev/sda: ATA device, with non-removable media Model Number: ST500DM002-1BD142 Serial Number: S3Y1J9AG301205 Firmware Revision: KC45 Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
smartctl
command: This command allows you to view and monitor the SMART information.$ sudo smartctl