From owner-freebsd-questions@FreeBSD.ORG Tue Dec 2 07:13:54 2003 Return-Path: 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 3CAC516A4CE for ; Tue, 2 Dec 2003 07:13:54 -0800 (PST) Received: from rdsnet.ro (smtp.rdsnet.ro [62.231.74.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6BD5643FCB for ; Tue, 2 Dec 2003 07:13:50 -0800 (PST) (envelope-from itetcu@apropo.ro) Received: (qmail 14814 invoked from network); 2 Dec 2003 15:12:34 -0000 Received: from unknown (HELO it.buh.cameradicommercio.ro) (81.196.25.19) by mail.rdsnet.ro with SMTP; 2 Dec 2003 15:12:34 -0000 Date: Tue, 2 Dec 2003 17:13:22 +0200 From: Ion-Mihai Tetcu To: Malcolm Kay Message-Id: <20031202171322.05f2854b.itetcu@apropo.ro> In-Reply-To: <200312030029.14531.malcolm.kay@internode.on.net> References: <20031202125044.574ca489.itetcu@apropo.ro> <200312030029.14531.malcolm.kay@internode.on.net> X-Mailer: Sylpheed version 0.9.6claws (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: fdisk question (long) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2003 15:13:54 -0000 On Wed, 3 Dec 2003 00:29:14 +1030 Malcolm Kay wrote: > On Tue, 2 Dec 2003 21:20, Ion-Mihai Tetcu wrote: > > Hope someone will have the pacince to read all this ... > > > > I have a 120G HDD, in the BIOS is set as LBA. I've RTFM as much as I > > could, but there still are some things I clearly don't understand. I > > want to be sure that I can move this disk to another machine with > > anouter BIOS and the system still boots up. > > > > I've used sysinstall to make partitions and the result is bellow: > > > > > > it# fdisk ad0 > > ******* Working on device /dev/ad0 ******* > > parameters extracted from in-core disklabel are: > > cylinders=232578 heads=16 sectors/track=63 (1008 blks/cyl) > > > > Figures below won't work with BIOS for partitions not in cyl 1 > > parameters to be used for BIOS calculations are: > > cylinders=232578 heads=16 sectors/track=63 (1008 blks/cyl) > > > > These figures are just figures that will probably work -- and are > unlikely to have any connection to the physical disk structure. OK > > 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 497952 (243 Meg), flag 0 > > beg: cyl 0/ head 1/ sector 1; > > end: cyl 30/ head 254/ sector 63 > > Having sthe geometry set to 23578/16/63 (that is sixteen heads) > it is rather strange to address head number 254. Maximum head > number should then be 15. So you are saying that something is wrong here ? > However it is also quite common to define large disk geometries > as nnnnnn/255/63 which allows a maximum head number of 254. > > The data for partition 2 is: > > sysid 6 (0x06),(Primary 'big' DOS (>= 32MB)) > > start 498015, size 41929650 (20473 Meg), flag 0 > > beg: cyl 31/ head 0/ sector 1; > > end: cyl 1023/ head 254/ sector 63 > > The CHS descriptor has overflowed -- nolonger meaningful. > LBA works with the 498015/41929650 figures. OK > > The data for partition 3 is: > > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > > start 42427665, size 192008880 (93754 Meg), flag 0 > > beg: cyl 1023/ head 255/ sector 63; > > end: cyl 1023/ head 254/ sector 63 > > The data for partition 4 is: > > > > > > Q1: How can the partition 3 end up before beginning ? > > > > The CHS entries are limited to 1023/255/63 which does not come > anywhere near the disk capacity -- so once C reaches 1023 the CHS > recording capacity has been exceeded. Or to put it another way the CHS > entries are somewhat meaningless on large disks. I know the CHS limits. > But the absolute start sector number and slice > size is also recorded in the slice/partition table and this is used in > LBA mode. So no mather what the BIOS reports, the start sector and the size of a partition in sectors is the same, right ? > > Q2: What is the Warning: BIOS sector numbering starts with sector 1 > > trying to say ? The cylinders=232578 heads=16 sectors/track=63 shows > > the same as in teh BIOS screen. > > > > Cylinder and head numbering starts at 0; sectors start at 1. A quirk > of history that you need to know when using CHS. I don't think I understand. > > Q3: The in-core parameters and those for BIOS calculation are the > > same; this normal (from my experince) / when they won't mach ? > > > > So i decided to make it by hand (note that sysid 0 for the first > > partition is a typo - it should be 165 and I'll want the / slice on > > it, and I want to reserve the second partition for a winXP, and the > > 3rd will be for the other slices). > > > ... > > Q4: I've supplied the start and size parameters by reading those > > provided by the sysinstall partitioning. How can I calculate them ? > > > > Work with absolute sector numbers but chosen so that a slice always > starts at sector 1 in the CHS scheme. Lets say I get new HDD. Could you tell me how do i do this ? How do I find out the number of sectors and translate sectors in capacity (MB) ? Or point me somewhere ? > > Q5: Why the new parameters are different from those of sysinstall ? > > > > Possibly a change of assumed CHS geometry I don't understand this. As I didn't changed anything. > > Q6: Is this schema OK and will I be able to use this disk in an > > other computer and access all the partitions and slices ? > > Probably but I would feel happier with sysinstall generated values. The reason I've posted this is that I've lost about 50G of date after an MB crash as on the new MB I've got fsck -> CAN NOT FIND SUPERBLOCK for other slices that / and I don't end-up to repeat that again (and it was done with sysinstall). The man page of fdisk says: start and size fields provide the start address and size of a slice in sectors. flag 80 specifies that this is the active slice. cyl, sector and head fields are used to specify the beginning and end addresses of the slice. Note: these numbers are calculated using BIOS's understanding of the disk geometry and saved in the bootblock. What if the "BIOS's understanding" chanches (e.g. new mobo) ? Many thanks, -- IOnut Unregistered ;) FreeBSD user