Debian 12 bookworm
Sponsored Link

Display Disk Settings2023/07/17

 
Display Disk Settings information on your Computer.
[1] Install required packages.
For SCSI or SATA devices, Install [hdparm], For NVMe devices like M.2 SSD, Install [nvme-cli].
root@dlp:~#
apt -y install hdparm nvme-cli
[2] This is the basic usage for [hdparm].
# display basic disk settings

root@dlp:~#
hdparm /dev/sda


/dev/sda:
 multcount     =  0 (off)
 IO_support    =  1 (32-bit)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 116737/255/63, sectors = 1875385008, start = 0

# display detailed disk info

root@dlp:~#
hdparm -I /dev/sda


/dev/sda:

ATA device, with non-removable media
        Model Number:       SanDisk Ultra II 960GB
        Serial Number:      165261422001
        Firmware Revision:  X41200RL
        Media Serial Num:
        Media Manufacturer:
        Transport:          Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
        Used: unknown (minor revision code 0x0110)
        Supported: 9 8 7 6 5
        Likely used: 9
Configuration:
        Logical         max     current
        cylinders       16383   0
        heads           16      0
        sectors/track   63      0
        --
        LBA    user addressable sectors:   268435455
        LBA48  user addressable sectors:  1875385008
        Logical  Sector size:                   512 bytes
        Physical Sector size:                   512 bytes
        Logical Sector-0 offset:                  0 bytes
        device size with M = 1024*1024:      915715 MBytes
        device size with M = 1000*1000:      960197 MBytes (960 GB)
        cache/buffer size  = unknown
        Form Factor: 2.5 inch
        Nominal Media Rotation Rate: Solid State Device
.....
.....

# run cached and buffered reads test

root@dlp:~#
hdparm -Tt /dev/sda


/dev/sda:
 Timing cached reads:   22604 MB in  1.99 seconds = 11359.30 MB/sec
 Timing buffered disk reads: 1584 MB in  3.00 seconds = 527.44 MB/sec
[3] This is the basic usage for [nvme-cli].
# display NVMe devices

root@dlp:~#
nvme list

Node                  SN                   Model                                    Namespace Usage                      Format           FW Rev
--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1          P02724117355         PLEXTOR PX-1TM8SeY                       1           1.02  TB /   1.02  TB    512   B +  0 B   1.00

# display device info

root@dlp:~#
nvme id-ctrl -H /dev/nvme0n1


NVME Identify Controller:
vid       : 0x14a4
ssvid     : 0x1b4b
sn        : P02724117355
mn        : PLEXTOR PX-1TM8SeY
fr        : 1.00
rab       : 0
ieee      : 002303
cmic      : 0
  [3:3] : 0     ANA not supported
  [2:2] : 0     PCI
  [1:1] : 0     Single Controller
  [0:0] : 0     Single Port

mdts      : 5
cntlid    : 0x1
ver       : 0x10200
rtd3r     : 0xf4240
rtd3e     : 0x1e8480
oaes      : 0
  [31:31] : 0   Discovery Log Change Notice Not Supported
  [27:27] : 0   Zone Descriptor Changed Notices Not Supported
  [15:15] : 0   Normal NSS Shutdown Event Not Supported
.....
.....

# display SMART log

root@dlp:~#
nvme smart-log /dev/nvme0n1

Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning                        : 0
temperature                             : 31 C (304 Kelvin)
available_spare                         : 100%
available_spare_threshold               : 0%
percentage_used                         : 2%
endurance group critical warning summary: 0
data_units_read                         : 18,178,170
data_units_written                      : 111,692,722
host_read_commands                      : 128,243,567
host_write_commands                     : 632,121,321
controller_busy_time                    : 71,720
power_cycles                            : 14
power_on_hours                          : 40,516
unsafe_shutdowns                        : 3
media_errors                            : 0
num_err_log_entries                     : 0
Warning Temperature Time                : 0
Critical Composite Temperature Time     : 0
Temperature Sensor 1           : 31 C (304 Kelvin)
Thermal Management T1 Trans Count       : 0
Thermal Management T2 Trans Count       : 0
Thermal Management T1 Total Time        : 0
Thermal Management T2 Total Time        : 0

# display error log

root@dlp:~#
nvme error-log /dev/nvme0n1

Error Log Entries for device:nvme0n1 entries:64

.....
.....

.................
 Entry[63]
.................
error_count     : 0
sqid            : 0
cmdid           : 0
status_field    : 0(SUCCESS: The command completed successfully)
phase_tag       : 0
parm_err_loc    : 0
lba             : 0
nsid            : 0
vs              : 0
trtype          : The transport type is not indicated or the error is not transport related.
cs              : 0
trtype_spec_info: 0
.................
[4] For benchmarking to any Disk, it's possible to do with [fio (Flexible I/O Tester)] tool.
root@dlp:~#
apt -y install fio
root@dev:~#
df -h /mnt

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  954G  354G  600G  38% /mnt

# test sequential reads with 4K block size

