1 |
On 04/26 03:26, Alan Mackenzie wrote: |
2 |
> Hello, Gentoo. |
3 |
> |
4 |
> Seeing that I've had my "new" box for three years, now, I'm thinking |
5 |
> it's about time to run fstrim. But how? |
6 |
> |
7 |
> I've got a pair of NVMe drives in a RAID 1 configuration. On the main |
8 |
> partition, /dev/md126, I've got several LVM2 things. In the volume |
9 |
> group(s?) I've got things like /dev/mapper/vg-home mounted on /home. |
10 |
> Most of my partitions are ext4. |
11 |
> |
12 |
> When I try things like |
13 |
> |
14 |
> # fstrim --dry-run /home |
15 |
> |
16 |
> , I get the response: |
17 |
> |
18 |
> /home: 0 B (dry run) trimmed |
19 |
> |
20 |
> . What does this mean, in particular the "0 B" bit? Does it mean that |
21 |
> if I let it rip, it would trim 0 Bytes? |
22 |
> |
23 |
> Will I do any damage if I let it go ahead (without the --dry-run)? Will |
24 |
> this actually do any good? Will fstrim work together with LVM volumes? |
25 |
> |
26 |
> Thanks for any help! |
27 |
> |
28 |
> -- |
29 |
> Alan Mackenzie (Nuremberg, Germany). |
30 |
> |
31 |
|
32 |
Hi Alan, |
33 |
|
34 |
NOW I am no longer feel alone with all my fstrim/SSD related |
35 |
questions! :) |
36 |
|
37 |
I exactly fall over this before. |
38 |
|
39 |
It looks like fstrim would take its "dry run" really seriously |
40 |
and does NOTHING - it even does not communicate with the SSD. |
41 |
Therefore there is no responds from the SSD how much has been |
42 |
trimmed...or "0 bytes" in other words. |
43 |
|
44 |
If you start it with no "dry run", it will send the the SSD |
45 |
informations, what parts, which still keep data, can be freed, |
46 |
because this data is no longer linked to anything. |
47 |
|
48 |
Fstrimming "does harm" ;) in the first place. It will cause |
49 |
some kind of writing, which is -- in the purest sense of |
50 |
the word -- "bad" to the SSD. |
51 |
|
52 |
But fstrimming is good for the SSD in the more global context, since |
53 |
all freed blocks now are available for wear leveling to the SSD |
54 |
controller again. |
55 |
|
56 |
I cannot say anything in the context of LVM, since I |
57 |
don't use it. |
58 |
|
59 |
But I don't *think* (read: don't know for sure), that |
60 |
it would harm, since you are dealing with data, which |
61 |
already has been flagged for "can be overwritte" by |
62 |
the filesystem. |
63 |
|
64 |
Since the SSD controller handles chunks of data one |
65 |
level lower (the controller does not know anything |
66 |
about filesystems), fstrim tells it, which data |
67 |
can be overwritten from the filesystems point |
68 |
of view. |
69 |
|
70 |
BUT: Any undelete operation is made impossible |
71 |
after a fstrim. |
72 |
|
73 |
Some inside view to the status of the ssd can be taken |
74 |
by this command: |
75 |
|
76 |
sudo smartctl -a <your ssd device here> |
77 |
|
78 |
This command only reads from the SSD. |
79 |
|
80 |
Cheers! |
81 |
Meino |