TEXT 29
Test ssd trim support Guest on 26th April 2021 05:43:26 AM
  1.  
  2.  
  3. Relatively safe method, if you already have a filesystem on the drive:
  4.  
  5. 1. make sure 'discard' or equivalent mount option is enabled
  6.  
  7. 2. write some data to a test file
  8.  
  9. 3. hdparm --fibmap testfile
  10.  
  11. 4. make sure data is actually there:
  12. sync
  13. hdparm --read-sector <a sector number from the above command> /dev/sda
  14.  
  15. 5. rm testfile
  16. sync
  17. hdparm --read-sector <a sector number from the above command> /dev/sda
  18.  
  19. sector should now be all 0's
  20.  
  21.  
  22. Unssafe method, if there is no data on the drive that you care about:
  23. write some data to the first sector
  24. hdparm --trim-sector-ranges 0:1 /dev/sda
  25. hdparm --read-sector 0

Paste-bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.