Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Apr 1995 18:53:49 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        current@FreeBSD.org, pete@pelican.com
Subject:   Re: fdisk+disklabel, etc
Message-ID:  <199504300853.SAA19956@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I'm having a bear of a time getting a disk labelled - whatever I do,
>disklabel won't label the disk.  This is a quantum 540 scsi with
>1057758 sectors.  This doesn't factor into anything which will fit
>into dos (or bios)'s idea of cyl-hd-record.  

Just use the BIOS geometry for H and S and use (total_sectors/H/S) for
the number of cylinders in case fdisk actually checks it.

>We need a decent way to 
>1. Get the slice manager to buy ONLY beginning/size and totally ignore
>   the bios data.

It already does, except it looks at the ending C/H/S values in the
partition table for the purpose of creating a dummy label mainly for
fdisks's benefit and to print annoying warnings.  There should be
no problems if you've entered suitably fudged values in fdisk.

>2. Fake out the size so it can be bigger than cyl*hd*sec as long as the
>   real drive size isn't exceeded.

This mostly works.  I think there are only non-fatal bugs in newfs.

>I also have to allocate a 1-cyl dos partition for all time to get the
>slice table accepted at boot time, no matter what - if I delete it and
>write the bsd slice as the whole disk then things fail when I try to
>disklabel.  (actually, now, the fail when I try to disklabel anyhow,
>independent of the fbsd size.  This is with disklabel aimed at:
>sd1
>/dev/rsd1
>/dev/rsd1c
>/dev/rsd1s4
>/dev/rsd1s4c.)

>Mostly it complains that the a partition extends past the end of unit,
>even though the beg is 0 and size matches that in the slice table.
>The last complained about no such file.

>We need a GOOD writeup on this; I know it can be done.

I think you are trying to do too much.  Using the whole disk should
work as documented in disklabel.8:

1) start with a BLANK disk (e.g., with zeros in the first 8K).
2) disklabel -B -r -w sd1 any-old-junk-label-in-etc-disktab
3) disklabel -e sd1 #edit label to match reality

You can skip step 3) if the label in 2) is correct.  I often use the
completely bogus label `floppy'.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504300853.SAA19956>