Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Aug 1995 09:49:29 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hackers@freebsd.org
Subject:   fdisk & disklabel troubles
Message-ID:  <199508290749.JAA04925@labinfo.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
I am having a hard time in understanding/using the parameters used
in the disk-maintainance utilities (fdisk, disklabel, sysinstall
etc.) since the introduction of slices (tried this on both
2.0.5-RELEASE and the 950726-SNAPSHOT).

After spending a few hours on the above programs, I have more
details which I hope somebody can clarify. I am starting with a
fresh, full 950726-SNAPSHOT installation on wd0 (entire disk for
freebsd) and an aborted install on wd2 (entire disk for freebsd,
but just did the partition and newfs).

I see that:

* fdisk cannot read a valid partition table from either disk. The
  "bios idea" of the disk, as printed by fdisk, shows one cylinder less
  than the real size.

* fdisk cannot write the partition table either (or at least, it cannot
  be read back!). I tried to set the correct parameters and write to
  disk, fdisk did not write any error message but reading again the
  partition table shows the same old values.
  (cannot do further experiments with working fdisks, but my setting is
  easily reproducible).


* (BTW, the "usage" line of fdisk shows a "-r" flag which does not
  exist.

Luckily, fdisk does not kill the system. With disklabel, things seem to
be worse: whenever I try to write a label, the system reboots.

As a reference, here are the different ideas of the disks:

REAL:           1010 cyl, 12 hd, 55 sec, total 666.600 sectors
fdisk:          1009 cyl, 12 hd, 55 sec, part. start 1, size 665.939
                                         beg.: cyl.0 sec.2 hd.0
                                         end:  cyl.1009 sec.1 hd.0
disklabel:      1009 cyl, 12 hd, 55 sec, size 666.545


REAL:           1057 cyl, 16 hd, 63 sec, total 1.065.456 sectors
fdisk:          1056 cyl, 16 hd, 63 sec, part. start 1, size 1.064.447
                                         beg.: cyl.0 sec.2 hd.0
                                         end:  cyl.32 sec.1 hd.0
disklabel:      1056 cyl, 16 hd, 63 sec, size 1.065.393


I also tried to use /stand/sysinstall for formatting the disk, but
without luck: the Write option in the partition editor does not
work! I have played a little with the /sysinstall code
(/src/release/sysinstall/disks.c) and found that, for some reason,
the disk (in diskPartitionWrite()) is not "enabled", thus the MBR
is not written to disk. However, I don't know how long the code
will survive, and probably Jordan is the best candidate to fix it.

So: does anyone know of a safe way to fdisk/disklabel a disk on 2.0.5
and newer releases ? I have already lost the partition table on two
disks, and have killed the data on the disks by trying to fix them with
fdisk &C. And now I am really scared on installing 2.0.5 rather than
snap950322 on newer machines!

	Thanks
        Luigi
====================================================================
Luigi Rizzo                     Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it       Universita' di Pisa
tel: +39-50-568533              via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522
====================================================================




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