Solved TRIM won't enable

I am trying to enable TRIM in single usermode via

tunefs -t enable /dev/ada0p2

But when I reboot and check via

tunefs -p /dev/ada0p2

I can see that TRIM is still disabled.

How can I fix this?
 
Are you setting that with the partition already mounted? That should be done with the partition un-mounted, like booting in single user mode.
 
In single user mode nothing is mounted by default.
Isn't root file system mounted on / as read-only? otherwise how would one be supposed to reach the login shell?
Likewise tunefs(8) explicitly states:
To change an active file system, it must be downgraded to read-only or unmounted.


I did try it in single user mode.
Does that automaticly unmount it?
As I was suggesting to Le Baronne, I'm pretty sure it's mounted as read-only, but you can grant write permission by mount -u - o rw / , which is quite useful to edit configuration files you messed up with, in case you did.
I just get unable to write superblock on p1 and p3, it succeeded on p2 and then messed up those partitions.

I really hope you were able to sort this out without having to reinstall the system from scratch. Anyway are you sure your SSD supports trim? You can quickly check this up using camcontrol(8), like with doas camcontrol identify /dev/ada0.

Very good info about dealing with SSDs is provided by wblock's how-to,practically I only relied on this when I installed FreeBSD on a M.2

EDIT: Also, thinking about that fact of TRIM being enabled on 2nd partition only (kinda odd), given you're using a new SSD, I also expect you're on UEFI. In that case, if p2 is your root partition, wouldn't be p1 an EFI partition? EFI partitions are FAT32 formatted and are not being tuned by tunefs
Similarly, p3 is an /home or /var UFS partition, or is rather your swap?
 
/ will be mounted read-only in single user mode.
After the tunefs -t enable /dev/ada0p2 command it is importand you type reboot!
If you type exit in the single-user shell, the system will boot into multiuser and the trim flag will be set back to it's original state as disabled.
 
/ will be mounted read-only in single user mode.
After the tunefs -t enable /dev/ada0p2 command it is importand you type reboot!
If you type exit in the single-user shell, the system will boot into multiuser and the trim flag will be set back to it's original state as disabled.
Ah, I see now.

Thanks.
 
Back
Top