From nobody Thu Jan 25 22:25:58 2024 X-Original-To: freebsd-current@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 4TLb575Nhzz589m0 for ; Thu, 25 Jan 2024 22:26:03 +0000 (UTC) (envelope-from robert@rrbrussell.com) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TLb5669n7z4fWm for ; Thu, 25 Jan 2024 22:26:02 +0000 (UTC) (envelope-from robert@rrbrussell.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rrbrussell.com header.s=fm2 header.b=LTnGM5o+; dkim=pass header.d=messagingengine.com header.s=fm3 header.b="u zYiWN+"; dmarc=pass (policy=quarantine) header.from=rrbrussell.com; spf=pass (mx1.freebsd.org: domain of robert@rrbrussell.com designates 66.111.4.29 as permitted sender) smtp.mailfrom=robert@rrbrussell.com Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C7E645C008B for ; Thu, 25 Jan 2024 17:26:01 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 25 Jan 2024 17:26:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rrbrussell.com; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1706221561; x=1706307961; bh=g6kY8uqMiIHMdtNnpZVArQwGT1gJrVy5qLlt1BlMM+k=; b= LTnGM5o+K8hsZ7J/kvmrHlICGZQberVLaC93s3lvHhzDx/plGBpvnaz4uTzdC3QE apWfl9JCQWqE3QjHPsKnQzLaBu5EAM/uKolcPB50hsASIJp6F/2bm/rkqQMaEoL7 Zmx2v9TzDm6BI5w6xqeKEZ22/d2nZ80+VUcM6UmX4AAYHRf+Lz+8xGE+hvIQvm81 od5ghCZ5/Ertx4JqiajqNGURJObS36TYLBn4g2eCV9bfL+6livmXimm4ECySF8Y2 NDC2tUN/oXtOZpncA1yWex366dWbEPSZbyEa8TF5AmGTQsAW2aghHf/LVfvzLsxZ Su9jo4K3Tq8AQjU2/vDA6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1706221561; x= 1706307961; bh=g6kY8uqMiIHMdtNnpZVArQwGT1gJrVy5qLlt1BlMM+k=; b=u zYiWN+W6z0NdnzW/7gsnwdEuKVuNoppMt4xKfWMNkgVbfKkglNn9v/RCK/B8Q9u1 yRdUF0kMuDzZ9WJOsH9ZslUDF4OBvtWPbCYko1Cx0BLMWELvSZ0MWMJfZbJiOD6D 62MhSGWDg7ZVvD9U9IOJfmrNFhTactc7X48rRIyK4E1eN9vOZYroCjhpwe9SQJa2 nOuIVOLyNjM81bUfFW+6LP/QCSUJivBaDkpfP3/WLz7IIs08Cb/JMqxGiRmY6KlT 7VNmsLIHR8QC1RDFIKoI7KzuS0ZGAGMC8ayFilEW8vZ1KOUGS471cKn1EeSHwwB3 wrB7by1EfRhv6IaRoDA/w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdelhedgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkjghfofggtgfgsehtje ertdertddvnecuhfhrohhmpedftfhosggvrhhtucftrdcutfhushhsvghllhdfuceorhho sggvrhhtsehrrhgsrhhushhsvghllhdrtghomheqnecuggftrfgrthhtvghrnhepieffke eugfettdeiueekgedvuddtlefhleehueelgfefkeeuffffheeigeevteeunecuffhomhgr ihhnpehfrhgvvggsshgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomheprhhosggvrhhtsehrrhgsrhhushhsvghllhdrtghomh X-ME-Proxy: Feedback-ID: ie421460a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 25 Jan 2024 17:26:01 -0500 (EST) Date: Thu, 25 Jan 2024 16:25:58 -0600 From: "Robert R. Russell" To: freebsd-current@freebsd.org Subject: Re: Removing fdisk and bsdlabel (legacy partition tools) Message-ID: <20240125162558.77a3cde7@venus.private.rrbrussell.com> In-Reply-To: References: X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: ----- X-Spamd-Result: default: False [-5.50 / 15.00]; DWL_DNSWL_LOW(-1.00)[messagingengine.com:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[rrbrussell.com,quarantine]; RWL_MAILSPIKE_EXCELLENT(-0.40)[66.111.4.29:from]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.29]; R_DKIM_ALLOW(-0.20)[rrbrussell.com:s=fm2,messagingengine.com:s=fm3]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.29:from]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[rrbrussell.com:+,messagingengine.com:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US]; ARC_NA(0.00)[]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[robert]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+] X-Rspamd-Queue-Id: 4TLb5669n7z4fWm On Wed, 24 Jan 2024 10:44:57 -0500 Ed Maste wrote: > MBR (PC BIOS) partition tables were historically maintained with > fdisk(8), but gpart(8) has long been the preferred method for working > with partition tables of all types. fdisk has been declared as > obsolete in the man page since 2015. Similarly BSD disklabels were > historically maintained with bsdlabel. It does not yet have a > deprecation notice - I have proposed a man page addition in > https://reviews.freebsd.org/D43563. > > I would like to disconnect these from the build, and subsequently > remove them. This is prompted by a recent bsdlabel bug report which > uncovered a longstanding buffer overflow in that tool. Effort is much > better focused on contemporary, maintained tools rather than > investigating issues in deprecated ones. Removing these tools would > happen in FreeBSD 15 only (no change in 14 or 13). > > Code review to disconnect fdisk: https://reviews.freebsd.org/D43575 > > Note that this effort is limited to these maintenance tools only - > there is no change to kernel or gpart support for MBR or BSD > disklablel partitioning. That said, MBR partitioning and BSD > disklabels are best considered legacy formats and should be avoided > for new installations, if possible. > > If anyone is using fdisk and/or bsdlabel rather than gpart I would > appreciate knowing what is preventing you from using the contemporary > tools. > FYI gpart doesn't allow you to create disklabel with more than 8 items either. robert@venus ~ 563$ doas mdconfig -l md0 robert@venus ~ 564$ doas mdconfig -lv md0 vnode 40M /usr/home/robert/test_disk.img robert@venus ~ 565$ doas gpart backup md0 MBR 4 1 freebsd 1 81919 robert@venus ~ 566$ doas gpart backup md0s1 BSD 8 1 freebsd-ufs 0 4096 2 freebsd-swap 4096 4096 4 freebsd-ufs 8192 4096 5 freebsd-ufs 12288 4096 6 freebsd-ufs 16384 4096 7 freebsd-ufs 20480 4096 8 freebsd-ufs 24576 4096 robert@venus ~ 567$ doas gpart add -t freebds-swap -s 2M md0s1 gpart: index '9': No space left on device robert@venus ~ 568$ doas gpart add -t freebds-swap -s 2M -i 9 md0s1 gpart: index '9': Invalid argument robert@venus ~ 569$ bsdlabel /dev/md0s1 bsdlabel: unable to get correct path for /dev/md0s1: Permission denied robert@venus ~ 570$ doas bsdlabel /dev/md0s1 # /dev/md0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 4096 0 4.2BSD 0 0 0 b: 4096 4096 swap c: 81919 0 unused 0 0 # "raw" part, don't edit d: 4096 8192 4.2BSD 0 0 0 e: 4096 12288 4.2BSD 0 0 0 f: 4096 16384 4.2BSD 0 0 0 g: 4096 20480 4.2BSD 0 0 0 h: 4096 24576 4.2BSD 0 0 0 robert@venus ~ 571$ I still need to get a netBSD VM running and create a test file with more than 8 partitions under a bsdlabel to see if gpart crashes.