我sfdisk -s
可以看到磁盘容量如下:
$ sfdisk -s
/dev/cciss/c0d0: 143338560
total: 143338560 blocks
如何查看磁盘制造商等磁盘详细信息?我尝试过hdparm
,但出现错误:
$ hdparm -i /dev/cciss/c0d0
/dev/cciss/c0d0:
HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
答案1
尝试这些命令:
lshw -class disk
hwinfo --disk
您可能需要安装hwinfo
.
关于hdparm
:
hdparm(8) 说:
Although this utility is intended primarily for use with SATA/IDE hard disk
devices, several of the options are also valid (and permitted) for use with
SCSI hard disk devices and MFM/RLL hard disks with XT interfaces.
和:
Some options (eg. -r for SCSI) may not work with old kernels as necessary
ioctl()´s were not supported.
答案2
您可以直接通过sysfs读取磁盘属性,还可以检查其他文件/目录/系统/类/块/sda/设备/(代替sda与您需要的驱动器)。
cat /sys/class/block/sda/device/{model,vendor}
答案3
lsblk(列表块)
您可以使用lsblk
命令:
$ lsblk -o NAME,FSTYPE,LABEL,MOUNTPOINT,SIZE,MODEL
NAME FSTYPE LABEL MOUNTPOINT SIZE MODEL
...
nvme0n1 119.2G TS128GMTE110S
├─nvme0n1p1 vfat /boot/efi 512M
└─nvme0n1p2 ext4 / 118.8G
消息灵通,我的 NVMe SSD 是超越110S 128GB(TS128GMTE110S)
答案4
我知道这些答案已经有 3 年历史了,但是对于环顾四周的任何人来说......在旧版本中,您可以在(?
应该是数字)下找到:
/sys/class/scsi_device/?:?:?:?/device/model
通过做这个:
cat /sys/class/scsi_device/0\:0\:0\:0/device/{model,vendor}
(零旁边的反斜杠用于转义特殊 char :
。)