ssd trim

Issues related to applications and software problems
Post Reply
rbrick49
Posts: 34
Joined: 2014/06/22 12:55:02

ssd trim

Post by rbrick49 » 2014/07/12 13:47:12

I have CentOS 7 installed on an intel ssd how do I check to see if trim is working on my system.my system is uefi sda1 fat 210 mb,sda2 xfs 524 MB,sda3 linux lvm 239GB
asrock extreme4 motherboard,intel i7 4770k cpu,32 gig ram,asus xonar d2x sound card,hp2309m monitor,logitech g930 usb headset,centos 7 x86_64,opensuse 13.1uefi,fedora 20 uefi,inux mint 17 uefi.

User avatar
toracat
Forum Moderator
Posts: 7307
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: ssd trim

Post by toracat » 2014/07/12 15:12:44

What is the output of :

cat /sys/block/sda/queue/discard_max_bytes
or
cat /sys/block/sda/queue/discard_granularity
(provided your device is sda)

If it is non-zero, discard operations are supported.
CentOS Forum FAQ

rbrick49
Posts: 34
Joined: 2014/06/22 12:55:02

Re: ssd trim

Post by rbrick49 » 2014/07/12 19:11:51

non zero heres the output
[rbrickle@localhost ~]$ cat /sys/block/sda/queue/discard_max_bytes
2147450880
[rbrickle@localhost ~]$ cat /sys/block/sda/queue/discard_granularity
512
asrock extreme4 motherboard,intel i7 4770k cpu,32 gig ram,asus xonar d2x sound card,hp2309m monitor,logitech g930 usb headset,centos 7 x86_64,opensuse 13.1uefi,fedora 20 uefi,inux mint 17 uefi.

User avatar
toracat
Forum Moderator
Posts: 7307
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: ssd trim

Post by toracat » 2014/07/12 19:21:30

Then try and run the fstrim command. For example, I have a filesystem /home, so:

Code: Select all

$ sudo fstrim -v /home
/home: 20404355072 bytes were trimmed
$ sudo fstrim -v /home
/home: 0 bytes were trimmed
CentOS Forum FAQ

rbrick49
Posts: 34
Joined: 2014/06/22 12:55:02

Re: ssd trim

Post by rbrick49 » 2014/07/13 01:06:11

I am not getting the sama as you toracat
[rbrickle@localhost ~]$ sudo fstrim -v /home
[sudo] password for rbrickle:
/home: 156.9 GiB (168449187840 bytes) trimmed
[rbrickle@localhost ~]$ sudo fstrim -v /home
/home: 156.9 GiB (168449163264 bytes) trimmed
asrock extreme4 motherboard,intel i7 4770k cpu,32 gig ram,asus xonar d2x sound card,hp2309m monitor,logitech g930 usb headset,centos 7 x86_64,opensuse 13.1uefi,fedora 20 uefi,inux mint 17 uefi.

User avatar
toracat
Forum Moderator
Posts: 7307
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: ssd trim

Post by toracat » 2014/07/13 02:35:49

Can you show us the output from:

sudo blkid
df -h
CentOS Forum FAQ

rbrick49
Posts: 34
Joined: 2014/06/22 12:55:02

Re: ssd trim

Post by rbrick49 » 2014/07/13 05:37:31

