Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it safe to run fstrim -v / if I have rotational HDD mounted in /dev/media?

For now, whenever I want to trim the SSD I just unmount those drives, run fstrim and mount them again.

share|improve this question
add comment

1 Answer 1

The root directory "/" in your fstrim command is a mount point, not a path. As such, trim applies only to that mounted partition and will not recurse through the path into a new mountpoint.

You can double check this action by running manually with the verbose flag on (-v, and I see it there in your command). If there are no errors, you're fine.

This point about the mountpoint is implied, but not explicit in the man page: http://manpages.ubuntu.com/manpages/raring/man8/fstrim.8.html and on archlinux: https://wiki.archlinux.org/index.php/SSD#Apply_TRIM_via_cron but I also found other forum posts with the same assertion.

p.s. I found the archlinux page quite informative, laying out various ways to achieve SSD performance improvements. One noteworthy detail I saw there, when discussing the "discard" method was that the discard flag was added to each mount point separately in their example, even though one partition was mounted downstream of the other (/ and /home). Good luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.