Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Albert.Rommel@t-online.de (Albert Rommel)
Subject: Re: Disktab entry for 2GB Seagate
Date: 1997/02/15	[thread overview]
Message-ID: <5e5d02$u5b@news00.btx.dtag.de> (raw)
In-Reply-To: 3302355C.2E0E@cchem.berkeley.edu


On Wed, 12 Feb 1997 13:25:48 -0800, Jay Weiland
<jweiland@cchem.berkeley.edu> wrote:

> How could I find this disktab entry, ...

> Some readers of my answer could not decode the attachment,
> so I will repost the answer including the source...

Well, try the small program (diskparms.c) at end of the text:

o	Compile it
o	connect disk to DECstation
o	if not already done: create device driver
	entries in /dev using MAKEDEV
o	run program with the raw device name
	of the 'a'-Partition (like /dev/rrz2a)

The progam will show all necessary parameters
to build a disktab entry. Moreover: it displays
either a found partition table or a default one.

This program works fine on ULTRIX. I do not know,
whether it will so on OSF. It references a header
file called disktab.h, which may be not installed
on your system. So I appended my version after
program diskparms.c...

Albert Rommel                        | CIM-Team GmbH
Stoettener Berg 38, 73312 Geislingen | Neue Gasse 10, 89079 Ulm/Donau
Tel:   07331/69386  FAX: 07331/69387 | 0731/93787-0 FAX: 0731/93787-22
mailto:albert.rommel@t-online.de     | mailto:albert.rommel@cim-team.de

--- diskparms.c --------------------------------------------------------

#include	<stdio.h>
#include	<disktab.h>

main( int argc, char **argv )
{
	int	i	= 0;
	
	struct disktab *d = creatediskbyname( argv[1] );
	if( ! d )
	{	fprintf( stderr, "No info got for '%s'\n", argv[1] );
		exit( 0 );
	}
	
	printf( "name:		%s\n",		d->d_name );
	printf( "type:		%s\n",		d->d_type );
	printf( "secsize:	%10d\n",	d->d_secsize );
	printf( "ntracks:	%10d\n",	d->d_ntracks );
	printf( "nsectors:	%10d\n",	d->d_nsectors );
	printf( "ncylinders:	%10d\n",	d->d_ncylinders );
	printf( "rpm:		%10d\n",	d->d_rpm );

	printf( "\n" );	
	printf( "Partition	size	bsize	fsize\n" );
	printf( "------------------------------------------\n" );

	for( i = 0; i < 8; i++ )
	{	struct partition *p = &(d->d_partitions[ i ]);
		printf( "%c:		%6d	%6d	%6d\n",
			'a'+i, p->p_size, p->p_bsize, p->p_fsize );
	}
}

---------- disktab.h --------------------------------------------------

/*
 * 	@(#)disktab.h	6.1	(ULTRIX)	11/19/91
 */

/**************************************************************************
 *
 *	Modification History
 *
 * 13-Sep-89	Tim Burke
 *	Added "struct  disktab *creatediskbyname();"
 */

/*
 * Disk description table, see disktab(5)
 */
#define	DISKTAB		"/etc/disktab"

struct	disktab {
	char	*d_name;		/* drive name */
	char	*d_type;		/* drive type */
	int	d_secsize;		/* sector size in bytes */
	int	d_ntracks;		/* # tracks/cylinder */
	int	d_nsectors;		/* # sectors/track */
	int	d_ncylinders;		/* # cylinders */
	int	d_rpm;			/* revolutions/minute */
	struct	partition {
		int	p_size;		/* #sectors in partition */
		short	p_bsize;	/* block size in bytes */
		short	p_fsize;	/* frag size in bytes */
	} d_partitions[8];
};

struct	disktab *getdiskbyname();
struct  disktab *creatediskbyname();

-----------------------------------------------------------------------
Albert Rommel                        | CIM-Team GmbH
Stoettener Berg 38, 73312 Geislingen | Neue Gasse 10, 89079 Ulm/Donau
Tel:   07331/69386  FAX: 07331/69387 | 0731/93787-0 FAX: 0731/93787-22
mailto:albert.rommel@t-online.de     | mailto:albert.rommel@cim-team.de



      parent reply	other threads:[~1997-02-15  5:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-12  5:00 Disktab entry for 2GB Seagate Jay Weiland
1997-02-13  5:00 ` Disktab entry for 2GB Seagate - t.c (1/1) Albert Rommel
1997-02-13  5:00 ` Disktab entry for 2GB Seagate - t.c (0/1) Albert Rommel
1997-02-15  5:00 ` Albert Rommel [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox