In message <[EMAIL PROTECTED]> Marc Frajola writes:
:     I have written my own Perl script that reads dmesg to get the disk
: geometry and then generates a proper FreeBSD partition (disklabel)
: label, and have verified that I can get the result I want this way.

Bad idea.  Too many different formats.  Also, it doesn't work for
removable media like CF cards.  The format for scsi is different than
ata, and ata changed recently.    You also have problems with slow
SCSI devices that take a while to print their probe messages.  If it
is after /var/run/dmesg.boot is created you won't find them there.
And if you are using the dmesg buffer, it can wrap with log messages
before you try to access the disk.

:     A problem with both prepdisk and my script is that it depends on
: the format of the kernel autoconfiguration entry for the sizes of
: disks to stay relatively static. The message format changed recently,
: and future such changes will cause our scripts to break.

My diskprep doesn't break.  I don't parse the boot messages.  I tell
fdisk to give me the information, and then use it.  That's why I said
that it depended fdisk patches.  fdisk -s after the change will do the
right thing and give good summary information.

:     I believe the right solution to all this is to use a C program
: doing ioctl's on the raw device to get disk geometry info, and then
: using libdisk to write a proper label.

Uggg.  I've had less than good luck with libdisk.  It is completely
broken for me right now.  This is even when I do a build world and
install a kernel at the same time..  Something to do with the
raw/block changes a while ago?  I can't seem to get this to work at
all, and it is quite frustrating since it would be ideal.

I may try again later, but for now libdisk has left a bad taste in my
mouth...

:     Just as a side note, I discovered that 'fdisk -e' produces a
: different ending cylinder number on the fdisk slice than sysinstall,
: even though the number of sectors in the fdisk slice between the two
: methods are identical. This doesn't seem to effect operation at all,
: but I'd guess that the sysinstall number of 1023 is probably more
: accurate than the less-than 1023 numbers I get with 'fdisk -e'. This is
: probably a bug in 'fdisk -e'.

Not sure about this.

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to