From unknown Sun Aug 10 16:48:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#36853 <36853@debbugs.gnu.org> To: bug#36853 <36853@debbugs.gnu.org> Subject: Status: mklabel does not clear mdraid version 0.90 metadata Reply-To: bug#36853 <36853@debbugs.gnu.org> Date: Sun, 10 Aug 2025 23:48:49 +0000 retitle 36853 mklabel does not clear mdraid version 0.90 metadata reassign 36853 parted submitter 36853 Michael Hudson-Doyle severity 36853 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 30 05:36:36 2019 Received: (at submit) by debbugs.gnu.org; 30 Jul 2019 09:36:36 +0000 Received: from localhost ([127.0.0.1]:49538 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsOYd-0006QM-OV for submit@debbugs.gnu.org; Tue, 30 Jul 2019 05:36:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:50021) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsOIh-00061S-DM for submit@debbugs.gnu.org; Tue, 30 Jul 2019 05:20:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60478) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsOIg-00072o-1i for bug-parted@gnu.org; Tue, 30 Jul 2019 05:20:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_50,HTML_MESSAGE, RCVD_IN_DNSWL_HI,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsOIe-0007Ut-N6 for bug-parted@gnu.org; Tue, 30 Jul 2019 05:20:05 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44727) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hsOIe-0007UQ-DV for bug-parted@gnu.org; Tue, 30 Jul 2019 05:20:04 -0400 Received: from mail-io1-f70.google.com ([209.85.166.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1hsOIc-0007zq-Hc for bug-parted@gnu.org; Tue, 30 Jul 2019 09:20:02 +0000 Received: by mail-io1-f70.google.com with SMTP id n8so70679846ioo.21 for ; Tue, 30 Jul 2019 02:20:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QrtnCyDyU9YvAiKUze13QQPFUsF9y4RXDcSmLBvYWQ8=; b=GSgZ6H6FmeRhgazvbneR915UczYlBEEKtgfNpmoopALBlRlf7rO5WSdEDgKXFlUPs6 jES8OzTnRoH8S1euZXxf3YkXa/FCsQ5sRSYLoOZfXYZGHdPN22Okev1qglzXpmX5OTIm rAJyEi7ERNJNv+sm9rRrh0lB6COTFW3LoBp0ibz42ogG/txpJk3nsW6lomG3eLqZv6nM /ann4ZNlapNh8l3foTLmnL54wRFC4k+CwcnIIrNHtdXgrArplPmrjmc77KNbTmA1z7ET uAh69whPQi7Eix0c497Si4ZQFrQLpYStH3Q7SuSNz3zJapN2c1CFL2fSP5D3N/I62ph1 ckDQ== X-Gm-Message-State: APjAAAVFhiNBSshD4avA06zBTJAYvXr0Utb09Yul5R/lBCaqAQJ4Qokx mCoqDWzGJ1/z75yx0HzGSJ84/p55O4Uev6pn60mTj98F5EZtpbR6pyjWf5tjydfqh1X6crsplVk PZv3iImAJI+U6Ibjb6/m/Dbw3VYQ8KJyMSBg1VkWyjCw2 X-Received: by 2002:a6b:c98c:: with SMTP id z134mr66646120iof.276.1564478401339; Tue, 30 Jul 2019 02:20:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBfVNY1Rj4nqg1RXxpM2hpdcz3j7M31L3VsMIXfyjBeauf3Mn9WH3bNm+cBKJK77JyWhNlZ8LEWHuFy5iTrA8= X-Received: by 2002:a6b:c98c:: with SMTP id z134mr66646098iof.276.1564478400959; Tue, 30 Jul 2019 02:20:00 -0700 (PDT) MIME-Version: 1.0 From: Michael Hudson-Doyle Date: Tue, 30 Jul 2019 21:19:49 +1200 Message-ID: Subject: mklabel does not clear mdraid version 0.90 metadata To: bug-parted@gnu.org Content-Type: multipart/alternative; boundary="0000000000005930fb058ee2836e" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 91.189.89.112 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 30 Jul 2019 05:36:34 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --0000000000005930fb058ee2836e Content-Type: text/plain; charset="UTF-8" Chasing down a bug report https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1828558 where installing over a device previously used in a RAID array, I found that parted's mklabel does not erase mdraid metadata 0.90 metadata (and only that version). Here's my test script #!/bin/bash set -xeu parted --version rm -f image.img truncate -s 1G image.img n=$(uuidgen | cut -d- -f1) dev="$(losetup -Pf --show image.img)" mdadm --create --metadata 0.90 --force --level 1 -n 1 --assume-clean /dev/md/$n $dev mdadm --stop /dev/md/$n losetup -d $dev parted --script --align optimal image.img -- mklabel msdos wipefs image.img and here's the output on my system: + parted --version parted (GNU parted) 3.2 Copyright (C) 2014 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by < http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS>. + rm -f image.img + truncate -s 1G image.img ++ uuidgen ++ cut -d- -f1 + n=e0c43267 ++ losetup -Pf --show image.img + dev=/dev/loop44 + mdadm --create --metadata 0.90 --force --level 1 -n 1 --assume-clean /dev/md/e0c43267 /dev/loop44 mdadm: array /dev/md/e0c43267 started. + mdadm --stop /dev/md/e0c43267 mdadm: stopped /dev/md/e0c43267 + losetup -d /dev/loop44 + parted --script --align optimal image.img -- mklabel msdos + wipefs image.img DEVICE OFFSET TYPE UUID LABEL image.img 0x3fff0000 linux_raid_member 6dbbfe69-809c-7a77-14d5-894fb9296617 image.img 0x1fe dos Looking at ped_disk_clobber none of this is surprising: the 0.90 metadata is somewhere between 127 and 64 kiB from the end of the device and this isn't touched. If this is indeed deemed a bug it could be pragmatically fixed by wiping more from the end of the disk or more cleverly by using libblkid to locate and zap all superblocks. Cheers, mwh --0000000000005930fb058ee2836e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Chasing down a bug report=C2=A0https://bugs.launchpa= d.net/ubuntu/+source/ubiquity/+bug/1828558=C2=A0where installing over a= device previously used in a RAID array, I found that parted's mklabel = does not erase mdraid metadata 0.90 metadata (and only that version). Here&= #39;s my test script

