TRIM and other maintenance tips for SSDs

AmigaOne X5000 platform specific issues related to Linux only.
Roland
Posts: 873
Joined: Tue May 02, 2017 8:23 am

TRIM and other maintenance tips for SSDs

Post by Roland »

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 -
User avatar
caseycullen
Posts: 528
Joined: Sat Dec 17, 2016 7:12 am
Location: Madison, WI USA
Contact:

Re: TRIM for PPC Linux

Post by caseycullen »

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?
The util-linux package includes fstrim. It is not set to run automatically. See Debian fstrim manpage for use instructions.
-Casey
Roland
Posts: 873
Joined: Tue May 02, 2017 8:23 am

Re: TRIM for PPC Linux

Post by Roland »

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.
Thank you! I tested fstrim with Fienix6, and it seems to work with EXT4 partitions, but with NTFS I got this error:

Code: Select all

~$ sudo fstrim -v /media/roland/NTFS-disk   
fstrim: /media/roland/NTFS-disk: the discard operation is not supported
Iny idea how to get it to work with NTFS? I read from different sources that NTFS-3G should nowadays work with TRIM.
- Roland -
User avatar
caseycullen
Posts: 528
Joined: Sat Dec 17, 2016 7:12 am
Location: Madison, WI USA
Contact:

Re: TRIM for PPC Linux

Post by caseycullen »

Roland wrote: Mon Apr 10, 2023 11:02 am
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.
Thank you! I tested fstrim with Fienix6, and it seems to work with EXT4 partitions, but with NTFS I got this error:

Code: Select all

~$ sudo fstrim -v /media/roland/NTFS-disk   
fstrim: /media/roland/NTFS-disk: the discard operation is not supported
Iny idea how to get it to work with NTFS? I read from different sources that NTFS-3G should nowadays work with TRIM.
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
Posts: 873
Joined: Tue May 02, 2017 8:23 am

Re: TRIM for PPC Linux

Post by Roland »

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.
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?
- Roland -
User avatar
caseycullen
Posts: 528
Joined: Sat Dec 17, 2016 7:12 am
Location: Madison, WI USA
Contact:

Re: TRIM for PPC Linux

Post by caseycullen »

Roland wrote: Mon Apr 10, 2023 8:11 pm
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.
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?
I don't have any NTFS partitions. I think I have a spare SSD around here so I'll do a test.
Roland
Posts: 873
Joined: Tue May 02, 2017 8:23 am

Re: TRIM for PPC Linux

Post by Roland »

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.
Have you been able to to test it yet...?

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 -
User avatar
xeno74
Posts: 10712
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: TRIM for PPC Linux

Post by xeno74 »

Roland,

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:
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 ...
Link to the thread: [Linux PPC] Issues with NTFS read-write driver (GPL implementation by Paragon Software)
Roland
Posts: 873
Joined: Tue May 02, 2017 8:23 am

Re: TRIM for PPC Linux

Post by Roland »

xeno74 wrote: Fri Apr 14, 2023 10:30 am Does the kernel NTFS driver work?
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
But how to verify it is really working?
- Roland -
User avatar
xeno74
Posts: 10712
Joined: Fri Mar 23, 2012 7:58 am
Contact:

Re: TRIM for PPC Linux

Post by xeno74 »

Roland wrote: Fri Apr 14, 2023 11:15 am
xeno74 wrote: Fri Apr 14, 2023 10:30 am Does the kernel NTFS driver work?
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
But how to verify it is really working?
Please don't test it if you have important files on the NTFS partition. I don't know if the bug still exists.
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]
If you want to test it then use a new NTFS test partition.
Post Reply