From nobody Sat Aug 28 13:50:20 2021 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 9E8FE179D029 for ; Sat, 28 Aug 2021 13:50:40 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GxdJb6Ksvz4gBb for ; Sat, 28 Aug 2021 13:50:39 +0000 (UTC) (envelope-from grahamperrin@gmail.com) Received: by mail-wr1-x429.google.com with SMTP id b6so14932620wrh.10 for ; Sat, 28 Aug 2021 06:50:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=Ucr4BLViYANnAbErU89Uzrza7WhokuEeMwhT2mvJ/q4=; b=ovjXn2VlY82nFi9kiFDdv+nuqb1DpmQU2cqt+4NwdXkzDSep6pW74lUlYsF8wl+52f QHr7VY5rjtLemn+kiaaWN21yUwEjIZHK7HCNFkxGRearzjZfQ55rR3UZPaTksBbruEhV Q8EZJky6RYne9LVMGxhyoWnMeW7kfszXLalcJBXp7J89NvUyflVP068H6/cmRRF0TOWN V97EaH4lHdcfsJHJO5csxvgajkBzUUetRQgdw1FwImNEZbjio7lAoKdkt4Y514Yo6nCX lBunjgN9OytOEo+N6MmwYhP3qL72nUmbuRpndEOshPKa33mf4fN0WFZ8wykPo7y1G6EG Q0GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=Ucr4BLViYANnAbErU89Uzrza7WhokuEeMwhT2mvJ/q4=; b=JJ0QyQ2u+x1/BAMvAYZKcz8vKNWflV63JSpa+Bw8BAQLK/TQG8tz350DpW9Y6aJWrA uGfVab3RBQ7juAKJNt+8mnW9uJBG1n5MCTkk+vhovKGIntAK8thuf4LDhWwGjFSUUEeY Q43m3mt41j7iURJ4vKKDlFWHnLhwqEEfgbo17BV+q3pmJU2wbkiTaEOVSPr9pjNduyR1 2QWhSzC0Nx3rVNy/OLxUW2aZB73f7FsAb67f3C+0SzTxU+TZYo00+FhUP6BWcGyTQoXG wqfZoJ9HdxCZEYHMALif/LECWNx93cGz6tZtWMeWG9Mk9SqoMX/5Jmxqu3iOYMcbuuMR H9TQ== X-Gm-Message-State: AOAM532eHCgNMIsmeZJuVshoKPNqJasVJ1UgiyoFMEQVzv+CBez+3646 IG2E3ss8UmDTdR9+HIIrXQk7vmO0oz7mn3WQza4JjTvG+ld/0Q== X-Google-Smtp-Source: ABdhPJzXYRHQaJmXB7IALHP5ILSa5iizoMk2+/4Hw92npwB3Apg9uAWidT10Y3M4OdV07XMYts3/Rv7qf5buU7PcTEA= X-Received: by 2002:adf:ebcd:: with SMTP id v13mr16114002wrn.400.1630158632881; Sat, 28 Aug 2021 06:50:32 -0700 (PDT) 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 References: <149845085.13.1630055426223@localhost> In-Reply-To: From: Graham Perrin Date: Sat, 28 Aug 2021 14:50:20 +0100 Message-ID: Subject: Re: Experiments with sswap(1), srm(1), wipe(1), gdisk(8), lsblk and gpart(8) To: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4GxdJb6Ksvz4gBb X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=ovjXn2Vl; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of grahamperrin@gmail.com designates 2a00:1450:4864:20::429 as permitted sender) smtp.mailfrom=grahamperrin@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::429:from]; NEURAL_SPAM_SHORT(1.00)[0.998]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-ThisMailContainsUnwantedMimeParts: N > =E2=80=A6 I'll report what might be an obscure bug in lsblk. Fixed but not yet in ports: =E2=80=A6 > Lines 131=E2=80=93139, gdisk should have added freebsd-swap at /dev/da0p3= , I > ignored the suggestion to remove the hard disk drive ("Warning: The > kernel may continue to use old or deleted partitions."), gpart then > showed nothing (free space) where da0p3 was expected. =E2=80=A6 > Lines 288=E2=80=93297, gdisk should have deleted /dev/da0p3, I ignored th= e > suggestion to remove the drive, lsblk showed da0p3 still present. =E2=80=A6 Today: * sysctl kern.geom.debugflags=3D16 was not required * things were as expected following each run of gdisk, ignoring the warnings about the kernel continuing to use old or deleted partitions. puts kern.geom.debugflags=3D16 in context. I'm not sure why it was required yesterday. ---- # /usr/home/grahamperrin/dev/lsblk/lsblk da4 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT da4 2:115 466G GPT - - da4p1 2:116 200M efi msdosfs/EFI= SYS - da4p2 2:117 512K freebsd-boot gpt/gptbo= ot0 - da4p3 2:118 16G freebsd-swap gpt/FreeBSD%20s= wap - da4p4 2:119 450G freebsd-zfs gpt/zfs0 -:- 4.0K - = - - # srm -lv /dev/da4p3 Using /dev/urandom for random input. Wipe mode is insecure (two passes [0xff/random]) Wiping /dev/da4p3 Warning: /dev/da4p3 is not a regular file, rename/unlink only!Warning: Couldn't rename /dev/da4p3 - Operation not supported Removed file /dev/da4p3 ... Done # sysctl sysctl kern.geom.debugflags kern.geom.debugflags: 0 # gdisk /dev/da4 GPT fdisk (gdisk) version 1.0.8 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Command (? for help): d Partition number (1-4): 3 Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTIN= G PARTITIONS!! Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/da4. Warning: The kernel may continue to use old or deleted partitions. You should reboot or remove the drive. The operation has completed successfully. # /usr/home/grahamperrin/dev/lsblk/lsblk da4 DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT da4 2:115 466G GPT - - da4p1 2:116 200M efi msdosfs/EFI= SYS - da4p2 2:117 512K freebsd-boot gpt/gptbo= ot0 - -:- 16G - = - - da4p4 2:118 450G freebsd-zfs gpt/zfs0 -:- 4.0K - = - - # gdisk /dev/da4 GPT fdisk (gdisk) version 1.0.8 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Command (? for help): n Partition number (3-128, default 3): First sector (410664-976773127, default =3D 410664) or {+-}size{KMGTP}: Last sector (410664-33966079, default =3D 33966079) or {+-}size{KMGTP}: Current type is A503 (FreeBSD UFS) Hex code or GUID (L to show codes, Enter =3D A503): a502 Changed type of partition to 'FreeBSD swap' Command (? for help): w Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTIN= G PARTITIONS!! Do you want to proceed? (Y/N): y OK; writing new GUID partition table (GPT) to /dev/da4. Warning: The kernel may continue to use old or deleted partitions. You should reboot or remove the drive. The operation has completed successfully. # /usr/home/grahamperrin/dev/lsblk/lsblk DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT ada0 0:121 932G GPT - - ada0p1 0:123 260M efi gpt/efibo= ot0 - -:- 1.0M - = - - ada0p2 0:125 16G freebsd-swap gpt/swap0 SWAP ada0p2.eli 2:76 16G freebsd-swap - SWAP ada0p3 0:127 915G freebsd-zfs gpt/zfs0 ada0p3.eli 0:135 915G zfs = - - -:- 708K - = - - da4 2:115 466G GPT - - da4p1 2:116 200M efi msdosfs/EFI= SYS - da4p2 2:117 512K freebsd-boot gpt/gptbo= ot0 - da4p3 2:118 16G freebsd-swap gpt/FreeBSD%20s= wap - da4p4 2:119 450G freebsd-zfs gpt/zfs0 -:- 4.0K - = - - da5 0:209 466G GPT - - -:- 1.0M - = - - da5p1 0:210 466G freebsd-zfs gpt/Transcend da6 0:217 14G GPT - - -:- 1.0M - = - - da6p1 0:218 14G freebsd-zfs gpt/cache-transcend da7 0:239 29G GPT - - da7p1 0:240 29G freebsd-zfs gpt/cache-august # gpart show =3D> 40 1953525088 ada0 GPT (932G) 40 532480 1 efi (260M) 532520 2008 - free - (1.0M) 534528 33554432 2 freebsd-swap (16G) 34088960 1919434752 3 freebsd-zfs (915G) 1953523712 1416 - free - (708K) =3D> 34 976773101 da5 GPT (466G) 34 2014 - free - (1.0M) 2048 976771087 1 freebsd-zfs (466G) =3D> 34 30310333 da6 GPT (14G) 34 2014 - free - (1.0M) 2048 30308319 1 freebsd-zfs (14G) =3D> 34 60437425 da7 GPT (29G) 34 60437425 1 freebsd-zfs (29G) =3D> 40 976773088 da4 GPT (466G) 40 409600 1 efi (200M) 409640 1024 2 freebsd-boot (512K) 410664 33555416 3 freebsd-swap (16G) 33966080 942807040 4 freebsd-zfs (450G) 976773120 8 - free - (4.0K) # /usr/local/sbin/lsblk DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT ada0 0:121 932G GPT - - ada0p1 0:123 260M efi gpt/efibo= ot0 - -:- 1.0M - = - - ada0p2 0:125 16G freebsd-swap gpt/swap0 SWAP ada0p2.eli 2:76 16G freebsd-swap - SWAP ada0p3 0:127 915G freebsd-zfs gpt/zfs0 ada0p3.eli 0:135 915G zfs = - - -:- 708K - = - - cd0 0:129 0B - - - da0 2:105 0B freebsd-swap - SWAP da1 2:107 0B - - - da2 2:108 0B - - - da3 2:109 0B - - - da4 2:115 466G GPT - - da4p1 2:116 200M efi msdosfs/EFI= SYS - da4p2 2:117 512K freebsd-boot gpt/gptbo= ot0 - da4p3 2:118 16G freebsd-swap gpt/FreeBSD%20s= wap - da4p4 2:119 450G freebsd-zfs gpt/zfs0 -:- 4.0K - = - - da5 0:209 466G GPT - - -:- 1.0M - = - - da5p1 0:210 466G freebsd-zfs gpt/Transcend da6 0:217 14G GPT - - -:- 1.0M - = - - da6p1 0:218 14G freebsd-zfs gpt/cache-transcend da7 0:239 29G GPT - - da7p1 0:240 29G freebsd-zfs gpt/cache-august #