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 11:34:26PM +0200, Thomas Klausner wrote:
> > 
> > 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?

newfs (using code from fsck) uses DIOCGDISKINFO (data from the device
driver) and falls back to DIOCGDINFO (data from disklabel) to determine
disk geometry including the sector size. You can override that value with
the -S option.

You can dump DIOCGDISKINFO data with drvctl, e.g.:

# drvctl -p sd0
Properties for device `sd0':
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
<plist version="1.0">

N.B. that's all netbsd-6 and later. In netbsd-5 you need the -S option.

                                Michael van Elst
                                "A potential Snark may lurk in every tree."

Home | Main Index | Thread Index | Old Index