#!/bin/bash
set -xeu
parted= --version
rm -f image.img
truncate -s 1G image.img
n=3D$(uuidgen = | cut -d- -f1)
dev=3D"$(losetup -Pf --show image.img)"
mdad= m --create --metadata 0.90 --force --level 1 -n 1 --assume-clean /dev/md/$n= $dev
mdadm --stop /dev/md/$n
losetup -d $dev
parted --script --al= ign optimal image.img -- =C2=A0mklabel msdos
wipefs image.img
<= div>
and here's the output on my system:

+ parted --version
parted (GNU parted) 3.2
Copyright (C) 201= 4 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or la= ter <http://gnu.org/license= s/gpl.html>.
This is free software: you are free to change and re= distribute it.
There is NO WARRANTY, to the extent permitted by law.
=
Written by <http://git.debian.org/?p=3Dparted/parted.git;a= =3Dblob_plain;f=3DAUTHORS>.
+ rm -f image.img
+ truncate -s 1G= image.img
++ uuidgen
++ cut -d- -f1
+ n=3De0c43267
++ losetup = -Pf --show image.img
+ dev=3D/dev/loop44
+ mdadm --create --metadata = 0.90 --force --level 1 -n 1 --assume-clean /dev/md/e0c43267 /dev/loop44
= mdadm: array /dev/md/e0c43267 started.
+ mdadm --stop /dev/md/e0c43267mdadm: stopped /dev/md/e0c43267
+ losetup -d /dev/loop44
+ parted -= -script --align optimal image.img -- mklabel msdos
+ wipefs image.imgDEVICE =C2=A0 =C2=A0OFFSET =C2=A0 =C2=A0 TYPE =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0UUID =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 LABEL
ima= ge.img 0x3fff0000 linux_raid_member 6dbbfe69-809c-7a77-14d5-894fb9296617 image.img 0x1fe =C2=A0 =C2=A0 =C2=A0dos=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0

Looking at ped_disk_clobber none of thi= s is surprising: the 0.90 metadata is somewhere between 127 and 64 kiB from= the end of the device and this isn't touched.

If this is indeed deemed a bug it could be pragmatically fixed by wiping m= ore from the end of the disk or more cleverly by using libblkid to locate a= nd zap all superblocks.

Cheers,
mwh
--0000000000005930fb058ee2836e-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 30 13:29:59 2019 Received: (at 36853-done) by debbugs.gnu.org; 30 Jul 2019 17:29:59 +0000 Received: from localhost ([127.0.0.1]:51110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsVwk-0005lj-RI for submit@debbugs.gnu.org; Tue, 30 Jul 2019 13:29:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsVwi-0005lW-Ua for 36853-done@debbugs.gnu.org; Tue, 30 Jul 2019 13:29:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78F6030BC58B; Tue, 30 Jul 2019 17:29:51 +0000 (UTC) Received: from lister.brianlane.com (ovpn-112-44.phx2.redhat.com [10.3.112.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4E6F60603; Tue, 30 Jul 2019 17:29:50 +0000 (UTC) Date: Tue, 30 Jul 2019 10:29:48 -0700 From: "Brian C. Lane" To: Michael Hudson-Doyle Subject: Re: bug#36853: mklabel does not clear mdraid version 0.90 metadata Message-ID: <20190730172948.GB5383@lister.brianlane.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 30 Jul 2019 17:29:51 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 36853-done Cc: 36853-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) On Tue, Jul 30, 2019 at 09:19:49PM +1200, Michael Hudson-Doyle wrote: > Chasing down a bug report > https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1828558 where > installing over a device previously used in a RAID array, I found that > parted's mklabel does not erase mdraid metadata 0.90 metadata (and only > that version). Here's my test script This is working as expected, parted tries not to touch more than it needs to and this situation will often come up when you re-partition a disk using the same values as a previous installation. You need to use something like wipefs on the disk before creating the new partitions. Thanks, -- Brian C. Lane (PST8PDT) - weldr.io - lorax - parted From unknown Sun Aug 10 16:48:49 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 28 Aug 2019 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator