From owner-freebsd-current Thu Mar 2 18: 3:23 2000 Delivered-To: freebsd-current@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 345C137B522 for ; Thu, 2 Mar 2000 18:03:19 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id TAA39634 for ; Thu, 2 Mar 2000 19:03:17 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id TAA19605 for ; Thu, 2 Mar 2000 19:03:04 -0700 (MST) Message-Id: <200003030203.TAA19605@harmony.village.org> To: current@freebsd.org Subject: sysinstall vs disks Date: Thu, 02 Mar 2000 19:03:04 -0700 From: Warner Losh Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm running the latest sysinstall (I just built it and installed it in /stand/sysinstall). When I tried to run the disk slice (fdisk) editor, it told me that I had no disks on my system. It appears that Disk_Names is returning no disks because DIOCGSLICEINFO is returning ENODEV for all the disks that are opened and stat'd correctly. I see this same behavior with the following libdisk program: #include #include #include int main(int argc, char **argv) { char **n; n = Disk_Names(); printf("Disk names: "); while (*n) { printf("%s", *n); free(*n); n++; } printf("\n"); } When I run the above program, I see no output, for similar reasons (BTW, there's a fd leak in Disk_Names, which shouldn't matter). More generally, I've been trying to track down why disklabel auto is currently broken after a fdisk -e. I have to make a lot of disks that are all slightly different (think CF cards from many different mfg that are all the same size, but report slightly different geom, so I can't cookie cutter it). Things I've tried: # fdisk -e -v ad8 | tail -7 1: sysid 165,(FreeBSD/NetBSD/386BSD) start 32, size 20448 (9 Meg), flag 80 (active) beg: cyl 0/ sector 1/ head 1; end: cyl 319/ sector 32/ head 1 2: 3: 4: # disklabel -w ad8 auto disklabel: No space left on device # disklabel -w ad8s1 auto disklabel: ioctl DIOCGDINFO: Invalid argument disklabel: auto: unknown disk type If I hand craft the disk label using a mutant version of the diskprep awk script that phk posted awhile ago, then I can get it to work. The "No space left on device" error is caused because the disk label returned from the kernel covers the entire disk, rather than the entire slice (in this case, they are different by 32 sectors, which is why the DIOCSDINFO/DIOCWINFO is failing, btw). I can see what label is trying to be written by adding -r to the disklabel and hacking disklabel to go ahead and write the label, even if the kernel retjects it. Turned out to be a bad idea, since it causes lots of other problems.... Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message