The post shows a different ways to test if your hard drives on the servers are SSD or NVMe. Another one would be to use the “dd” command to test the read/write speed, which should give you a rough idea.
Check Disk Type: SSD (Solid State Driver)
To check if the disk on your VPN server is an SSD, you can use one of these methods based on your operating system:
Linux
On Linux, you can check if a disk is an SSD by using the following commands:
Method 1: Using lsblk
1 | lsblk -d -o name,rota |
lsblk -d -o name,rota
Example output:
NAME ROTA
loop0 1
loop1 1
loop2 1
loop3 1
sda 1
The ROTA column shows if the device is rotational (1) or non-rotational (0).
If ROTA is 0, the device is likely an SSD (Solid State Drive).
Method 2: Using cat on /sys/block
1 | cat /sys/block/sdX/queue/rotational |
cat /sys/block/sdX/queue/rotational
Replace sdX with your actual disk (e.g., sda, sdb).
If the output is 0, the disk is an SSD. If it’s 1, it’s an HDD.
Method 3: Using lsblk with -D (for discard capability)
1 | lsblk -D |
lsblk -D
Example output:
NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
loop0 0 4K 4G 0
loop1 0 4K 4G 0
loop2 0 4K 4G 0
loop3 0 4K 4G 0
sda 0 32K 2G 0
├─sda1 0 32K 2G 0
├─sda14 0 32K 2G 0
├─sda15 0 32K 2G 0
└─sda16 0 32K 2G 0
SSDs often support the “discard” feature, so a non-zero value in the “DISC-GRAN” column usually indicates SSD capability.
Windows
If you’re using a Windows-based VPN server, you can check disk type with PowerShell:
Get-PhysicalDisk | Select-Object -Property DeviceID, MediaType
The MediaType column will show SSD for SSD disks and HDD for hard drives.
MacOS
On MacOS, you can use diskutil:
1 | diskutil info diskX | grep "Solid State" |
diskutil info diskX | grep "Solid State"
Replace diskX with the actual disk identifier (e.g., disk0). If the disk is an SSD, this will show “Solid State: Yes.”
Each of these methods should help you determine the disk type on your VPN server.
Check Disk Type: NVMe SSD
The above methods also work for NVMe (Non-Volatile Memory Express) drives on Linux, Windows, and macOS, though there are some differences in file paths and command outputs:
Linux
On Linux, NVMe drives typically appear as /dev/nvme0n1, /dev/nvme1n1, etc. Here are the methods adjusted for NVMe:
Method 1: Using lsblk
1 | lsblk -d -o name,rota |
lsblk -d -o name,rota
NVMe drives will usually show ROTA as 0, indicating non-rotational (SSD).
Method 2: Using /sys/block
1 | cat /sys/block/nvme0n1/queue/rotational |
cat /sys/block/nvme0n1/queue/rotational
Replace nvme0n1 with your NVMe device.
The output should be 0 for NVMe drives.
Method 3: Using nvme tool
If you have the nvme CLI tool installed, you can also check the drive information:
1 | nvme list |
nvme list
You can install the nvme-cli package, for example, on Ubuntu:
1 | sudo apt install nvme-cli |
sudo apt install nvme-cli
This will display details about all NVMe devices, including their model, capacity, and serial number, helping to identify if it’s an NVMe SSD.
Windows
On Windows, the PowerShell command will also identify NVMe drives:
Get-PhysicalDisk | Select-Object -Property DeviceID, MediaType, Model
In the output, MediaType will show SSD for NVMe drives. The Model field can help confirm if the drive is NVMe-based.
Example output:
DeviceID MediaType Model
——– ——— —–
1 HDD Elements 25A3
2 HDD Elements 25A3
0 SSD MZVL22T0HBLB-00BMV SAMSUNG
macOS
On macOS, the diskutil command works similarly for NVMe drives:
1 | diskutil info diskX | grep "Solid State" |
diskutil info diskX | grep "Solid State"
Replace diskX with the NVMe disk identifier (e.g., disk0).
If it is an SSD, you’ll see “Solid State: Yes,” and additional details can confirm it’s an NVMe if specified by the manufacturer.
–EOF (The Ultimate Computing & Technology Blog) —
loading...
Last Post: Difference Between Product Design Interview and System Design Interview
Next Post: How to Use dd Command to Test the Hard Disk Speed?