From nobody Tue Jan 11 19:23:34 2022 X-Original-To: questions@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 6908119675CF for ; Tue, 11 Jan 2022 19:26:07 +0000 (UTC) (envelope-from hruodr@gmail.com) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JYLJr08gcz54Sv for ; Tue, 11 Jan 2022 19:26:03 +0000 (UTC) (envelope-from hruodr@gmail.com) Received: by mail-wr1-x436.google.com with SMTP id e9so141245wra.2 for ; Tue, 11 Jan 2022 11:26:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=WxIuoCd53Qpf9nc4d20W63NcMuB/KcB6rCW1kf3qNU0=; b=fLiDEZVu4x5KJkjWylo7s+CLzxBJF7IgIfu6vITc4AoUTwrrYgmPH1SKP9z3WgO6CI V1WTE7uncS7DT4NY3uNoVFfnukd5XvMfvppdElbvklRnOd5YoRzpHxUQEd6XF57EmxUt xF8NSQGpDE/ZP1TpAIaA3FpuyQh76RQwn8bPoRc1nM+L2NSTYYPNPe5C68ZoiVfmQcZi lVU6I4nd5cw2CjWV3RPFKqBDnzQPAxUX7qJH1hD7Io7vzhE3xe77hAT+W19kS9bb5udg R4OaWoX2z+m01byZOW85SR2ulOPDvX9m+j5nbpHftSWbOFnjAkvL14dgZmXoxedzP64g 5zwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=WxIuoCd53Qpf9nc4d20W63NcMuB/KcB6rCW1kf3qNU0=; b=5/S1xohgCrK863gr3v2G5JsLK6PE4qxeIXo1EzzU0EIn67NxE3B/ZLVEh6n9LXgpj4 md63g86p8NtPZ0U9kyIg8OJRwisQdBlzsdjgF8TMwprnKDVxwnaKFT7EX4LSPmijEevC ivEjTuHAhx8HEFfWnj+AzyxFqH9968HX1/qKkQnekBhRu2oJSGpuuHlG53UukMkQOeoV VvI6RpRJJRutJ5J25LOeSePoS/85ksHsnGXx2Edzm6S9zXHaOoxwiTbIBsevYuHqzliH 4N+/a7IDRQSCqLJg9qU9CVrZgGkUZ6L5MDB8WTAiohJQ4jApkDsbQVcVDrbwlJ8SkH4X S2vw== X-Gm-Message-State: AOAM533Od1hfkAZfI/6541+b5JhqEN1r/rLM9S2Gf0uKjhcPx/h+ADh/ EnafGH8BPk74Yk0JxJoYHU3CBo0UiZ4= X-Google-Smtp-Source: ABdhPJx6Nu1+UnqiWnbDAUtGwOabNNBKJY68JEDtsMK00iHyeICZOghaHsgXey61w0J48OyBTrkjSg== X-Received: by 2002:adf:eb87:: with SMTP id t7mr5157783wrn.147.1641929157246; Tue, 11 Jan 2022 11:25:57 -0800 (PST) Received: from [192.168.178.26] (dslb-188-102-039-035.188.102.pools.vodafone-ip.de. [188.102.39.35]) by smtp.gmail.com with ESMTPSA id u11sm2689136wmq.2.2022.01.11.11.25.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jan 2022 11:25:56 -0800 (PST) Date: Tue, 11 Jan 2022 19:23:34 +0000 (UTC) From: Roderick To: questions@freebsd.org cc: Steve O'Hara-Smith Subject: Re: dd and mbr In-Reply-To: Message-ID: <4a441db-9d0-9fb3-ae9e-35e0496638dd@gmail.com> References: <4af920fc-eff1-a92e-d36e-1ba97079864c@gmail.com> <20220111104112.dd98218395b3edc567ab2031@sohara.org> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4JYLJr08gcz54Sv X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=fLiDEZVu; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of hruodr@gmail.com designates 2a00:1450:4864:20::436 as permitted sender) smtp.mailfrom=hruodr@gmail.com X-Spamd-Result: default: False [-3.55 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.55)[-0.549]; RECEIVED_SPAMHAUS_PBL(0.00)[188.102.39.35:received]; 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]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::436:from]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N After zeroing with FreeBSD, FreeBSD shows a BSD slice, but OpenBSD an unused slice. The problem seems to be what fdisk shows. Not dd. R. On Tue, 11 Jan 2022, Roderick wrote: > > Zeroing makes a BSD slice?! Another experiment: > > ----- > > % fdisk da0 > ******* Working on device /dev/da0 ******* > parameters extracted from in-core disklabel are: > cylinders=810 heads=64 sectors/track=32 (2048 blks/cyl) > > parameters to be used for BIOS calculations are: > cylinders=810 heads=64 sectors/track=32 (2048 blks/cyl) > > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 11 (0x0b),(DOS or Windows 95 with 32 bit FAT) > start 32, size 1658848 (809 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 809/ head 63/ sector 32 > The data for partition 2 is: > > The data for partition 3 is: > > The data for partition 4 is: > > > % dd if=/dev/zero of=/dev/da0 count=1 > 1+0 records in > 1+0 records out > 512 bytes transferred in 0.333139 secs (1537 bytes/sec) > > % fdisk da0 > ******* Working on device /dev/da0 ******* > parameters extracted from in-core disklabel are: > cylinders=810 heads=64 sectors/track=32 (2048 blks/cyl) > > parameters to be used for BIOS calculations are: > cylinders=810 heads=64 sectors/track=32 (2048 blks/cyl) > > fdisk: invalid fdisk partition table found > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 32, size 1658848 (809 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 809/ head 63/ sector 32 > The data for partition 2 is: > > The data for partition 3 is: > > The data for partition 4 is: > > ------ > > > > > > > > On Tue, 11 Jan 2022, Roderick wrote: > >> >> I did the folowing experiment. >> >> (1) dd if=/dev/zero of=/dev/da0 bs=1m >> >> (2) reboot the system in order to eliminate everything cached. >> >> (3) following comandos: >> >> % dd if=/dev/da0 count=1 | hd >> 1+0 records in >> 1+0 records out >> 512 bytes transferred in 0.001911 secs (267913 bytes/sec) >> 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >> |................| >> * >> 00000200 >> % >> % fdisk da0 >> ******* Working on device /dev/da0 ******* >> parameters extracted from in-core disklabel are: >> cylinders=810 heads=64 sectors/track=32 (2048 blks/cyl) >> >> parameters to be used for BIOS calculations are: >> cylinders=810 heads=64 sectors/track=32 (2048 blks/cyl) >> >> fdisk: invalid fdisk partition table found >> Media sector size is 512 >> Warning: BIOS sector numbering starts with sector 1 >> Information from DOS bootblock is: >> The data for partition 1 is: >> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) >> start 32, size 1658848 (809 Meg), flag 80 (active) >> beg: cyl 0/ head 1/ sector 1; >> end: cyl 809/ head 63/ sector 32 >> The data for partition 2 is: >> >> The data for partition 3 is: >> >> The data for partition 4 is: >> >> % >> >> >> >> >> >> On Tue, 11 Jan 2022, Steve O'Hara-Smith wrote: >> >>> On Tue, 11 Jan 2022 10:02:26 +0000 (UTC) >>> Roderick wrote: >>> >>>> >>>> The command: >>>> >>>> dd if=/dev/zero of=/dev/da0 >>>> >>>> does not delete the mbr, I still see the partition table with >>>> fdisk. My questions: >>> >>> It does delete the partition table, but fdisk is showing you cached >>> data - the clue is in this bit of the output: >>> >>> ******* Working on device /dev/ada0 ******* >>> parameters extracted from in-core disklabel are: >>> >>> I thought there was a way to get fdisk to read directly but I >>> can't find it in the man page now. >>> >>> -- >>> Steve O'Hara-Smith >>> >>> >> >