From nobody Sun Feb 18 11:46:38 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 4Td3mV0VD9z53yXc for ; Sun, 18 Feb 2024 11:46:50 +0000 (UTC) (envelope-from ordinarybit@proton.me) Received: from mail-40132.protonmail.ch (mail-40132.protonmail.ch [185.70.40.132]) (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 4Td3mT52DLz4V9f for ; Sun, 18 Feb 2024 11:46:49 +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=1708256807; x=1708516007; bh=K5I5zYU9ZsEhzuXLMBuKSq2bXj0t41vPi2n9/dRShjQ=; 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=GBTuDv7yPhLUr8iSKvA7pYZRSToAOaD1LdRg/Dr9f+rTn9mE5PmQWC7BwzU4SaNdH VJC5oDuQBoSia20nQ4e6eymg3j4gkswPRMWMa/R8kYLjxFtwzSPNHATTGsWVoPzgRO Bg8jNQoEBNSUKIWLibMEfK95a/KI3pw/7ZALNUdTL/UT6zvy7eM2F6k8pUi+cP1xNs 0vydTIu17jmc4mZZTDuomebZmFZVb9fEEe2qWZNfKyLBoqWU/GuORySklQO7hLvn9l EHiqArI5RR0g/hA2i8EPkgjKv3mYn6+sDRMZQoOLYAgg735OJMNRBC0jWRTBwcx4SY G/Kglk0vAULNg== Date: Sun, 18 Feb 2024 11:46:38 +0000 To: Ordinary Bit From: Ordinary Bit Cc: Mark Millard , Mike Karels , Ronald Klop , freebsd-arm Subject: Re: newfs TRIM flag device support Message-ID: In-Reply-To: References: <59693EE7-0DD6-4B41-BA64-0F3D69D3ECC9@yahoo.com> <1B0C2E27-6776-40A1-A8BF-29094FF8FC03@yahoo.com> <9F657059-E39A-4E2A-8AF5-CA491BBC7ABB@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: 4Td3mT52DLz4V9f 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.40.0/24, country:CH] Sent with Proton Mail secure email. On Sunday, 18 February 2024 at 19:09, Ordinary Bit = wrote: > On Sunday, 18 February 2024 at 03:04, Mark Millard marklmi@yahoo.com wrot= e: >=20 > > On Feb 17, 2024, at 08:44, Mike Karels mike@karels.net wrote: > >=20 > > > On 17 Feb 2024, at 10:21, Ordinary Bit wrote: > > >=20 > > > > On Saturday, 17 February 2024 at 23:20, Mark Millard marklmi@yahoo.= com wrote: > > > >=20 > > > > > On Feb 17, 2024, at 02:39, Ordinary Bit ordinarybit@proton.me wro= te: > > > > > . . . > > > > >=20 > > > > > > root@sd-ultra:~ # gpart show -p > > > > > > =3D> 63 124735425 mmcsd0 MBR (59G) > > > > > > 63 1985 - free - (993K) > > > > > > 2048 102400 mmcsd0s1 fat32lba [active] (50M) > > > > > > 104448 10381312 mmcsd0s2 freebsd (5.0G) > > > > > > 10485760 16777216 mmcsd0s3 freebsd (8.0G) > > > > >=20 > > > > > An oddity just above is that mmcsd0s3 is not set to the > > > > > type freebsd-ufs . But the oddity does not mess up the > > > > > testing you were doing. > > > >=20 > > > > Let me test this one with freebsd-ufs type because you're right it'= s only freebsd. > > >=20 > > > freebsd-ufs is a GPT type; this is MBR. The ufs filesystem is presuma= bly mmcsd0s3a. > > > If the filesystem gets mounted, the partitioning is OK. > > >=20 > > > Mike > > >=20 > > > > > > 27262976 97472512 - free - (46G) > > > > > >=20 > > > > > > =3D> 0 10381312 mmcsd0s2 BSD (5.0G) > > > > > > 0 128 - free - (64K) > > > > > > 128 10381184 mmcsd0s2a freebsd-ufs (4.9G) > > > > > > . . . > >=20 > > My splitting of the gpart output at the line I was interested in > > may have left some confusion. So I'll quote the original full > > output. I was not very explicit about the details of the oddities > > involved before but will be so below. > >=20 > > QUOTE > > root@sd-ultra:~ # gpart show -p > > =3D> 63 124735425 mmcsd0 MBR (59G) > >=20 > > 63 1985 - free - (993K) > > 2048 102400 mmcsd0s1 fat32lba [active] (50M) > > 104448 10381312 mmcsd0s2 freebsd (5.0G) > > 10485760 16777216 mmcsd0s3 freebsd (8.0G) > > 27262976 97472512 - free - (46G) > >=20 > > =3D> 0 10381312 mmcsd0s2 BSD (5.0G) > >=20 > > 0 128 - free - (64K) > > 128 10381184 mmcsd0s2a freebsd-ufs (4.9G) > > END QUOTE > >=20 > > First note that mmcsd0s2a says freebsd-ufs (but is > > inside a BSD). That is what I consider normal for MBR > > partitions that contain UFS file systems. > >=20 > > Next note that there was no "mmcsd0s3 BSD" shown. > > Nor was there a "mmcsd0s3a freebsd-ufs" shown. > > "mmcsd0s3 freebsd" shows no evidence of any MBR/BSD > > substructure. (But it was mountable as a UFS file > > system after the newfs that was done on mmcsd0s3 .) > >=20 > > None of this messed up the testing that was being > > done. >=20 >=20 > Basically what I did after creating the mmcsd0s3 partition, I format it r= ight away with newfs. So I re-created the setup to clear things out. This t= ime having mmcsd0s3 partition and mmcsd0s3a in freebsd-ufs type. You can se= e below sequences of procedures. I deleted the existing mmcsd0s3 partition = first and then create a new one in the same 8GB size. >=20 > root@sd-ultra:~ # /sbin/gpart delete -i 3 mmcsd0 > mmcsd0s3 deleted > root@sd-ultra:~ # /sbin/gpart show -p > =3D> 63 124735425 mmcsd0 MBR (59G) >=20 > 63 1985 - free - (993K) > 2048 102400 mmcsd0s1 fat32lba [active] (50M) > 104448 10381312 mmcsd0s2 freebsd (5.0G) > 10485760 114249728 - free - (54G) >=20 > =3D> 0 10381312 mmcsd0s2 BSD (5.0G) >=20 > 0 128 - free - (64K) > 128 10381184 mmcsd0s2a freebsd-ufs (4.9G) >=20 > root@sd-ultra:~ # /sbin/gpart add -t freebsd -s 8G mmcsd0 > mmcsd0s3 added > root@sd-ultra:~ # /sbin/gpart show -p > =3D> 63 124735425 mmcsd0 MBR (59G) >=20 > 63 1985 - free - (993K) > 2048 102400 mmcsd0s1 fat32lba [active] (50M) > 104448 10381312 mmcsd0s2 freebsd (5.0G) > 10485760 16777216 mmcsd0s3 freebsd (8.0G) > 27262976 97472512 - free - (46G) >=20 > =3D> 0 10381312 mmcsd0s2 BSD (5.0G) >=20 > 0 128 - free - (64K) > 128 10381184 mmcsd0s2a freebsd-ufs (4.9G) >=20 > =3D> 0 16777216 mmcsd0s3 BSD (8.0G) >=20 > 0 16777216 mmcsd0s3a freebsd-ufs (8.0G) >=20 > =3D> 0 16777216 ufsid/65c95062ec444331 BSD (8.0G) >=20 > 0 16777216 ufsid/65c95062ec444331a freebsd-ufs (8.0G) > root@sd-ultra:~ # > root@sd-ultra:~ # /sbin/newfs -U -t /dev/mmcsd0s3a > /dev/mmcsd0s3a: 8192.0MB (16777216 sectors) block size 32768, fragment si= ze 4096 > using 14 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, 10243= 776, 11524224, 12804672, 14085120, > 15365568, 16646016 > root@sd-ultra:~ # > root@sd-ultra:~ # /sbin/gpart show -p > =3D> 63 124735425 mmcsd0 MBR (59G) >=20 > 63 1985 - free - (993K) > 2048 102400 mmcsd0s1 fat32lba [active] (50M) > 104448 10381312 mmcsd0s2 freebsd (5.0G) > 10485760 16777216 mmcsd0s3 freebsd (8.0G) > 27262976 97472512 - free - (46G) >=20 > =3D> 0 10381312 mmcsd0s2 BSD (5.0G) >=20 > 0 128 - free - (64K) > 128 10381184 mmcsd0s2a freebsd-ufs (4.9G) >=20 > =3D> 0 16777216 mmcsd0s3 BSD (8.0G) >=20 > 0 16777216 mmcsd0s3a freebsd-ufs (8.0G) >=20 > =3D> 0 16777216 ufsid/65c93f4a5cb247cf BSD (8.0G) >=20 > 0 16777216 ufsid/65c93f4a5cb247cfa freebsd-ufs (8.0G) > root@sd-ultra:~ # > root@sd-ultra:~ # mount /dev/mmcsd0s3a /mnt > root@sd-ultra:~ # > root@sd-ultra:~ # /sbin/gpart show -p > =3D> 63 124735425 mmcsd0 MBR (59G) >=20 > 63 1985 - free - (993K) > 2048 102400 mmcsd0s1 fat32lba [active] (50M) > 104448 10381312 mmcsd0s2 freebsd (5.0G) > 10485760 16777216 mmcsd0s3 freebsd (8.0G) > 27262976 97472512 - free - (46G) >=20 > =3D> 0 10381312 mmcsd0s2 BSD (5.0G) >=20 > 0 128 - free - (64K) > 128 10381184 mmcsd0s2a freebsd-ufs (4.9G) >=20 > =3D> 0 16777216 mmcsd0s3 BSD (8.0G) >=20 > 0 16777216 mmcsd0s3a freebsd-ufs (8.0G) >=20 > root@sd-ultra:~ # cp /home/freebsd/file01 /mnt/file01 > root@sd-ultra:~ # cd /mnt > root@sd-ultra:/mnt # > root@sd-ultra:/mnt # ls -lah > total 1421036 > drwxr-xr-x 3 root wheel 512B Feb 11 21:44 . > drwxr-xr-x 21 root wheel 512B Feb 11 20:04 .. > drwxrwxr-x 2 root operator 512B Feb 11 21:42 .snap > -rw-r--r-- 1 root wheel 1.4G Feb 11 21:47 file01 > root@sd-ultra:/mnt # > root@sd-ultra:/mnt # cp file01 file02 > root@sd-ultra:/mnt # ls -lah > total 2842060 > drwxr-xr-x 3 root wheel 512B Feb 11 22:01 . > drwxr-xr-x 21 root wheel 512B Feb 11 20:04 .. > drwxrwxr-x 2 root operator 512B Feb 11 21:42 .snap > -rw-r--r-- 1 root wheel 1.4G Feb 11 21:47 file01 > -rw-r--r-- 1 root wheel 1.4G Feb 11 22:03 file02 > root@sd-ultra:/mnt # > root@sd-ultra:/mnt # rm * > root@sd-ultra:/mnt # > root@sd-ultra:/mnt # gstat -d > dT: 1.003s w: 1.000s > L(q) ops/s r/s kBps ms/r w/s kBps ms/w d/s kBps ms/d %busy Name > 15 327 15 479 31.0 1 32 7.6 311 1242254 30.9 53.1| mmcsd0 > 0 0 0 0 0.0 0 0 0.0 0 0 0.0 0.0| mmcsd0s1 > 0 0 0 0 0.0 0 0 0.0 0 0 0.0 0.0| mmcsd0s2 > 5 33 15 479 31.0 1 32 7.6 17 1176886 53.3 50.9| mmcsd0s3 > 0 0 0 0 0.0 0 0 0.0 0 0 0.0 0.0| msdosfs/EFI > 0 0 0 0 0.0 0 0 0.0 0 0 0.0 0.0| mmcsd0s2a > 5 33 15 479 31.0 1 32 7.6 17 1176886 53.3 50.9| mmcsd0s3a > 0 0 0 0 0.0 0 0 0.0 0 0 0.0 0.0| ufs/rootfs >=20 > The TRIM activity were observed the same as previous but having the mmcsd= 0s3a along with mmcsd0s3 and mmcsd0. >=20 > BR, > orbit Oh I see, with tunefs it's also possible to enable/disable TRIM flag. I jus= t tried out the rootfs partition (/dev/da0s2a) enabled and it did.=20 root@sd-ultra:~ # /sbin/tunefs -t enable /dev/da0s2a tunefs: issue TRIM to the disk set Thanks for this great tool! BR, orbit =20 >