[rbrickle@localhost ~]$ sudo blkid
[sudo] password for rbrickle:
/dev/sde1: UUID="2111-E051" TYPE="vfat" PARTUUID="e3851e1f-b08c-4d15-b102-66fad55e2907"
/dev/sde2: UUID="56ab111e-5ff5-45bd-8480-23aa0deccb97" TYPE="ext4" PARTUUID="e5c0a833-3d14-4123-985b-1d6fab18353a"
/dev/sde3: UUID="7c04b0e2-18a6-404c-a4c5-7a8a369d7d77" TYPE="swap" PARTUUID="7c257e6a-f923-48a8-bd4c-ad03cbeb5c1f"
/dev/sdc1: LABEL="New Volume" UUID="28FA3194FA315EEE" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="a97789ae-9da2-4ebc-ab74-24ff77380f08"
/dev/sdd1: SEC_TYPE="msdos" UUID="5E7A-DC92" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="c9e8fc4a-af98-47d2-8fba-48d5df379f22"
/dev/sdd2: UUID="42ff6b03-285b-42e5-97ae-c976afb553d7" TYPE="ext4" PARTUUID="af69142c-bd7e-4954-9f95-1c3f352c3093"
/dev/sdd3: UUID="ZDhzlQ-egAT-8RxC-rpei-TLIR-HLC0-XaMuRz" TYPE="LVM2_member" PARTUUID="a79e3701-a2c7-4c47-afed-9c133929b806"
/dev/sda1: SEC_TYPE="msdos" UUID="BAF2-C47D" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="cd72f7b1-a1c3-465c-882c-b475c0a63205"
/dev/sda2: UUID="f3163e53-d327-4e16-917f-5efea67857c1" TYPE="xfs" PARTUUID="0d2730d5-f63f-4ccc-9b87-015044be1522"
/dev/sda3: UUID="JMRwLn-kKcv-h6L4-rTc4-Ahbz-nFef-C93dez" TYPE="LVM2_member" PARTUUID="617823c5-1c57-482d-9629-bb5c662b00bf"
/dev/sdb1: SEC_TYPE="msdos" UUID="71D9-1BD8" TYPE="vfat" PARTLABEL="primary" PARTUUID="7c76a58b-b84c-4ded-84ba-b3092f0adb4a"
/dev/sdb2: UUID="S3iK5q-wsr6-niPd-lUhH-PCy5-29Gl-0tG7ex" TYPE="LVM2_member" PARTLABEL="primary" PARTUUID="a00cd324-405b-4b1d-ad85-1e4f64b55e72"
/dev/mapper/centos-swap: UUID="fa992708-73ae-495c-804f-568c94a2daa9" TYPE="swap"
/dev/mapper/centos-root: UUID="9168cb3f-e517-4130-a7d9-8b846f3881e0" TYPE="xfs"
/dev/mapper/fedora-swap: UUID="cf4bffe8-bc69-4f9c-a91b-1b6c6b9e25cd" TYPE="swap"
/dev/mapper/system-home: UUID="888f970e-babd-4f30-97f7-979da20c8b00" TYPE="ext4"
/dev/mapper/system-root: UUID="f164aeb0-dd21-4659-bdaa-d1ea9c45e2ad" TYPE="ext4"
/dev/mapper/fedora-home: UUID="782b4ffc-4735-40e8-848d-c7aa5313fd3d" TYPE="ext4"
/dev/mapper/fedora-root: UUID="5231a0f6-2a95-4886-9e02-66bacbda0e43" TYPE="ext4"
/dev/mapper/centos-home: UUID="cfab19b6-7fec-4493-8336-d49f155059d8" TYPE="xfs"
/dev/sr2: UUID="2011-09-13-12-00-00-00" LABEL="Mobile Partner" TYPE="iso9660" PTTYPE="mac"
[rbrickle@localhost ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 4.6G 46G 10% /
devtmpfs 16G 0 16G 0% /dev
tmpfs 16G 2.6M 16G 1% /dev/shm
tmpfs 16G 9.1M 16G 1% /run
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sda2 497M 153M 345M 31% /boot
/dev/sda1 200M 9.6M 191M 5% /boot/efi
/dev/mapper/centos-home 158G 565M 157G 1% /home
/dev/sdc1 932G 28G 904G 3% /run/media/rbrickle/New Volume
here you go
asrock extreme4 motherboard,intel i7 4770k cpu,32 gig ram,asus xonar d2x sound card,hp2309m monitor,logitech g930 usb headset,centos 7 x86_64,opensuse 13.1uefi,fedora 20 uefi,inux mint 17 uefi.

rbrick49
Posts: 34
Joined: 2014/06/22 12:55:02

Re: ssd trim

Post by rbrick49 » 2014/07/13 06:01:08

I just installed hdparm heres the result from hdparm sda the ssd I have centos installed on
[root@localhost ~]# /sbin/hdparm -I /dev/sda

/dev/sda:

ATA device, with non-removable media
Model Number: INTEL SSDSC2BW240A4
Serial Number: CVDA409601GG2403GN
Firmware Revision: DC32
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 0xffff)
Supported: 9 8 7 6 5
Likely used: 9
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 468862128
Logical Sector size: 512 bytes
Physical Sector size: 512 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 228936 MBytes
device size with M = 1000*1000: 240057 MBytes (240 GB)
cache/buffer size = unknown
Nominal Media Rotation Rate: Solid State Device
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Advanced power management level: 254
DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 udma5 *udma6
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
* Advanced Power Management feature set
Power-Up In Standby feature set
* 48-bit Address feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* IDLE_IMMEDIATE with UNLOAD
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
unknown 78[8]
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Data Tables (AC5)
* reserved 69[4]
* Data Set Management TRIM supported (limit 1 block)
* Deterministic read data after TRIM
Security:
Master password revision code = 65534
supported
not enabled
not locked
frozen
not expired: security count
supported: enhanced erase
4min for SECURITY ERASE UNIT. 2min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 55cd2e404b96fbc4
NAA : 5
IEEE OUI : 5cd2e4
Unique ID : 04b96fbc4
Checksum: correct
asrock extreme4 motherboard,intel i7 4770k cpu,32 gig ram,asus xonar d2x sound card,hp2309m monitor,logitech g930 usb headset,centos 7 x86_64,opensuse 13.1uefi,fedora 20 uefi,inux mint 17 uefi.

rbrick49
Posts: 34
Joined: 2014/06/22 12:55:02

Re: ssd trim

Post by rbrick49 » 2014/07/15 02:42:14

thanks
asrock extreme4 motherboard,intel i7 4770k cpu,32 gig ram,asus xonar d2x sound card,hp2309m monitor,logitech g930 usb headset,centos 7 x86_64,opensuse 13.1uefi,fedora 20 uefi,inux mint 17 uefi.

screwballl
Posts: 8
Joined: 2014/07/18 18:45:53

Re: ssd trim

Post by screwballl » 2014/07/18 19:56:32

yum install hdparm

hdparm -I /dev/sda (that is a capital i)

Look at one of the last lines:

* Data Set Management TRIM supported (limit 1 block)

As long as it has the asterisk there then it is supported and enabled.

Post Reply