From nobody Fri Feb 16 09:18:47 2024 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TbmZp2r4Bz5BLgr for ; Fri, 16 Feb 2024 09:18:58 +0000 (UTC) (envelope-from ordinarybit@proton.me) Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TbmZn6Mmvz41m5 for ; Fri, 16 Feb 2024 09:18:57 +0000 (UTC) (envelope-from ordinarybit@proton.me) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1708075134; x=1708334334; bh=qncEK/y41TSwaklunGySvNohHAQdbqgg44rIy4WKJj0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=XUPsivIETLCxC94rBzxJz2aPQ+TgDGoShceosHdxIWLq4ZZ0u4WyXxI+nWfCXHT6t jDk+/vXM524GQct18JI7u53vFhbdScLTz8Jh2kq1afNfwPbSwNcCKvkxO0/XJRcT1z 1NFQNwcGVtFj20olxaJr1SjjwQdMK0VjveWL9olSFAAQ1J4DEuPKaDy5MSr9H6VGeZ naJfY0iRlvcS4ZlQMdRIbbpOaGyg2w7Eh+Uv5x91BpKSZOm+oILR6v3aiWDcijITJI PtR/twRGO++bZOpTrCrysbCeIeomjxhmKYy8pdisLmYPVUx9SyHlyPNB+mUSHHlsgg Pg/VAuJ/bOv3w== Date: Fri, 16 Feb 2024 09:18:47 +0000 To: Mark Millard From: Ordinary Bit Cc: "freebsd-arm@freebsd.org" Subject: Re: newfs TRIM flag device support Message-ID: <7okx4eDPse2uF1n3aX4W8RIOdbHXziUhqgvHxqqxpYN-7NsJfEGrfHbDxLgNS3PdOwZt7j9aOXp-0MHDjQAryL4t1Gd2QHUG1sFNmd5dY0k=@proton.me> In-Reply-To: <8D8AA3F5-74A3-4AFE-A560-F52C7C55CF12@yahoo.com> References: <6AD380D4-9B42-4511-9E02-94EB0005D278@yahoo.com> <8D8AA3F5-74A3-4AFE-A560-F52C7C55CF12@yahoo.com> Feedback-ID: 100108111:user:proton List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4TbmZn6Mmvz41m5 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:62371, ipnet:185.70.43.0/24, country:CH] Sent with Proton Mail secure email. On Friday, 16 February 2024 at 14:02, Mark Millard wrot= e: > On Feb 15, 2024, at 20:08, Ordinary Bit ordinarybit@proton.me wrote: >=20 > > Hi! >=20 >=20 > Hello. >=20 > > On Friday, 16 February 2024 at 11:41, Mark Millard marklmi@yahoo.com wr= ote: > >=20 > > > [Only replying to lists I subscribe to.] > > >=20 > > > On Feb 15, 2024, at 19:19, Ordinary Bit ordinarybit@proton.me wrote: > > >=20 > > > > I'm reading the newfs manual https://man.freebsd.org/cgi/man.cgi?ne= wfs(8) to be able to know about the TRIM flag. In the manual under -t param= eter, it mentioned about "underlying device support", what exactly is this = device? > > >=20 > > > 2 contrasting examples: > > >=20 > > > Example 0: Optane NVMe media (PCIe card or U.2, for example) > > >=20 > > > Optane has no need of TRIM and, so, never supports TRIM. > > >=20 > > > Example 1: microsd card media usage > > >=20 > > > A microsd card in the normal type of microsd card slot on > > > Small Board Computers (normally) supports TRIM. Take the > > > same card and put it in a USB reader/writer and use it > > > via USB on the same system: no TRIM is supported by > > > FreeBSD over USB. > >=20 > > So you mean to say that if I have a Rasperry Pi 3 or 4 now and then hav= e my FreeBSD installed in a microSD card (for example, SanDisk Extreme card= ) with UFS/FFS filesytem in it with TRIM enabled parameter then is it going= to recognize it? How to verify? > >=20 > > > FYI: > > >=20 > > > When the file system has TRIM enabled, FreeBSD put out a > > > notice if TRIM will not actually be used in the actual > > > context in use. > >=20 > > Ok, got it. How to check this as well? >=20 >=20 > The console gets a message like: >=20 > WARNING: /mnt: TRIM flag on fs but disk does not support TRIM >=20 > when a mount is attempted (automatic or manually) for a > file system with the trim flag enabled but trim does not > end up active. >=20 > So, for example: >=20 > # dmesg -a | grep TRIM > WARNING: /mnt: TRIM flag on fs but disk does not support TRIM >=20 > (This was a microsd card in a USB reader/writer that was not > used as the boot media: a separate manual mount was used.) >=20 > The file system's TRIM flag status can be checked via use of > "tunefs -p . . .": >=20 > # tunefs -p /mnt > tunefs: POSIX.1e ACLs: (-a) disabled > tunefs: NFSv4 ACLs: (-N) disabled > tunefs: MAC multilabel: (-l) disabled > tunefs: soft updates: (-n) enabled > tunefs: soft update journaling: (-j) disabled > tunefs: gjournal: (-J) disabled > tunefs: trim: (-t) enabled > tunefs: maximum blocks per file in a cylinder group: (-e) 4096 > tunefs: average file size: (-f) 16384 > tunefs: average number of files in a directory: (-s) 64 > tunefs: minimum percentage of free space: (-m) 8% > tunefs: space to hold for metadata blocks: (-k) 6400 > tunefs: optimization preference: (-o) time > tunefs: volume label: (-L) >=20 > If the trim flag is enabled but the mount does not produce the > console message, then TRIM is active. >=20 Oh, that's amazing! I try it with my SanDisk Ultra microSDXC 64GB and mount= it in a USB reader and it shows enabled in the tunefs and is detected in t= he dmesg, the same as yours. Therefore, SanDisk Ultra microSD supports it! root@sd-extreme:~ # /sbin/newfs -U -t /dev/da0s2a /dev/da0s2a: 59000.9MB (120833920 sectors) block size 32768, fragment size = 4096 using 95 cylinder groups of 625.22MB, 20007 blks, 80128 inodes. with soft updates super-block backups (for fsck_ffs -b #) at: 192, 1280640, 2561088, 3841536, 5121984, 6402432, 7682880, 8963328, 102437= 76, 11524224, 12804672, 14085120, 15365568, 16646016, 17926464, 19206912, 20487360, 21767808, 23048256, 2432= 8704, 25609152, 26889600, 28170048, 29450496, 30730944, 32011392, 33291840, 34572288, 35852736, 37133184, 3841= 3632, 39694080, 40974528, 42254976, 43535424, 44815872, 46096320, 47376768, 48657216, 49937664, 51218112, 5249= 8560, 53779008, 55059456, 56339904, 57620352, 58900800, 60181248, 61461696, 62742144, 64022592, 65303040, 6658= 3488, 67863936, 69144384, 70424832, 71705280, 72985728, 74266176, 75546624, 76827072, 78107520, 79387968, 8066= 8416, 81948864, 83229312, 84509760, 85790208, 87070656, 88351104, 89631552, 90912000, 92192448, 93472896, 9475= 3344, 96033792, 97314240, 98594688, 99875136, 101155584, 102436032, 103716480, 104996928, 106277376, 107557824= , 108838272, 110118720, 111399168, 112679616, 113960064, 115240512, 116520960, 117801408, 119081856, 12036230= 4 root@sd-extreme:~ # dmesg | grep TRIM WARNING: /mnt: TRIM flag on fs but disk does not support TRIM root@sd-extreme:~ # tunefs -p /mnt tunefs: POSIX.1e ACLs: (-a) disabled tunefs: NFSv4 ACLs: (-N) disabled tunefs: MAC multilabel: (-l) disabled tunefs: soft updates: (-n) enabled tunefs: soft update journaling: (-j) disabled tunefs: gjournal: (-J) disabled tunefs: trim: (-t) enabled tunefs: maximum blocks per file in a cylinder group: (-e) 4096 tunefs: average file size: (-f) 16384 tunefs: average number of files in a directory: (-s) 64 tunefs: minimum percentage of free space: (-m) 8% tunefs: space to hold for metadata blocks: (-k) 6400 tunefs: optimization preference: (-o) time tunefs: volume label: (-L) I plan to have TRIM flag enabled in the rootfs partition (/dev/ufs/rootfs) = of my Raspberry Pi. Do you think of any implications when enabled? As shown= below, it is disabled. root@sd-extreme:~ # tunefs -p /dev/ufs/rootfs tunefs: POSIX.1e ACLs: (-a) disabled tunefs: NFSv4 ACLs: (-N) disabled tunefs: MAC multilabel: (-l) disabled tunefs: soft updates: (-n) enabled tunefs: soft update journaling: (-j) disabled tunefs: gjournal: (-J) disabled tunefs: trim: (-t) disabled tunefs: maximum blocks per file in a cylinder group: (-e) 4096 tunefs: average file size: (-f) 16384 tunefs: average number of files in a directory: (-s) 64 tunefs: minimum percentage of free space: (-m) 8% tunefs: space to hold for metadata blocks: (-k) 6400 tunefs: optimization preference: (-o) time tunefs: volume label: (-L) rootfs BR, orbit =20