I was a little surprised to find out that lspci will see my nvme hard drives, but it doesn't see my ssd hard drives.
Outputs this
However fdisk shows all my hard drives.
Outputs this
As mentioned in some other tutorials, you can use...
To get info about nvme drives.
..and you can use...
To get info about most hdd and ssd hard drives.
There is another command, we haven't talked much about. It's a more advanced command.
Most of my tutorials have been basic stuff. This command is a little more advanced.
If you have an ssd or hdd hard drive, you'll be happy to know this command works on those, but
not nvme type drives. I almost hate to mention it here, because if you don't know what you're doing
it can mess things up, but here we go.
Disclaimer: I'm not responsible for any commands you run.
This first command is pretty harmless, it just gives you some information.
Just change the X to whatever your drive letter is.
This will tell you the current power mode of the drive.
This will set the power mode level on your hard drive.
(1-127 allows spin-down, 128-254 prevents spin-down)
Enable or disable direct memory access. (Not all drives support this).
Set the acoustic manager level, lower values are quieter, higher values are faster)
Enable 32 bit I/O (This can increase performance on some drives)
Set the read ahead sector count
Check the status of write caching.
Enable write caching.
Disable write caching.
You can run the status command after you set this to see if it took effect.
Write caching can improve performance by writing to memory before writing to disk.
However, the downside is, if your computer gets unexpectedly shut down ( a power outage for example )
You will lose whatever data is in the memory cache.
I recommend writing down all your current/factory settings before changing anything.
Hopefully this will help someone.
Code:
root@absTower:~# lspci | grep -i ssd
Outputs this
Code:
01:00.0 Non-Volatile memory controller: Sandisk Corp WD Black SN850X NVMe SSD (rev 01)
However fdisk shows all my hard drives.
Code:
fdisk -l | grep Disk | grep -v mapp
Outputs this
Code:
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SQF-SM4V2-256G-S
Disklabel type: gpt
Disk identifier: 34713260-E825-4896-A4D7-27A13153B7A4
Disk /dev/sdb: 489.05 GiB, 525112713216 bytes, 1025610768 sectors
Disk model: Crucial_CT525MX3
Disklabel type: gpt
Disk identifier: 214CD305-8D57-49C3-A244-B232E66D2141
Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: WD_BLACK SN850X 2000GB
Disklabel type: gpt
Disk identifier: 09A0425F-2853-45FA-AB17-9D096F9C58E1
Disk /dev/zram0: 8 GiB, 8589934592 bytes, 2097152 sectors
As mentioned in some other tutorials, you can use...
Code:
smartctl -a /dev/nvme0n1
To get info about nvme drives.
..and you can use...
Code:
smartctl -x /dev/sda
To get info about most hdd and ssd hard drives.
There is another command, we haven't talked much about. It's a more advanced command.
Most of my tutorials have been basic stuff. This command is a little more advanced.
If you have an ssd or hdd hard drive, you'll be happy to know this command works on those, but
not nvme type drives. I almost hate to mention it here, because if you don't know what you're doing
it can mess things up, but here we go.
Disclaimer: I'm not responsible for any commands you run.
This first command is pretty harmless, it just gives you some information.
Code:
sudo hdparm -I /dev/sdX
Just change the X to whatever your drive letter is.
This will tell you the current power mode of the drive.
Code:
sudo hdparm -C /dev/sdX
This will set the power mode level on your hard drive.
Code:
sudo hdparm -B 128 /dev/sdX
(1-127 allows spin-down, 128-254 prevents spin-down)
Enable or disable direct memory access. (Not all drives support this).
Code:
sudo hdparm -d1 /dev/sdX # Enable DMA
sudo hdparm -d0 /dev/sdX # Disable DMA
Set the acoustic manager level, lower values are quieter, higher values are faster)
Code:
sudo hdparm -M 128 /dev/sdX
Enable 32 bit I/O (This can increase performance on some drives)
Code:
sudo hdparm -c1 /dev/sdX
Set the read ahead sector count
Code:
sudo hdparm -a 256 /dev/sdX
Check the status of write caching.
Code:
sudo hdparm -W /dev/sdX
Enable write caching.
Code:
sudo hdparm -W1 /dev/sdX
Disable write caching.
Code:
sudo hdparm -W0 /dev/sdX
You can run the status command after you set this to see if it took effect.
Write caching can improve performance by writing to memory before writing to disk.
However, the downside is, if your computer gets unexpectedly shut down ( a power outage for example )
You will lose whatever data is in the memory cache.
I recommend writing down all your current/factory settings before changing anything.
Hopefully this will help someone.
Last edited: