Linux
如何知道磁碟是 SSD 還是 HDD
我想知道磁碟是固態驅動器還是硬碟。
lshw
沒有安裝。我這樣做yum install lshw
了,它說沒有名為 lshw 的包。我不知道哪個版本的http://pkgs.repoforge.org/lshw/適合我的 CentOS。我在網上搜尋,沒有任何東西可以解釋如何知道驅動器是 SSD 還是 HDD。我應該先格式化它們嗎?
結果
fdisk -l
:Disk /dev/sda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00074f7d Device Boot Start End Blocks Id System /dev/sda1 * 1 14 103424 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 14 536 4194304 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 536 14594 112921600 83 Linux Disk /dev/sdc: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb: 128.0 GB, 128035676160 bytes 255 heads, 63 sectors/track, 15566 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdd: 480.1 GB, 480103981056 bytes 255 heads, 63 sectors/track, 58369 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
Linux 會自動檢測 SSD,從核心版本 2.6.29 開始,您可以通過以下方式
sda
進行驗證:cat /sys/block/sda/queue/rotational
您應該
1
購買硬碟和0
SSD。如果您的磁碟是由硬體模擬的邏輯設備(如 RAID 控制器),它可能無法工作。
有關 SSD 分區、文件系統的更多資訊,請參閱此答案…
使用
lsblk
(util-linux
包裝的一部分):lsblk -d -o 名字,輪值
NAME ROTA sda 0 sdb 0 sdc 1
where
ROTA
表示rotational device
(1
如果為真,0
如果為假)