Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Feb 2002 10:37:44 -0700
From:      Lorin Lund <fbsd@wbs-inc.com>
To:        Glenn Becker <chexmix@burningclown.com>, FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: partitions, disklabel, etc.
Message-ID:  <20020219173920.1218C217D8@ns1.infowest.com>

next in thread | raw e-mail | index | archive | help
I've got a little program, runs under DOS, uses BIOS disk IO that allows
some mucking around with the BIOS partition table.  If it would be 
useful I could send it to you.

Some of it's capabilities are:
  1) hand-editing the type field, the start cyl field, the end cyl field,
  2) swap slots in the partition table,

It's built with djgpp & rhide.

Let me know if you think it would help.


2/18/2002 7:09:33 PM, Glenn Becker <chexmix@burningclown.com> wrote:

>Hi,
>
>I've got a dual boot Debian GNU/Linux and FreeBSD 4.5 installation on 
>an older Toshiba laptop (Satellite Pro 470CDT). Lately I've been 
>concerned about some messages upon bootup (relevant part of dmesg 
>output reproduced below) where the Linux hunks of the hard drive are 
>picked out as being invalid.
>
>Honestly, I'm not sure why they are showing up there at all. But I 
>think the problem(s) may originate with my stupid deletion of my 
>Linux swap partition and my subsequent replacement of that same 
>partition -- I recall reading in a FreeBSD + Linux Mini-HOWTO that 
>a) one has to put FreeBSD =after= Linux on an HD and b) it's best 
>not to muck with the Linux partitions after the dual-OS system is 
>set up.
>
>I've had no problems (yet) with either system, but have been trying 
>to research it to see if I can fix it WITHOUT reinstalling both OSs 
>from scratch (I'd like to avoid this and the wear on the lappy's CD 
>drive if possible). Some other weird stuff has popped up.
>
>If I run disklabel -r command on /dev/ad0, I get this:
>
>disklabel: bad pack magic number (label is damaged, or pack is 
>unlabeled)
>
>Without -r, I get something completely different, which I reproduce
>at the end of this message.
>
>The output of fdisk (see below) also seems completely screwed up - 
>it shows all three partitions on the drive as beginning and ending 
>at the same CHS spot: cyl 1023/ head 254/ sector 63. This seems 
>like a cylinder 1024 thang? Mebbe? 
>
>Soooo, I'm wondering: 1) should I create a disklabel for /dev/ad0, 
>or will this totally bork all my Linux stuff? 2) can I simply 
>-delete- the device files /dev/ad0s1* and /dev/ad0s2*, since I'm 
>not using them for anything in FreeBSD? Or not? 
>
>In short, how do I fix this thing? Or do I?
>
>Thanks for any enlightenment and apologies for the length.
>
>Glenn Becker
>
>
>
>
>
>%%%%%% RELEVANT lines from dmesg %%%%%%%%%%%
>
>Mounting root from ufs:/dev/ad0s3a
>ad0s1: raw partition size != slice size
>ad0s1: start 63, end 27342629, size 27342567
>ad0s1c: start 63, end 30716279, size 30716217
>ad0s1: truncating raw partition
>ad0s1: rejecting partition in BSD label: it isn't entirely within the slice
>ad0s1: start 63, end 27342629, size 27342567
>ad0s1f: start 414367, end 30716279, size 30301913
>ad0s2: raw partition size != slice size
>ad0s2: start 27342630, end 27599669, size 257040
>ad0s2c: start 27342630, end 58605119, size 31262490
>ad0s2: truncating raw partition
>ad0s2: rejecting partition in BSD label: it isn't entirely within the slice
>ad0s2: start 27342630, end 27599669, size 257040
>ad0s2b: start 27445030, end 27715973, size 270944
>ad0s2: rejecting partition in BSD label: it isn't entirely within the slice
>ad0s2e: start 27715974, end 27756933, size 40960
>ad0s2: rejecting partition in BSD label: it isn't entirely within the slice
>ad0s2f: start 27756934, end 58605119, size 30848186
>
>
>%%%%%%%%%%OUTPUT of disklabel /dev/ad0 %%%%%%%%%%%
>
># /dev/ad0:
>type: unknown
>disk: amnesiac
>label: fictitious
>flags:
>bytes/sector: 512
>sectors/track: 63
>tracks/cylinder: 255
>sectors/cylinder: 16065
>cylinders: 3648
>sectors/unit: 58605120
>rpm: 3600
>interleave: 1
>trackskew: 0
>cylinderskew: 0
>headswitch: 0		# milliseconds
>track-to-track seek: 0	# milliseconds
>drivedata: 0 
>
>8 partitions:
>#        size   offset    fstype   [fsize bsize bps/cpg]
>  c: 58605120        0    unused        0     0       	# (Cyl.    0 - 3647)
>
>
>%%%%OUTPUT of fdisk /dev/ad0 %%%%%%%%%%%
>
>******* Working on device /dev/ad0 *******
>parameters extracted from in-core disklabel are:
>cylinders=3648 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=3648 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 131,(Linux filesystem)
>    start 63, size 27342567 (13350 Meg), flag 0
>	beg: cyl 0/ head 1/ sector 1;
>	end: cyl 1023/ head 254/ sector 63
>The data for partition 2 is:
>sysid 130,(Linux swap or Solaris x86)
>    start 27342630, size 257040 (125 Meg), flag 0
>	beg: cyl 1023/ head 255/ sector 63;
>	end: cyl 1023/ head 254/ sector 63
>The data for partition 3 is:
>sysid 165,(FreeBSD/NetBSD/386BSD)
>    start 27599670, size 31005450 (15139 Meg), flag 80 (active)
>	beg: cyl 1023/ head 255/ sector 63;
>	end: cyl 1023/ head 254/ sector 63
>The data for partition 4 is:
><UNUSED>
>
>
>To Unsubscribe: send mail to majordomo@FreeBSD.org
>with "unsubscribe freebsd-questions" in the body of the message
>
>




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020219173920.1218C217D8>