View previous topic :: View next topic |
Author |
Message |
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Thu Feb 26, 2015 7:51 pm Post subject: [solved]"/sbin/fstrim -v /" outputs always values |
|
|
shouldn't that value goes down nearer to zero after few runs ? - I let it run now at every 5 hours -it runs for about 15 min at my 240GB SSD - but the output is always 38 GB or so.
Last edited by toralf on Fri Feb 27, 2015 1:08 pm; edited 1 time in total |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54266 Location: 56N 3W
|
Posted: Thu Feb 26, 2015 7:56 pm Post subject: |
|
|
toralf,
Code: | # /sbin/fstrim -av
/usr/local: 970.6 MiB (1017745408 bytes) trimmed
/opt: 672.1 MiB (704757760 bytes) trimmed
/var: 3.1 GiB (3313926144 bytes) trimmed
/usr: 19.5 GiB (20948844544 bytes) trimmed
/: 695.7 MiB (729473024 bytes) trimmed
NeddySeagoon_Static ~ # /sbin/fstrim -av
/usr/local: 0 B (0 bytes) trimmed
/opt: 0 B (0 bytes) trimmed
/var: 0 B (0 bytes) trimmed
/usr: 0 B (0 bytes) trimmed
/: 0 B (0 bytes) trimmed |
Seems to work for me but I used the -a option too _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Thu Feb 26, 2015 8:33 pm Post subject: |
|
|
And I get (again) : Code: | t44 ~ # /sbin/fstrim -av
/: 37.3 GiB (40041742336 bytes) trimmed
~ $ equery b /sbin/fstrim
* Searching for /sbin/fstrim ...
sys-apps/util-linux-2.24.1-r3 (/sbin/fstrim)
~ $ mount
rootfs on / type rootfs (rw)
/dev/sda3 on / type btrfs (rw,noatime)
|
|
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Thu Feb 26, 2015 8:42 pm Post subject: |
|
|
man 8 fstrim wrote: | Code: | -v, --verbose
Verbose execution. With this option fstrim will output the number
of bytes passed from the filesystem down the block stack to the
device for potential discard. This number is a maximum discard
amount from the storage device's perspective, because FITRIM ioctl
called repeated will keep sending the same sectors for discard
repeatedly.
fstrim will report the same potential discard bytes each time, but
only sectors which had been written to between the discards would
actually be discarded by the storage device. Further, the kernel
block layer reserves the right to adjust the discard ranges to fit
raid stripe geometry, non-trim capable devices in a LVM setup,
etc. These reductions would not be reflected in fstrim_range.len
(the --length option). |
|
Not sure what output you're expecting, given this description. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Thu Feb 26, 2015 8:54 pm Post subject: |
|
|
Ant P. wrote: |
Not sure what output you're expecting, given this description. | If I run it 2 times in a row I'd expect a similar output like yours, meaning "0 B (0 bytes) trimmed " |
|
Back to top |
|
|
s4e8 Guru
Joined: 29 Jul 2006 Posts: 311
|
Posted: Fri Feb 27, 2015 2:22 am Post subject: |
|
|
fstrim w/ btrfs is buggy.
1. it don't remember trim state, always trim whole partition again
2. it don't trim unallocated chunk. space outside used in command "btrfs fi df <dir>"
3. it use vrange to iterate chunks. If vrange large than prange, it would trim nothing |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3922 Location: Hamburg
|
Posted: Fri Feb 27, 2015 1:09 pm Post subject: |
|
|
s4e8 wrote: | fstrim w/ btrfs is buggy.
1. it don't remember trim state, always trim whole partition again
2. it don't trim unallocated chunk. space outside used in command "btrfs fi df <dir>"
3. it use vrange to iterate chunks. If vrange large than prange, it would trim nothing | ick, ok, so I used this /etc/fstab entires for now : Code: | /dev/sda3 / btrfs noatime,ssd,discard,compress=lzo |
|
|
Back to top |
|
|
|