Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Sep 2000 03:16:35 -0700 (PDT)
From:      John Baldwin <jhb@pike.osd.bsdi.com>
To:        Michel TALON <talon@lpthe.jussieu.fr>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: fdisk won't work on new hard drives can't get
Message-ID:  <200009061016.DAA52459@pike.osd.bsdi.com>
In-Reply-To: <20000906111124.A9444@lpthe.jussieu.fr> from Michel TALON at "Sep 6, 2000 11:11:24 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Michel TALON wrote:
> I have a similar experience, with a 20 Gigs Western Digital Ultra 66 drive.
> I have installed FreeBSD, Linux and Win98 on it, and have seen a problem with
> fdisk. Note that it is FreeBSD 4.1-Release, so a recent fdisk.

There is a subtle bug in fdisk causing it to misalign the end of the first
slice which is fixed in -stable, but I don't think that affects you.

> Linux is on first slice, 2 Gigs. FreeBSD is on second slice 2.5 Gigs. I wanted
> to allocate the rest to Win98. Problem Win98 refused to install on the
> partition fdisked and newfs_msdos. So i used Dos fdisk to delete the third
> partition and recreate it, then Dos format /s c: to format it. Then Win98
> install went out fine (i had to disable ATA 66 in the BIOS before running Dos
> programs otherwise nothing worked. I then installed drivers coming with the
> Abit mobo, and reenabled ATA 66).

Some fdisk output after the BSD fdisk run and the DOS fdisk run would be
helpful as the differences could be seen then.

> Rebooting to FreeBSD i discovered that the Dos slice
> began at cylinder 1024 and ended at last cylinder. There was a 2 Gig hole from
> the end of FreeBSD slice to the beginning of Dos slice. Why Dos fdisk did
> that, i don't know. It is not a very verbose program! But more important,
> while sector numbers were fine, the cylinder indications were completely
> bogus. They say the slice is beginning cylinder 1023 and ending cylinder 1023.
> I can see above similar bogus cylinder informations. I have tried to use fdisk
> -u to restore correct numbers, but to no avail. At best one gets starting
> cylinder 0, ending cylinder = number of cylinders remaining. So i changed
> nothing. Since apparently only sector numbers are relevant, this caused no
> problem.

No.  This is the defined way for indicating that a slice starts and ends
beyond cylinder 1024.  The MBR format does not have enough bits to indicate
cylinders above 1024.  Period.  Thus, it uses the special values you saw as
magic values to indicate that only the starting block and length are correct.
Which you would have observed if you had read the entire screen.  For
example:

sysid 12,(DOS or Windows 95 with 32 bit FAT, LBA)
    start 63, size 2096577 (1023 Meg), flag 0
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 1023/ sector 63/ head 15
The data for partition 2 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 2096640, size 17914176 (8747 Meg), flag 80 (active)
        beg: cyl 1023/ sector 63/ head 255;
        end: cyl 1023/ sector 63/ head 15

Note that the start and size entries are perfectly valid.

> However the problem came when i installed Linux, namely Mandrake 7.1. I have
> been much impressed by the very nice installer. The Ultra 66 mode was properly
> recognized and install went out fine and quick. I asked to put lilo on the
> Linux partition and rebooted to find that F2 did not fire up Linux. Using the 
> Mandrake cdrom in rescue mode and doing
> mount /dev/hda2 /mnt
> lilo -r /mnt
> i discovered the problem. There was a Windows label in lilo.conf and since
> cylinder numbers were botched, lilo aborted. Erasing it and rerunning lilo
> installed the boot sector on /dev/hda2 and allowed linux access.

Try telling lilo to use lba32 and see if that can get it to work.  FreeBSD
automatically detects if it needs to use LBA when booting, but LILO doesn't
do this yet.

> Moral, it would be fine to fix the fdisk problems in FreeBSD. Moreover this
> program is horrendous to use, and the documentation is close to 0.
> As far as disklabel is concerned, it is of the same vein. One has to compute
> a lot of entries from what fdisk reports, write an entry in /etc/disktab
> and run disklabel -r -w <slice> before having something reasonable. The
> label auto does not work, at least on my ata drive. This could be easily
> automated. Manually it took me two hours to figure out, in order to reuse an
> old disk.

fdisk is not great, but there is a manpage.  disklabel is broken in that
it can't create new disklabels on a fresh slice.  I find that the easiest
way to do this is actually to use sysinstall's label editor, since it does
get it right.

-- 

John Baldwin <jhb@bsdi.com> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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