Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jun 1995 19:46:28 -0700 (PDT)
From:      Poul-Henning Kamp <phk@ref.tfs.com>
To:        hackers@freebsd.org
Cc:        faq@freebsd.org, doc@freebsd.org
Subject:   disk handling program
Message-ID:  <199506160246.TAA03119@ref.tfs.com>

next in thread | raw e-mail | index | archive | help

There has been a lot of questions about disks and what to do.

The situations isn't quite optimal in 2.0.5/current and hopefully somebody
will get/take time to remedy this before 2.1.  

Presently we take a very conservative position on geometry, and it is
ABSOLUTELY CRUCIAL that the "bios-geometry" is correct/sensible.

For your boot-disk it MUST be correct.  For other disks it merely have
to make sense.

There are two ways to get it right:

A:	Create a msdos partition, and delete it from FreeBSD.

B:	Boot freebsd with -v and look at the "bios-geometry" table
	it prints at the end, find the right one for this particular
	drive and use that.

In the meantime:

For those of you who really feel adventurous, you can 
	cd /usr/src/release/libdisk
	make tst01
	./tst01 wd0

tst01 is a small driver program for the libdisk library, it's pretty much
the same as the undocumented wizard mode in the sysinstall program.

ALL GUARANTEES ARE OFF if you run it (well, we don't give any in the first
place).

It will NEVER write to the disk unless you ask it to.

(If there is a curses-programmer with extra time at hand, please make
a decent userinterface to this please.  Contact phk@freebsd.org.)

In particular if you send email with questions/complaints, it is very
helpful for us if you can include the output from tst01 in the email.

The output could look like this:
ref# ./tst01 sd0
--==##==--
Debug_Disk(sd0)  flags=0  bios_geom=675/128/32
  boot1=0x0, boot2=0x0, bootmgr=0x0
-->        0x15040        0  2766300  2766299 sd0      whole    0x00 
  -->      0x15080        0       32       31 -        unused   0x00 
  -->      0x150c0       32  2764768  2764799 sd0s1    freebsd  0xa5 C=
    -->    0x15100       32    65536    65567 sd0s1a   part     0x07 
    -->    0x151c0    65568    65536   131103 sd0s1b   part     0x01 
    -->    0x15200   131104    65536   196639 sd0s1e   part     0x07 
    -->    0x15240   196640  1024000  1220639 sd0s1f   part     0x07 
    -->    0x15280  1220640  1544160  2764799 sd0s1g   part     0x07 
  -->      0x15140  2764800     1500  2766299 -        unused   0x00 

Column	Explanation
--------------------------------------------------------------------------
1	The arrows show at what level this chunk of disk lives.
	All chunks must fit inside exactly one higherlevel chunk.

2	Pointer.  This is the pointer inside the tst01 program.  You pass
	this to the delete command: "delete 0x151c0" for instance.

3	Offset.  Where on the disk the chunk starts.  Can be negative
	for the Ontrack'ed disks.

4	Length, numbers of 512bytes sectors in chunk.

5	End, number of last sector in chunk.

6	Name.  "X" means that no meaningful name can be assigned.

7	
	whole
		represents the entire disk
	unused
		space presently without a name of it's own.  Some unused
		chunks are reserved.
	freebsd
		FreeBSD slice
	dos
		MSDOS slice
	part
		FreeBSD partition
	extended
		Extended dos partition
	
8	Subtype.  For things which live in the MBR (freebsd,dos,extended)
	this is the MBR type field.  For things in a FreeBSD slice, this
	is the disklabel type.

9	Flags
	C	FreeBSD compatibility slice.
	A	Active
	=	Aligned
	> 	Extends past cyl 1023
	R	marked as 'root'
	B	marked as using bad144 

-- 
Poul-Henning Kamp           | phk@FreeBSD.ORG       FreeBSD Core-team.
http://www.freebsd.org/~phk | phk@login.dknet.dk    Private mailbox.
whois: [PHK]                | phk@ref.tfs.com       TRW Financial Systems, Inc.
Just that: dried leaves in boiling water ?



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