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" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>device-driver</key>
        <string>sd</string>
        <key>device-unit</key>
        <integer>0x0</integer>
        <key>disk-info</key>
        <dict>
                <key>geometry</key>
                <dict>
                        <key>cylinders-per-unit</key>
                        <integer>0x3fff</integer>
                        <key>sector-size</key>
                        <integer>0x400</integer>
                        <key>sectors-per-track</key>
                        <integer>0x3f</integer>
                        <key>sectors-per-unit</key>
                        <integer>0xe8e2cb8</integer>
                        <key>tracks-per-cylinder</key>
                        <integer>0x10</integer>
                </dict>
        </dict>
</dict>
</plist>

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


Greetings,
-- 
                                Michael van Elst
Internet: mlelstv%serpens.de@localhost
                                "A potential Snark may lurk in every tree."



Home | Main Index | Thread Index | Old Index