Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] SSDs, ext4, fstrim, discard ...
Date: Tue, 11 Oct 2011 22:08:06
Message-Id: 20111011230541.436ea1a4@digimed.co.uk
In Reply to: [gentoo-user] SSDs, ext4, fstrim, discard ... by "Stefan G. Weichinger"
1 On Tue, 11 Oct 2011 22:56:31 +0200, Stefan G. Weichinger wrote:
2
3 >
4 > As mentioned in the systemd-posting I migrated back to an SSD today (on
5 > my main rig, the thinkpad uses an SSD happily for a long time now).
6 >
7 > A feature in a local magazine updated my knowledge of how to make use of
8 > the TRIM-command.
9 >
10 > It told me not to use the mount-option "discard" anymore, but run fstrim
11 > on the mountpoint frequently.
12 >
13 > OK, I learn ;-)
14 >
15 > But, AFAI understand, after trimming sectors/bytes on the
16 > filesystem/partition, they should be trimmed. I expect X bytes to be
17 > trimmed at first and if I repeat the command, I expect 0 (or something
18 > pretty low) bytes to be trimmed then, ok?
19 >
20 > This is what I wonder about:
21 >
22 > ~ # fstrim -v /
23 > /: 6195433472 bytes were trimmed
24 > ~ # fstrim -v /
25 > /: 6195433472 bytes were trimmed
26 > ~ # fstrim -v /
27 > /: 6195433472 bytes were trimmed
28 >
29 >
30 > I tested it with "discard" on and off.
31 >
32 > / is ext4, yes, and on an SSD, yup.
33 >
34 > Do I misunderstand things here?
35 >
36 > Thanks, Stefan
37 >
38
39 This seems in accordance with the fstrim man page:
40
41 "fstrim will report the same potential discard bytes each time, but only
42 sectors which had been written to between the discards would actually be
43 discarded by the storage device."
44
45 What is the benefit of running fstrim manually over mounting with discard?
46
47
48 --
49 Neil Bothwick
50
51 PCMCIA: People Can't Memorize Computer Industry Acronyms

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] SSDs, ext4, fstrim, discard ... "Stefan G. Weichinger" <lists@×××××.at>