Tuesday, August 22, 2023

.:::How to Check Disk Type SSD in Linux & Windows :::.


A. Check Disk Type in Windows
you can also use the Command Prompt to check whether you have an SSD or an HDD in Windows 11. Here's how you can do it:

Open Command Prompt:
To open the Command Prompt, you can press Win + R to open the Run dialog, type in "cmd," and press Enter. Alternatively, you can search for "Command Prompt" in the Start menu and open it from there.

Run Command:
In the Command Prompt window, type the following command and press Enter:

wmic diskdrive get model, mediatype

c:\>wmic diskdrive get model, mediatype
MediaType              Model
Fixed hard disk media  NVMe INTEL SSDPEKNU512GZ



c:\>
 


This command will provide you with a list of disk drives along with their models and media types (SSD or HDD).

Interpret the Results:
Look at the "MediaType" column to determine whether each disk is an SSD or an HDD. The media type will be listed as either "Fixed hard disk media" for HDDs or "SSD" for solid-state drives.

The "Model" column will display the model name of each drive, helping you identify which drive corresponds to which type.

Please note that the Command Prompt output might display additional information as well, such as serial numbers or other details about the drives. Make sure to focus on the "MediaType" column to identify the drive types accurately.


B. How to Check Disk Type SSD in Linux

In Linux, you can use the command line interface to check whether a disk is an SSD or an HDD. The lsblk and smartctl commands are commonly used for this purpose. Here's how you can do it:

Open Terminal:
Open the terminal on your Linux system. You can usually find it in the applications menu or by pressing Ctrl + Alt + T.

List Block Devices (lsblk):
Enter the following command to list the block devices:

lsblk -d -o name,rota
lsblk -d -o name,rota,size,type
lsblk -d -o name,rota,size,type,mountpoints
 
[root@teguhth ~]# hostname;lsblk -d -o name,rota,size,type,mountpoint
teguhth
NAME ROTA  SIZE TYPE MOUNTPOINT
sda     1   25G disk
sr0     1  4.4G rom
[root@teguhth ~]#
 

This command will display a list of block devices along with a column indicating whether each device is rotational (HDD) or not (SSD). If the value in the "rota" column is 0, it's an SSD. If it's 1, it's an HDD.

C. Check SMART Information (smartctl):
You can also use the smartctl command to gather detailed information about the storage device, including whether it's an SSD or an HDD. First, you need to install the smartmontools package if it's not already installed:


sudo apt-get install smartmontools   # For Debian/Ubuntu-based systems
smartctl -a /dev/sda | grep 'Rotation Rate'
smartctl -a /dev/sda

sudo smartctl -a /dev/sdX
Replace /dev/sdX with the appropriate device name (e.g., /dev/sda, /dev/nvme0n1). Look for the "Rotation Rate" field in the output. If it's "Solid State Device," it's an SSD. If it's "7200 rpm" or similar, it's an HDD.

Please exercise caution when using the command line, especially when dealing with disk-related operations. Make sure you are using the correct device name to avoid accidental data loss.


[root@teguhth ~]# cd /data/
[root@teguhth data]# ls
backup_mariadb.sh    edb                                             MariaDB-client-10.5.21-1.el7.centos.x86_64.rpm  script
backup_transaksi.sh  htop-2.2.0-3.el7.x86_64.rpm                     MariaDB-server-10.5.21-1.el7.centos.x86_64.rpm  Simple_Calculator.sh
clearswaplinux.sh    mariadbbackup                                   mlocate-0.26-8.el7.x86_64.rpm                   smartmontools-7.0-2.el7.x86_64.rpm
client               MariaDB-backup-10.4.30-1.el7.centos.x86_64.rpm  pgdg-redhat-repo-latest.noarch.rpm
[root@teguhth data]# rpn -ivh smartmontools-7.0-2.el7.x86_64.rpm
-bash: rpn: command not found
[root@teguhth data]# rpm -ivh smartmontools-7.0-2.el7.x86_64.rpm
error: Failed dependencies:
        mailx is needed by smartmontools-1:7.0-2.el7.x86_64
[root@teguhth data]#
[root@teguhth data]# rpm -ivh mailx-12.5-19.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:mailx-12.5-19.el7                ################################# [100%]
[root@teguhth data]# rpm -ivh smartmontools-7.0-2.el7.x86_64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:smartmontools-1:7.0-2.el7        ################################# [100%]
[root@teguhth data]#
[root@teguhth data]#
[root@teguhth data]#  systemctl start smartd
[root@teguhth data]#  systemctl enable smartd
[root@teguhth data]# smartctl -a /dev/sda | grep 'Rotation Rate'
Rotation Rate:        15000 rpm
[root@teguhth data]#


[root@teguhth data]# smartctl -a /dev/sda
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-3.10.0-1160.el7.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               VMware,
Product:              VMware Virtual S
Revision:             1.0
User Capacity:        26,843,545,600 bytes [26.8 GB]
Logical block size:   512 bytes
Rotation Rate:        15000 rpm
Device type:          disk
Local Time is:        Tue Aug 22 09:47:00 2023 WIB
SMART support is:     Unavailable - device lacks SMART capability.

=== START OF READ SMART DATA SECTION ===
Current Drive Temperature:     0 C
Drive Trip Temperature:        0 C

Error Counter logging not supported

Device does not support Self Test logging
[root@teguhth data]#

No comments:

Post a Comment

Popular Posts