Linux,  Ubuntu

How to check if my Ubuntu is placed on SSD?

A simple way to tell if your OS is installed on SSD or not is to run a command from a terminal window called lsblk -o name,rota. Look at the ROTA column of the output and there you will see numbers. A 0 means no rotation speed or SSD drive. A 1 would indicate a drive with platters that rotate. My Ubuntu is installed on my /dev/sdb drive, so we can see that one indicates a 0 which means it is installed on a SSD drive. I put after this example of how to tell where your OS is installed using df.

NOTE: Ubuntu that is installed as a client in either loop or VMs will show ROTA 1 regardless of host OS installation. Also, “solid-state hybrid drives” and USB flash drives will also show ROTA 1.

Example:

terrance@terrance-ubuntu:~$ lsblk -o name,rota
NAME   ROTA
sda       1
└─sda1    1
sdb       0
├─sdb1    0
├─sdb2    0
└─sdb5    0
sdc       1
└─sdc1    1
sdd       1
└─sdd1    1
sde       0
├─sde1    0
└─sde2    0
sdf       1
└─sdf1    1
sdg       1
└─sdg1    1
sdh       1
└─sdh1    1
sr0       1
sr1       1

Or you can do the check as a one liner script using -d to not show partitions:

lsblk -d -o name,rota | awk 'NR>1' | while read CC; do dd=$(echo $CC | awk '{print $2}'); if [ ${dd} -eq 0 ]; then echo $(echo $CC | awk '{print $1}') is a SSD drive; fi; done

Example:

terrance@terrance-ubuntu:~$ lsblk -d -o name,rota | awk 'NR>1' | while read CC; do dd=$(echo $CC | awk '{print $2}'); if [ ${dd} -eq 0 ]; then echo $(echo $CC | awk '{print $1}') is a SSD drive; fi; done
sdb is a SSD drive
sde is a SSD drive

To determine what drive your installation is on, run the command df / from a terminal window.

NOTE: Drives configured with LVM (Logical Volume Management) actually show the drive as /boot instead of /.

Examples:

LVM Drive:

df /
Filesystem                   1K-blocks      Used Available Use% Mounted on
/dev/mapper/xubuntu--vg-root 243352964 106945028 123976576  47% /

df /boot
Filesystem     1K-blocks   Used Available Use% Mounted on
/dev/sda1         720368 237220    430756  36% /boot

Non-LVM Drive:

df /
/dev/sdb1       222309012   38264268  172728984  19% /

UPDATE: lsblk can also be used to show where the OS is installed and if the drive is SSD all in one command:

lsblk -o NAME,MOUNTPOINT,MODEL,ROTA

Example:

terrance@terrance-ubuntu:~$ lsblk -o NAME,MOUNTPOINT,MODEL,ROTA
NAME   MOUNTPOINT         MODEL            ROTA
sda                       Backup+ Desk        1
└─sda1 /media/Seagate                         1
sdb                       WDC WD2500JD-00K    1
└─sdb1 /media/250GB_SHARE                     1
sdc                       WDC WD5000AAKS-4    1
└─sdc1 /media/500GB                           1
sdd                       ST500DM002-1BC14    1
└─sdd1 /media/320GB                           1
sde                       SanDisk SDSSDA24    0
├─sde1 /                                      0
├─sde2                                        0
└─sde5 [SWAP]                                 0
sdf                       WDC WD5000AAKX-2    1
└─sdf1 /media/WD500GB                         1
sdg                       WDC WD10EZEX-00W    1
└─sdg1 /media/1TB_SHARE                       1
sdh                       SanDisk SDSSDA24    0
├─sdh1                                        0
└─sdh2 /media/Windows                         0
sr0                       BD-RE  BH16NS40     1
sr1                       DVD-RAM GH40L       1

This is after a system reboot, so my drive designations changed again, but as you can see my SanDisk drives are SSDs and ROTA shows 0.


Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *