TRIM and other maintenance tips for SSDs
TRIM and other maintenance tips for SSDs
Is TRIM available in our kernels/distros? Is it already set to run automatically in e.g. Fienix6 or MintPPC? If not, how can that be activated, or how to run it manually? For which filesystems can it be used?
Last edited by Roland on Wed Apr 19, 2023 3:20 pm, edited 1 time in total.
- Roland -
- caseycullen
- Posts: 528
- Joined: Sat Dec 17, 2016 7:12 am
- Location: Madison, WI USA
- Contact:
Re: TRIM for PPC Linux
The util-linux package includes fstrim. It is not set to run automatically. See Debian fstrim manpage for use instructions.Roland wrote: Sat Apr 08, 2023 2:37 pm Is TRIM available in our kernels/distros? Is it already set to run automatically in e.g. Fienix6 or MintPPC? If not, how can that be activated, or how to run it manually? For which filesystems can it be used?
-Casey
Re: TRIM for PPC Linux
Thank you! I tested fstrim with Fienix6, and it seems to work with EXT4 partitions, but with NTFS I got this error:caseycullen wrote: Sun Apr 09, 2023 10:10 pmThe util-linux package includes fstrim. It is not set to run automatically. See Debian fstrim manpage for use instructions.
Code: Select all
~$ sudo fstrim -v /media/roland/NTFS-disk
fstrim: /media/roland/NTFS-disk: the discard operation is not supported
- Roland -
- caseycullen
- Posts: 528
- Joined: Sat Dec 17, 2016 7:12 am
- Location: Madison, WI USA
- Contact:
Re: TRIM for PPC Linux
Do you have the drive connected via USB or SATA? If it's via USB, the chipset of your adapter/enclosure may not support trim.Roland wrote: Mon Apr 10, 2023 11:02 amThank you! I tested fstrim with Fienix6, and it seems to work with EXT4 partitions, but with NTFS I got this error:caseycullen wrote: Sun Apr 09, 2023 10:10 pmThe util-linux package includes fstrim. It is not set to run automatically. See Debian fstrim manpage for use instructions.
Iny idea how to get it to work with NTFS? I read from different sources that NTFS-3G should nowadays work with TRIM.Code: Select all
~$ sudo fstrim -v /media/roland/NTFS-disk fstrim: /media/roland/NTFS-disk: the discard operation is not supported
Re: TRIM for PPC Linux
It's connected via Sata. And both the NTFS and EXT4 partitions I tested were on the same disk. Does TRIM work for you with NTFS?caseycullen wrote: Mon Apr 10, 2023 5:52 pmDo you have the drive connected via USB or SATA? If it's via USB, the chipset of your adapter/enclosure may not support trim.
- Roland -
- caseycullen
- Posts: 528
- Joined: Sat Dec 17, 2016 7:12 am
- Location: Madison, WI USA
- Contact:
Re: TRIM for PPC Linux
I don't have any NTFS partitions. I think I have a spare SSD around here so I'll do a test.Roland wrote: Mon Apr 10, 2023 8:11 pmIt's connected via Sata. And both the NTFS and EXT4 partitions I tested were on the same disk. Does TRIM work for you with NTFS?caseycullen wrote: Mon Apr 10, 2023 5:52 pmDo you have the drive connected via USB or SATA? If it's via USB, the chipset of your adapter/enclosure may not support trim.
Re: TRIM for PPC Linux
Have you been able to to test it yet...?caseycullen wrote: Mon Apr 10, 2023 9:54 pm I don't have any NTFS partitions. I think I have a spare SSD around here so I'll do a test.
There seems to be two variants of NTFS. The 'legacy' one in kernel, and NTFS-3G which is available as a separate package.
It seems that the legacy one supports only continuous TRIM, whereas NTFS-3G only peridic TRIM (https://wiki.archlinux.org/title/Solid_state_drive).
How can you define which one is used? Is there in the kernel some option for that? For 'fstrim' to work you obviously need the NTFS-3G, which is preinstalled in Fienix.
BTW, I tested with Ubuntu 20 that the fstrim indeed works with NTFS. Both fstrim and ntfs-3g were older versions than in Fienix6, so it should definitely work in Fienix, too.
- Roland -
Re: TRIM for PPC Linux
Roland,
Does the kernel NTFS driver work?
Thanks,
Christian
Does the kernel NTFS driver work?
Thanks,
Christian
xeno74 wrote: Sat Sep 18, 2021 3:22 pm FYI because of the issues with the new NTFS3 driver by Paragon Software:
Link to the thread: [Linux PPC] Issues with NTFS read-write driver (GPL implementation by Paragon Software)I wrote: Hello Konstantin,
Is the new driver compatible with big endian systems? (byte order)
If I format a partition with NTFS [1], then I can mount it afterwards with the new NTFS driver. I can also create a file and access it with an editor. But I can’t list the files on this partition because the new driver can’t read the hidden ”.” file. After a umount of this partition, it isn't possible
to mount it again. [2]
Please find attached the kernel config.
Further information: viewtopic.php?f=58&t=4713&start=50
Thanks,
Christian
[1] sudo mkfs -t ntfs /dev/sdc3
[2] wrong fs type, bad option, bad superblock on /dev/sdc3, missing codepage or helper program ...
Re: TRIM for PPC Linux
I have not tested. How to do it? Is it enough to add to fstab a line like:
Code: Select all
LABEL=NTFS-disk /media/NTFS-disk ntfs rw,user,nofail,noatime,discard,exec,uid=1001 0 2
- Roland -
Re: TRIM for PPC Linux
Please don't test it if you have important files on the NTFS partition. I don't know if the bug still exists.Roland wrote: Fri Apr 14, 2023 11:15 amI have not tested. How to do it? Is it enough to add to fstab a line like:
But how to verify it is really working?Code: Select all
LABEL=NTFS-disk /media/NTFS-disk ntfs rw,user,nofail,noatime,discard,exec,uid=1001 0 2
If you want to test it then use a new NTFS test partition.I wrote: If I format a partition with NTFS [1], then I can mount it afterwards with the new NTFS driver. I can also create a file and access it with an editor. But I can’t list the files on this partition because the new driver can’t read the hidden ”.” file. After a umount of this partition, it isn't possible
to mount it again. [2]