Re: newfs TRIM flag device support

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Fri, 16 Feb 2024 04:33:03 UTC
On Thu, Feb 15, 2024 at 7:19 PM Ordinary Bit <ordinarybit@proton.me> 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
>
>
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.
-- 
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683