I've been researching how to trim my SSD boot drive but am having problems making it work. First, TRIM does seem to be supported for my drive, per:
HP-Pavilion-Mini / # hdparm -I /dev/sdb | grep TRIM
* Data Set Management TRIM supported (limit 1 block)
* Deterministic read data after TRIM
But for some reason, I cannot seem to run fstrim:
HP-Pavilion-Mini / # sudo -v fstrim /
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user]
[VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...
** Could someone tell me what the correct command is for this now?
Also, if I were to add this to fstab, would I simply add "discard" to the following line (before the errors...)?
UUID=2319eb2f-9eab-454c-85a4-1dd7990bf8b1 / ext4 errors=remount-ro 0 1
or should I change it to:
UUID=[UUID of SSD mount] / ext4 defaults,noatime,discard 0 1
Thanks for any help.
TRIM Question [SOLVED]
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
TRIM Question [SOLVED]
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 4 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: TRIM Question
Because it's COMMAND OPTIONS ARGUMENTS
Your -v option got applied to the sudo command. Try...
...or if you are already root, miss out the sudo.
/etc/fstab entries go...
...so...
...and...
...have exactly the same effect. You might like to add noatime to stop every read causing a write...
Your -v option got applied to the sudo command. Try...
Code: Select all
sudo fstrim -v /
Code: Select all
fstrim -v /
Code: Select all
WHAT WHERE TYPE O,P,T,I,O,N,S 0 1
Code: Select all
UUID=2319eb2f-9eab-454c-85a4-1dd7990bf8b1 / ext4 discard,errors=remount-ro 0 1
Code: Select all
UUID=2319eb2f-9eab-454c-85a4-1dd7990bf8b1 / ext4 errors=remount-ro,discard 0 1
Code: Select all
UUID=2319eb2f-9eab-454c-85a4-1dd7990bf8b1 / ext4 errors=remount-ro,discard,noatime 0 1
Last edited by Mute Ant on Sun Jun 07, 2015 7:28 pm, edited 1 time in total.
Re: TRIM Question
Yes, thank you -- I think the page that I got the command from just had a typo (it mistakenly had the -v first so I did a copy/paste of that command). Unfortunately, it doesn't work the other way either:
# sudo fstrim -v /
fstrim: /: FITRIM ioctl failed: Operation not supported
As root:
# fstrim -v /
fstrim: /: FITRIM ioctl failed: Operation not supported
Why would the hdparm indicate TRIM is supported but the fstrim operation is not supported?
I may just add the fstab options -- but I had read that wasn't as good to use (not sure why though).
# sudo fstrim -v /
fstrim: /: FITRIM ioctl failed: Operation not supported
As root:
# fstrim -v /
fstrim: /: FITRIM ioctl failed: Operation not supported
Why would the hdparm indicate TRIM is supported but the fstrim operation is not supported?
I may just add the fstab options -- but I had read that wasn't as good to use (not sure why though).
Re: TRIM Question
''Why would the hdparm indicate TRIM is supported but the fstrim operation is not supported?'' My guess is that ''running on an external SSD'' stops 'trim' commands getting to the drive.
Re: TRIM Question
Even though the OS is running on the drive? I suppose there must be some difference, I guess.
Re: TRIM Question
''the OS is running on the drive?'' No, copied from the drive into RAM.
Re: TRIM Question
I found this link that supports your answer (thought it's a bit dated):
http://askubuntu.com/questions/262154/t ... -supported
I suppose this is one reason to purchase an internal SSD before too long.
http://askubuntu.com/questions/262154/t ... -supported
I suppose this is one reason to purchase an internal SSD before too long.
Re: TRIM Question
I've installed the SSD internally and the fstrim operation does appear to be working.