root@dlp:~#
fio --bs=4k --size=1G --direct=1 --rw=read --numjobs=64 --runtime=10 --group_reporting --name=testjob4K1G --filename=/mnt/testfile4K1G


testjob4K1G: (g=0): rw=read, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
...
fio-3.28
Starting 64 processes
testjob4K1G: Laying out IO file (1 file / 1024MiB)
Jobs: 64 (f=64): [R(64)][100.0%][r=1164MiB/s][r=298k IOPS][eta 00m:00s]
testjob4K1G: (groupid=0, jobs=64): err= 0: pid=1847: Thu Sep 22 05:26:23 2022
  read: IOPS=298k, BW=1166MiB/s (1222MB/s)(11.4GiB/10002msec)
    clat (usec): min=30, max=2538, avg=213.52, stdev=22.74
     lat (usec): min=30, max=2538, avg=213.60, stdev=22.74
    clat percentiles (usec):
     |  1.00th=[  180],  5.00th=[  194], 10.00th=[  200], 20.00th=[  204],
     | 30.00th=[  206], 40.00th=[  210], 50.00th=[  212], 60.00th=[  215],
     | 70.00th=[  217], 80.00th=[  223], 90.00th=[  231], 95.00th=[  239],
     | 99.00th=[  260], 99.50th=[  269], 99.90th=[  486], 99.95th=[  529],
     | 99.99th=[  857]
   bw (  MiB/s): min= 1131, max= 1189, per=100.00%, avg=1166.69, stdev= 0.20, samples=1216
   iops        : min=289784, max=304574, avg=298673.32, stdev=51.36, samples=1216
  lat (usec)   : 50=0.01%, 100=0.02%, 250=98.05%, 500=1.84%, 750=0.07%
  lat (usec)   : 1000=0.01%
  lat (msec)   : 2=0.01%, 4=0.01%
  cpu          : usr=1.24%, sys=3.11%, ctx=2985315, majf=0, minf=918
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=2985023,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=1166MiB/s (1222MB/s), 1166MiB/s-1166MiB/s (1222MB/s-1222MB/s), io=11.4GiB (12.2GB), run=10002-10002msec

Disk stats (read/write):
  nvme0n1: ios=2984198/0, merge=0/0, ticks=618777/0, in_queue=618777, util=98.78%

# test sequential reads with 512K block size

root@dlp:~#
fio --bs=512k --size=1G --direct=1 --rw=read --numjobs=64 --runtime=10 --group_reporting --name=testjob512K1G --filename=/mnt/testfile512K1G


testjob512K1G: (g=0): rw=read, bs=(R) 512KiB-512KiB, (W) 512KiB-512KiB, (T) 512KiB-512KiB, ioengine=psync, iodepth=1
...
fio-3.28
Starting 64 processes
testjob512K1G: Laying out IO file (1 file / 1024MiB)
Jobs: 64 (f=64): [R(64)][100.0%][r=2223MiB/s][r=4445 IOPS][eta 00m:00s]
testjob512K1G: (groupid=0, jobs=64): err= 0: pid=1935: Thu Sep 22 05:27:49 2022
  read: IOPS=4411, BW=2206MiB/s (2313MB/s)(21.6GiB/10036msec)
    clat (usec): min=853, max=36694, avg=14474.51, stdev=5347.40
     lat (usec): min=853, max=36694, avg=14474.92, stdev=5347.41
    clat percentiles (usec):
     |  1.00th=[12911],  5.00th=[12911], 10.00th=[12911], 20.00th=[12911],
     | 30.00th=[12911], 40.00th=[12911], 50.00th=[12911], 60.00th=[12911],
     | 70.00th=[12911], 80.00th=[12911], 90.00th=[13173], 95.00th=[33162],
     | 99.00th=[36439], 99.50th=[36439], 99.90th=[36439], 99.95th=[36439],
     | 99.99th=[36439]
   bw (  MiB/s): min= 1938, max= 2501, per=100.00%, avg=2210.82, stdev= 3.52, samples=1260
   iops        : min= 3876, max= 5002, avg=4421.65, stdev= 7.04, samples=1260
  lat (usec)   : 1000=0.01%
  lat (msec)   : 2=0.02%, 4=0.03%, 10=0.07%, 20=92.42%, 50=7.46%
  cpu          : usr=0.06%, sys=0.65%, ctx=44441, majf=0, minf=9014
  IO depths    : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
     submit    : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     complete  : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
     issued rwts: total=44274,0,0,0 short=0,0,0,0 dropped=0,0,0,0
     latency   : target=0, window=0, percentile=100.00%, depth=1

Run status group 0 (all jobs):
   READ: bw=2206MiB/s (2313MB/s), 2206MiB/s-2206MiB/s (2313MB/s-2313MB/s), io=21.6GiB (23.2GB), run=10036-10036msec

Disk stats (read/write):
  nvme0n1: ios=174942/7, merge=0/2, ticks=2497973/128, in_queue=2498127, util=98.83%
Matched Content