Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to know whether a disk is a solid-state drive or hard disk.

lshw is not installed. I do yum install lshw and it says there is no package named lshw. I do not know which version of http://pkgs.repoforge.org/lshw/ is suitable for my CentOS.

I search the net and there is nothing that explain how to know whether a drive is SSD or HDD. Should I just format them first?

Result of 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
share|improve this question
1  
If this really is a SSD you might want to reformat it to align the erase blocks with the partitions. –  symcbean Feb 21 '13 at 13:58
    
SATA (Serial ATA) refers to the connection type of the drive, and does not imply that it is a Hard Disk Drive (HDD). SSDs can simultaneously be SATA, so I'm suggesting an edit to the title. –  SpellingD Feb 21 '13 at 17:10

3 Answers 3

up vote 44 down vote accepted

Linux automatically detects SSD, and since kernel version 2.6.29, you may verify sda with:

cat /sys/block/sda/queue/rotational

You should get 1 for hard disks and 0 for a SSD.

See this answer for more information...

share|improve this answer
1  
On Stackoverflow somebody found this sys-info didn't work. –  PythoNic Jul 23 at 10:55
    
@Totor I have got two disk, how can I find out which one is ssd? –  user11498 Aug 5 at 6:42
1  
@user11498 replace sda by sdb and see which one is SSD... –  Totor Aug 5 at 14:04
    
@PythoNic please file a kernel bug report about this. –  Totor Sep 4 at 12:58
    
@totor Better add this comment on the other post. I don't know his/her kernel version :) –  PythoNic Sep 4 at 13:21

Use smartctl to retrieve vendor information,

sudo smartctl -a /dev/sdb

If you see a line like this,

Rotation Rate: Solid State Device

That would be a SSD drive.

share|improve this answer

check cat /proc/scsi/scsi. there you should see the exact model of your disk. then you just google the model to find info about it.

share|improve this answer
1  
dmesg will contain the same info. dmesg | grep -i -e scsi -e ata –  mtm Feb 21 '13 at 9:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.