Re: Confused over disk geometry for 160GB disk
- From: Mike Clarke <UCEblock@xxxxxxxxxxxxxx>
- Date: Sat, 08 Jul 2006 14:22:52 +0100
Keve Nagy wrote:
I had the same problem a while ago. The 1st O/S I installed to the disk
was FreeBSD. So whatever geometry it used, was the one I should use
later. But I didn't know what that geometry was.
Here is what you can do:
Run FreeBSD fdisk from the command line. If you only have this one disk,
you need no parameters. If you have multiple disks, you should give the
disk device name as the parameter.
Like: fdisk /dev/ad0
Read the output of fdisk, but ignore the first two block where it
displays the CHS geometry.
Look for partition "beg:" lines and see the head value! If any of those
is 255, you are almost certainly using the CHS geometry that
cfdisk-linux reports. SO that is the same geometry you are already
having on your disk, and you are safe to use that (and cfdisk-linux) to
create new partitions.
I can't use cfdisk-linux to create partitions on my system, it always comes
up with "Opened disk read-only - you have no permission to write". Yes I am
running as root.
Otherwise your disk is likely using the geometry that fdisk and dmesg
reports. But usually this is not the case. Most of the time, it is what
I described above.
Looks like I used the correct 255 head geometry considering I've got some
254's and 255's there:
kestrel:/root# fdisk
******* Working on device /dev/ad0 *******
parameters extracted from in-core disklabel are:
cylinders=76613 heads=16 sectors/track=255 (4080 blks/cyl)
Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=76613 heads=16 sectors/track=255 (4080 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 11 (0x0b),(DOS or Windows 95 with 32 bit FAT)
start 63, size 15631182 (7632 Meg), flag 80 (active)
beg: cyl 0/ head 1/ sector 1;
end: cyl 972/ head 254/ sector 63
The data for partition 2 is:
sysid 15 (0x0f),(Extended DOS (LBA))
start 15631245, size 58605120 (28615 Meg), flag 0
beg: cyl 973/ head 0/ sector 1;
end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 74236365, size 81915435 (39997 Meg), flag 0
beg: cyl 1023/ head 255/ sector 63;
end: cyl 1023/ head 254/ sector 63
The data for partition 4 is:
<UNUSED>
But slice 3 (the FreeBSD one) is a bit odd with a reported size of minus 1
sector for a 42 GB partition.
Things look better with cfdisk:
cfdisk 2.11z
Disk Drive: /dev/ad0
Size: 160041885696 bytes, 160.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 19457
Name Flags Part Type FS Type [Label] Size (MB)
-----------------------------------------------------------------------------------------
ad0p1 Boot Primary Win95 FAT32 8003.20
ad0p5 Logical Win95 FAT32 2155.03
ad0p6 Logical Win95 FAT32 8595.42
ad0p7 Logical Win95 FAT32 19255.39
ad0p3 Primary FreeBSD 41940.71
Primary Free Space 80089.56
.... but not without some inconsistencies:
kestrel:/root# cfdisk-linux -P t
Opened disk read-only - you have no permission to write
Partition Table for /dev/ad0
---Starting--- ----Ending---- Start Number of
# Flags Head Sect Cyl ID Head Sect Cyl Sector Sectors
-- ----- ---- ---- ---- ---- ---- ---- ---- -------- ---------
1 0x80 1 1 0 0x0B 254 63 972 63 15631182
2 0x00 0 1 973 0x0F 254 63 1023 15631245 58605120
3 0x00 254 63 1023 0xA5 254 63 1023 74236365 81915435
4 0x00 0 0 0 0x00 0 0 0 0 0
5 0x00 1 1 973 0x0B 254 63 1023 63 4208967
6 0x00 254 63 1023 0x0B 254 63 1023 63 16787862
7 0x00 254 63 1023 0x0B 254 63 1023 63 37608102
This shows p3 starting and ending at the same sector. The Windows logical
partitions have weird values but I don't think I've ever seen any fdisk
output where logical partition details made any sense to me (on both both
FreeBSD and Debian systems)
But the LBA geometry seems OK:
kestrel:/root# cfdisk-linux -P s
Opened disk read-only - you have no permission to write
Partition Table for /dev/ad0
First Last
# Type Sector Sector Offset Length Filesystem Type (ID) Flags
-- ------- -------- --------- ------ --------- ---------------------- ---------
1 Primary 0 15631244 63 15631245 Win95 FAT32 (0B) Boot
(80)
2 Primary 15631245 74236364 0 58605120 Win95 Ext'd (LBA) (0F) None
(00)
5 Logical 15631245 19840274 63 4209030 Win95 FAT32 (0B) None
(00)
6 Logical 19840275 36628199 63 16787925 Win95 FAT32 (0B) None
(00)
7 Logical 36628200 74236364 63 37608165 Win95 FAT32 (0B) None
(00)
3 Primary 74236365 156151799 0 81915435 FreeBSD (A5) None
(00)
Primary 156151800 312576704 0 156424905 Free Space None
(00)
The slices all fit together without any gaps and add up to the right values.
I initially partitioned the disk with sysinstall when I installed 6.0 and I
suspect some of the geometry might have subsequently been messed up when I
installed Windows and (probably) used Windows FDISK to create the logical
partitions. I see that fdisk says it gets its information from the DOS
bootblock which could account for the oddities.
What's the consequence of it not
being the same as the one I use now, am I likely to trash the existing
slices if it's wrong?
No, usually not.
It will work for some time, maybe even forever.
But sooner or later you will have read/write/fsck/etc issues.
I think my best approach might be to go ahead with sysinstall to put 6.1
onto the 4th slice and hope it tidies up the geometry in the process. I'll
make extra backups so I can go back and start from scratch if things still
look dubious afterwards.
--
Mike Clarke
.
- Follow-Ups:
- Re: Confused over disk geometry for 160GB disk
- From: Keve Nagy
- Re: Confused over disk geometry for 160GB disk
- References:
- Confused over disk geometry for 160GB disk
- From: Mike Clarke
- Re: Confused over disk geometry for 160GB disk
- From: Keve Nagy
- Re: Confused over disk geometry for 160GB disk
- From: Mike Clarke
- Re: Confused over disk geometry for 160GB disk
- From: Keve Nagy
- Confused over disk geometry for 160GB disk
- Prev by Date: Re: anyone like FreeBSD T-shrt?
- Next by Date: Re: argh! fonts & openoffice (particularly times new roman )
- Previous by thread: Re: Confused over disk geometry for 160GB disk
- Next by thread: Re: Confused over disk geometry for 160GB disk
- Index(es):
Relevant Pages
|