From owner-freebsd-questions@FreeBSD.ORG Fri Jul 29 00:30:15 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CBA5916A439 for ; Fri, 29 Jul 2005 00:30:15 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from nic.ach.sch.gr (nic.sch.gr [194.63.238.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB34743D46 for ; Fri, 29 Jul 2005 00:30:14 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: (qmail 8016 invoked by uid 207); 29 Jul 2005 00:30:12 -0000 Received: from keramida@ceid.upatras.gr by nic by uid 201 with qmail-scanner-1.21 (sophie: 3.04/2.19/3.81. Clear:RC:1(81.186.70.3):. Processed in 1.575178 secs); 29 Jul 2005 00:30:12 -0000 Received: from dialup3.ach.sch.gr (HELO gothmog.gr) ([81.186.70.3]) (envelope-sender ) by nic.sch.gr (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 29 Jul 2005 00:30:09 -0000 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.4/8.13.4) with ESMTP id j6T0U7ee001731; Fri, 29 Jul 2005 03:30:07 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from giorgos@localhost) by gothmog.gr (8.13.4/8.13.4/Submit) id j6T0U5Eb001715; Fri, 29 Jul 2005 03:30:05 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 29 Jul 2005 03:30:05 +0300 From: Giorgos Keramidas To: dpk Message-ID: <20050729003005.GA99178@gothmog.gr> References: <20050719145822.W23753@shared10.hosting.flyingcroc.net> <441x5tk3e9.fsf@be-well.ilk.org> <20050720064637.Q23753@shared10.hosting.flyingcroc.net> <20050721100327.GA16179@beatrix.daedalusnetworks.priv> <20050728154356.A79761@shared10.hosting.flyingcroc.net> <20050728225701.GB46755@gothmog.gr> <20050728155804.T79761@shared10.hosting.flyingcroc.net> <20050728231035.GA60181@gothmog.gr> <20050728161608.Q79761@shared10.hosting.flyingcroc.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050728161608.Q79761@shared10.hosting.flyingcroc.net> Cc: freebsd-questions@freebsd.org Subject: Re: Large filesystem woes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2005 00:30:15 -0000 Nice catch! I think you should report this to phk@ or ru@ who have been the most active in the fdisk area :-) - Giorgos On 2005-07-28 16:40, dpk wrote: > > I've remounted the disk readonly, and was still seeing the same errors. > I've looked at the fdisk source and compared it to the truss output. > > ... /* rwmode is O_RDWR due to -u */ > fd = open(disk, rwmode); > ... /* errno is EPERM here, from truss */ > if (fd == -1 && errno == ENXIO) > return -2; > if (fd == -1 && errno == EPERM && rwmode == O_RDWR) { > ... /* this is successful: */ > fd = open(disk, O_RDONLY); > ... /* the following opens get device not configured, or no such file or > directory under normal operation, from truss */ > for (p = 1; p < 5; p++) { > asprintf(&s, "%ss%d", disk, p); > fdw = open(s, O_RDONLY); > free(s); > if (fdw == -1) > continue; > break; > } > ... /* ah ha! open_disk is returning -4 because the last slice had some > error */ > if (fdw == -1) > return -4; > > This change was introduced with version 1.67 of the fdisk.c file. > > Commenting out if (fdw == -1) return -4; allows fdisk -u to function. Here > are the results, not changing anything: > > # ./fdisk -u > ******* Working on device /dev/da0 ******* > parameters extracted from in-core disklabel are: > cylinders=534921 heads=255 sectors/track=63 (16065 blks/cyl) > > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=534921 heads=255 sectors/track=63 (16065 blks/cyl) > > Do you want to change our idea of what BIOS thinks ? [n] > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 63, size 75489372 (36860 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 1023/ head 254/ sector 63 > Do you want to change it? [n] > The data for partition 2 is: > > Do you want to change it? [n] > The data for partition 3 is: > > Do you want to change it? [n] > The data for partition 4 is: > > Do you want to change it? [n] > Partition 1 is marked active > Do you want to change the active partition? [n] > > Here are the results of ./fdisk -u when trying to add the second > partition: > > # ./fdisk -u > ******* Working on device /dev/da0 ******* > parameters extracted from in-core disklabel are: > cylinders=534921 heads=255 sectors/track=63 (16065 blks/cyl) > > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=534921 heads=255 sectors/track=63 (16065 blks/cyl) > > Do you want to change our idea of what BIOS thinks ? [n] n > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 63, size 75489372 (36860 Meg), flag 80 (active) > beg: cyl 0/ head 1/ sector 1; > end: cyl 1023/ head 254/ sector 63 > Do you want to change it? [n] n > The data for partition 2 is: > > Do you want to change it? [n] y > Supply a decimal value for "sysid (165=FreeBSD)" [0] 165 > Supply a decimal value for "start" [0] > Supply a decimal value for "size" [0] > fdisk: ERROR: size of partition is zero > fdisk: ERROR: failed to adjust; setting sysid to 0 > Explicitly specify beg/end address ? [n] y > Supply a decimal value for "beginning cylinder" [0] 1024 > Supply a decimal value for "beginning head" [0] > Supply a decimal value for "beginning sector" [0] > Supply a decimal value for "ending cylinder" [0] 534921 > Supply a decimal value for "ending head" [0] 254 > Supply a decimal value for "ending sector" [0] 63 > sysid 0 (0000),(unused) > start 0, size 0 (0 Meg), flag 0 > beg: cyl 0/ head 0/ sector 0; > end: cyl 393/ head 254/ sector 63 > > Writing it fails, but I didn't really expect it to succeed with the above > values. There's some overflowing going on.