Greg Thomas wrote: > > On 2/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Quoting Otto Moerbeek <[EMAIL PROTECTED]>: > > > > > > > > On Wed, 31 Jan 2007, Tony Abernethy wrote: > > > > > >> [EMAIL PROTECTED] wrote: > > >> 16 partitions: > > >> # size offset fstype [fsize bsize cpg] > > >> a: 390721968 0 4.2BSD 2048 16384 > 328 # Cyl 0 > > >> -387620 > > >> c: 390721968 0 unused 0 0 > # Cyl 0 > > >> -387620 > > >> > > >> Most likely, the disklabel or boot code or whatever occupies the > > >> initial sector(s) is being interpreted as disk usage by the > > >> partition. > > >> > > >> Start the partition 1 cylinder in from the beginning. > > > > > > See http://www.openbsd.org/faq/faq4.html#blankfdisk > > > > > > On i386 and amd4, always use fdisk -i on a new disk > before creating > > > the disklabel. If you do that, disklabel will do the right thing > > > automatically. > > > > We have a winner here! :-) > > > > I realized after running 'fdisk -i wd1' and then 'disklabel -E wd1' > > that my previous use of disklabel had the partition > starting at offset > > 0, not offset 63 as expected. After recreating the > disklabel this way > > and re-running newfs, I get a much happier result: > > > > -bash-3.1$ df -h > > Filesystem Size Used Avail Capacity Mounted on > > /dev/wd0a 7.3G 79.1M 6.9G 1% / > > /dev/wd0d 22.0G 512M 20.4G 2% /usr > > /dev/wd0e 7.2G 6.8M 6.8G 0% /var > > /dev/wd1a 183G 2.0K 174G 0% /mnt > > > > The thing is I never would have thought an offset difference > of 63 would make it appear that 38 GB had been used up. > > Greg >
You should expect that -- (and worse;) Note, this is not at all OpenBSD specific (although getting facts right might be;) Nothing is going to take the trouble to scan and count how much disk is in use. This means that something is stored in a convenient location which says how much. DOS partition table stores stuff in a convenient location. OpenBSD disklabel stores stuff in a convenient location. Same convenient location -- trouble is pretty well guaranteed. Note: Depending on gory details you do not want to persue, something like this can at least appear to work for a long long time. You can't even depend on something failing when it logically must fail.