diff options
author | Karel Zak | 2013-12-10 15:49:49 +0100 |
---|---|---|
committer | Karel Zak | 2013-12-10 16:40:31 +0100 |
commit | 36c370cbf1481aa8724dff8b7b7fec4a8ba9930b (patch) | |
tree | ee58ac627274c438bac2cfffb3e9060c79aa62a6 /sys-utils/fstrim.8 | |
parent | libmount: add efivarfs to the list of pseudo filesystems (diff) | |
download | kernel-qcow2-util-linux-36c370cbf1481aa8724dff8b7b7fec4a8ba9930b.tar.gz kernel-qcow2-util-linux-36c370cbf1481aa8724dff8b7b7fec4a8ba9930b.tar.xz kernel-qcow2-util-linux-36c370cbf1481aa8724dff8b7b7fec4a8ba9930b.zip |
fstrim: add --all to discard all filesystem
* read /proc/self/mountinfo to get filesystems
* ignore net and pseudo filesystems
* ignore unaccessible filesystems (over mounted by another FS)
* read disk sysfs queue/discard_granularity to detect is discard support
* call FITRIM ioctl
* silently ignore EOPNOTSUPP (for example LUKS without discard) and ENOTTY
(for example vfat) errors
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/fstrim.8')
-rw-r--r-- | sys-utils/fstrim.8 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys-utils/fstrim.8 b/sys-utils/fstrim.8 index 0709f9a8c..6572c7060 100644 --- a/sys-utils/fstrim.8 +++ b/sys-utils/fstrim.8 @@ -4,6 +4,7 @@ fstrim \- discard unused blocks on a mounted filesystem .SH SYNOPSIS .B fstrim +.RB [ \-a ] .RB [ \-o .IR offset ] .RB [ \-l @@ -35,6 +36,11 @@ followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g. "K" has the same meaning as "KiB") or the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. +.IP "\fB\-a, \-\-all\fP" +Discard all mounted filesystem on devices that support discard operation. The +another options like offset, length and minimum are applied to all the devices. +The errors from filesystems that do not support discard operation are silently +ignored. .IP "\fB\-h, \-\-help\fP" Display help text and exit. .IP "\fB\-o, \-\-offset\fP \fIoffset\fP" @@ -73,6 +79,20 @@ LVM setup, etc. These reductions would not be reflected in fstrim_range.len .B --length option). +.SH RETURN CODES +.IP 0 +success +.IP 1 +failure +.IP 32 +all failed +.IP 64 +some filestems discard succeeded, some failed +.PP +The command +.B fstrim --all +returns 0 (all success), 32 (all failed) or 64 (some failed, some success). + .SH AUTHOR .nf Lukas Czerner <lczerner@redhat.com> |