On Thu, Feb 28, 2019 at 4:56 PM Carlos E. R.
On 28/02/2019 14.24, Andrei Borzenkov wrote:
On Thu, Feb 28, 2019 at 4:06 PM Carlos E. R.
wrote: ... I tried on mine:
Telcontar:~ # fstrim -av /other/ssd-test: 3.8 GiB (4092694528 bytes) trimmed /boot: 928.1 MiB (973135872 bytes) trimmed /: 99.1 GiB (106444374016 bytes) trimmed Telcontar:~ #
...
A second attemp reports:
Telcontar:~ # fstrim -av /other/ssd-test: 0 B (0 bytes) trimmed /boot: 0 B (0 bytes) trimmed /: 313.8 MiB (328978432 bytes) trimmed Telcontar:~ #
What is your filesystem type for all three?
Me?
/other/ssd-test: ext4 /boot: ext2 / ext4
Indeed, ext4 "remembers" last trimmed size, at lest until reboot.
I find curious that the job was done Monday, yet today it claims "99.1 GiB trimmed" - I did run zypper up yesterday (and rebooted), but 100 gigs?:
fstrim has no knowledge about unmapped areas. It simply requests filesystem to trim unused space. Filesystem has no way to know whether unused area had been trimmed on storage device or not. So it will always issue the same request every time you call trim. And even driver for block storage does not normally know it - it simply forwards request to trim to device itself and device does not reply how much data it actually trimmed. ext4 in this case cheats - it saves last trim result and so avoids calling into block device if it looks like nothing has changed.
Telcontar:~ # grep -i "discard\|trim" /var/log/messages <3.6> 2019-02-25 00:00:18 Telcontar fstrim 10518 - - /boot: 932 MiB (977321984 bytes) trimmed <3.6> 2019-02-25 00:00:18 Telcontar fstrim 10518 - - /other/ssd-test: 3.8 GiB (4092694528 bytes) trimmed <3.6> 2019-02-25 00:00:18 Telcontar fstrim 10518 - - /: 99.4 GiB (106738315264 bytes) trimmed <3.6> 2019-02-25 00:00:18 Telcontar systemd 1 - - Started Discard unused blocks. <3.6> 2019-02-27 12:23:32 Telcontar systemd 1 - - Stopped Discard unused blocks once a week. <3.6> 2019-02-27 12:26:09 Telcontar systemd 1 - - Started Discard unused blocks once a week.
-- Cheers / Saludos,
Carlos E. R. (from 15.0 x86_64 at Telcontar)
-- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org