NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/54882: Stange default disklabels generated for non-512 byte disks
The following reply was made to PR kern/54882; it has been noted by GNATS.
From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/54882: Stange default disklabels generated for non-512 byte disks
Date: Wed, 22 Jan 2020 09:35:48 -0000 (UTC)
martin%NetBSD.org@localhost writes:
>Creating a vnd with 2048 byte sectors cause pretty strange fictious disklabels.
>Create a file of zeros and configure a vnd on it, like:
>-rw-r--r-- 1 root wheel 524288000 Jan 18 20:01 disk_small.img
> # vnconfig -c vnd0 disk_small.img 2048/32/16/256
>and then check the disklabel:
>16 partitions:
># size offset fstype [fsize bsize cpg/sgs]
> a: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> b: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> c: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> d: 256000 0 unused 0 0 # (Cyl. 0 - 499)
> e: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> f: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> g: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> h: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> i: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> j: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> k: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> l: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> m: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> n: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> o: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
> p: 256000 0 4.2BSD 0 0 0 # (Cyl. 0 - 499)
That's historical behaviour of vnd.
However, it only occurs when reading a disklabel fails in opposite to
reading the disk successfully but finding no disklabel. In this
case, no error is returned by readdisklabel().
That part apparently is not so "historical" as the code talks about
"lack of disklabel is common" and "lack of disklabel" does not
trigger that behaviour.
You should see an error message printed by the kernel why readdisklabel()
failed.
Does this happen with a 4k (not 512e) disk for the underlying filesystem ?
--
--
Michael van Elst
Internet: mlelstv%serpens.de@localhost
"A potential Snark may lurk in every tree."
Home |
Main Index |
Thread Index |
Old Index