轻工业OpenStack

关于用法 fstrim -v mountpoint 请教一下有没有什么风险?

那位大师熟悉这个命令的用法 fstrim -v mountpoint  请教一下 有没有什么风险?

参与3

1同行回答

陈灿东陈灿东系统运维工程师北京优特捷信息技术有限公司
fstrim is used on a mounted filesystem to discard (or "trim") blocks which are not in use by the filesystem. This is useful for solid- state drives (SSDs) and thinly-provisioned storage. By default, fstrim will discard all unused blocks...显示全部
   fstrim is used on a mounted filesystem to discard (or "trim") blocks
   which are not in use by the filesystem.  This is useful for solid-
   state drives (SSDs) and thinly-provisioned storage.

   By default, fstrim will discard all unused blocks in the filesystem.
   Options may be used to modify this behavior based on range or size,
   as explained below.

   The mountpoint argument is the pathname of the directory where the
   filesystem is mounted.

   Running fstrim frequently, or even using mount -o discard, might
   negatively affect the lifetime of poor-quality SSD devices.  For most
   desktop and server systems a sufficient trimming frequency is once a
   week.  Note that not all devices support a queued trim, so each trim
   command incurs a performance penalty on whatever else might be trying
   to use the disk at the time.

http://www.man7.org/linux/man-pages/man8/fstrim.8.html 说的很清楚,在写入数据的前擦除了未使用的空间这个就是trim,而不是在写入时同时进行擦除,因此trim可以提高文件保存性,官方建议一周最多trim文件目录一次,频繁trim会影响ssd的使用寿命

收起
互联网服务 · 2019-08-02
浏览2807

提问者

qditz
项目总监青岛弘腾数码有限公司
擅长领域: 服务器数据库灾备

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2019-07-31
  • 关注会员:2 人
  • 问题浏览:3199
  • 最近回答:2019-08-02
  • X社区推广