Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cgd on dk on 4k block size disk

On Mon, May 27, 2013 at 08:46:30PM +0200, Michael van Elst wrote:
> On Mon, May 27, 2013 at 09:05:20AM +0200, Thomas Klausner wrote:
> > I put a plain ffs on it.
> How?

I deleted the gpt partition I had created for the cgd try and made a
new one. Then I did
    newfs -O 2 -b 32k -f 4k -i 128k -m 1 /dev/rdk0

> >         128  732566272      1  GPT part - NetBSD FFSv1/FFSv2
> That's in 4k sector units.
> > CANNOT WRITE: BLK 5398972736
> > CONTINUE? [yn] y
> That's in 512 byte units.

Ok, guessed something like this.

> > I get this message for every 8th BLK now. Looks like a bug?
> Apparently fsck thinks the disk is using 512 byte sectors
> and tries to write 4k blocks (== 8 sectors) in 512 byte chunks
> which doesn't work.
> That's the consequence on how fsck determines how to do I/O.
> It starts by asking the device driver about the physical sector
> size with a fallback of DEV_BSIZE (512). The fallback is also
> used when checking filesystem images with the -F option.
> Then it reads the superblock and recalculates the sector size
> according to the superblock parameters. This is because fsck
> also works with "traditional" disks that cannot be queried
> for the sector size and where the superblock is the only
> source of information.
> But that's where things go wrong if the superblock doesn't reflect
> reality. The kernel on the other hand ignores the superblock
> parameters because it doesn't need them, the disk driver handles
> the transformation of block coordinates.
> newfs should take care about this when writing the superblock, but
> only if you use it directly on the disk. It fails when you first
> create an image and then copy it to the disk.

I don't think I did that. Anyway, if I "dd if=/dev/zero of=/dev/rsd0d
bs=1m count=100" and start again with gpt, newfs, it should work?

Home | Main Index | Thread Index | Old Index