From owner-freebsd-current@FreeBSD.ORG Tue Mar 30 00:28:46 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D754316A4CE for ; Tue, 30 Mar 2004 00:28:46 -0800 (PST) Received: from mail.dti.supsi.ch (mail.die.supsi.ch [193.5.153.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB02B43D5C for ; Tue, 30 Mar 2004 00:28:45 -0800 (PST) (envelope-from roberto.nunnari@supsi.ch) Received: from supsi.ch (pcm2027.dti.supsi.ch [193.5.152.27]) by mail.dti.supsi.ch (8.11.6/8.11.6) with ESMTP id i2U8Shv07398 for ; Tue, 30 Mar 2004 10:28:43 +0200 Message-ID: <4069303D.9070901@supsi.ch> Date: Tue, 30 Mar 2004 10:30:53 +0200 From: Roberto Nunnari User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-current@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: help! I broke the partition table of the drive with the bootable partition! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2004 08:28:47 -0000 Hi all. I was installing a new drive on my 5.2.1-p3 and I believe I made some mistake while using fdisk and bsdlabel.. in fact the partition table for my bootable disk has changed. this was my fdisk amrd0 before: web.dti.supsi.ch# cat fdisk.amrd0 ******* Working on device /dev/amrd0 ******* parameters extracted from in-core disklabel are: cylinders=4420 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=4420 heads=255 sectors/track=63 (16065 blks/cyl) 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 71007237 (34671 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 254/ sector 63 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: and this is how it looks now.. web.dti.supsi.ch# fdisk amrd0 ******* Working on device /dev/amrd0 ******* parameters extracted from in-core disklabel are: cylinders=4420 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=4420 heads=255 sectors/track=63 (16065 blks/cyl) 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 0, size 70766325 (34553 Meg), flag 0 beg: cyl 0/ head 0/ sector 1; end: cyl 308/ head 254/ sector 63 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: as you can see, it is no longer bootable, and it doesn't start at sect 63 like before but at 0 How can I fix it? I was about to give the following command but thought I'd better ask first here... web.dti.supsi.ch# fdisk -B I expect the above to reinstall the boot code and to correct the partition table.. I expect I'll be able to give that command while the system and running and so the filesystem mounted. or if that doesn't work.. web.dti.supsi.ch# fdisk -B -f fdisk.conf.amrd0 also.. with the -t option the results are almost identical to the original state, but end cyl is different.. See.. is that important? web.dti.supsi.ch# fdisk -t -B -f fdisk.conf.amrd0 ******* Working on device /dev/amrd0 ******* fdisk: WARNING line 2: number of cylinders (4420) may be out-of-range (must be within 1-1024 for normal BIOS operation, unless the entire disk is dedicated to FreeBSD) parameters extracted from in-core disklabel are: cylinders=4420 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=4420 heads=255 sectors/track=63 (16065 blks/cyl) Information from DOS bootblock is: 1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 71007237 (34671 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 323/ head 254/ sector 63 2: 3: 4: and here is the fdisk.conf.amrd0 file web.dti.supsi.ch# cat fdisk.conf.amrd0 # values extacted from old fdisk.amrd0 g c4420 h255 s63 p 1 165 63 71007237 p 2 0 0 0 p 3 0 0 0 p 4 0 0 0 a 1 Thank you for your help. -- Roberto Nunnari -software engineer- mailto:roberto.nunnari@supsi.ch Scuola Universitaria Professionale della Svizzera Italiana Dipartimento Tecnologie Innovative http://www.dti.supsi.ch SUPSI-DTI Via Cantonale tel: +41-91-6108561 6928 Manno """ fax: +41-91-6108570 Switzerland (o o) =======================oOO==(_)==OOo========================