Re: newfs TRIM flag device support

Ordinary Bit <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm,gmane.os.freebsd.questions
Message-ID <QdqhPPsokYgWvtN_ezjbgy4YhQzHAcq5_jr8lx03GPATcnWul3IIy8B-CtCF510PAb22SJQW99colM0pr4Q8pCXLgGyF1NXm7xzL3i6WoE8=@proton.me>
On Friday, 16 February 2024 at 12:33, Kevin Oberman <[email protected]> wrote:

> On Thu, Feb 15, 2024 at 7:19 PM Ordinary Bit <[email protected]> wrote:
>
>> Hi,
>>
>> I'm reading the newfs manual https://man.freebsd.org/cgi/man.cgi?newfs(8) to be able to know about the TRIM flag. In the manual under -t parameter, it mentioned about "underlying device support", what exactly is this device? Is it the host (for example, Raspberry Pi SD/eMMC host reader) or the SD/eMMC card (controller) or both?
>>
>> -t
>>
>> Turn  on	the TRIM enable	flag.  If enabled, and if the underly-
>>	ing device supports the BIO_DELETE  command,  the  file	system
>>	will  send  a  delete request to	the underlying device for each
>>	freed block.  The trim enable flag is typically set for	flash-
>>	memory devices to reduce	write amplification which reduces wear
>>	on write-limited	flash-memory and often improves	long-term per-
>>	formance.   Thinly provisioned storage also benefits by return-
>>	ing unused blocks to the	global pool.
>>
>> BR,
>>
>> orbit

Hi!

> TRIM is for SSDs. It is tied to the drive, but the controller or system. I think Linux enables it automatically, but I'm not sure. In the context of the description above, the drive is the device.

Thanks for sharing! I checked here https://en.wikipedia.org/wiki/Trim_(computing)#SD/MMC which says that there is a similar functionality of ATA TRIM to MMC and SD which is the ERASE (CMD38), this make me curious about TRIM support available in the UFS/FFS. I have tried a while ago enabling TRIM in my SanDisk Ultra microSDXC 64GB and when mounted, it shows enabled in the tunefs. However, I am still thinking if it works when TRIM is enabled in the rootfs and used it as my boot media in the Raspberry Pi microSD card slot. Anyway, this is worth a try.

BR,
orbit

> --
>
> Kevin Oberman, Part time kid herder and retired Network Engineer
> E-mail: [email protected]
> PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.