* Disktab Entry for 4GB IBM Disk?
@ 1995-05-02 4:00 Trevor Coulson
1995-05-05 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
0 siblings, 1 reply; 2+ messages in thread
From: Trevor Coulson @ 1995-05-02 4:00 UTC (permalink / raw)
Hi,
Has anyone figured out a "/etc/disktab" entry for an IBM 4GB hard disk
drive? If so, could you email it to me? Also, does anyone have a command, under
OSF, which returns the geomtry information for a hard disk (which communicates
directly with the SCSI device). I do not have the specifications for this IBM
drive.
Anyone out there who can help? Thanks in advance.
Trevor.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Disktab Entry for 4GB IBM Disk?
1995-05-02 4:00 Disktab Entry for 4GB IBM Disk? Trevor Coulson
@ 1995-05-05 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
0 siblings, 0 replies; 2+ messages in thread
From: Alan Rollow - Dr. File System's Home for Wayward Inodes. @ 1995-05-05 4:00 UTC (permalink / raw)
In article <3o3vqc$pn@quandong.itd.adelaide.edu.au>, Trevor Coulson <maptek@wattle.itd.adelaide.edu.au> writes:
Gotta get this in the FAQ if it isn't already...
>
>Hi,
> Has anyone figured out a "/etc/disktab" entry for an IBM 4GB hard disk
>drive?
No, but you can let disklabel(8) figure out most of the information
it needs by asking the disk (I assume this is for Digital UNIX). If
disklabel doesn't find the disktype in /etc/disktab, then it will
use the DEVGETGEOM I/O control (devio(7) manual page) to get the
geometry from the disk. It uses a different I/O control code to
get the default partition table. Once labeled you can flavor to
taste.
On ULTRIX the newfs(8) command will do the same thing on any V4
version if it doesn't find the disk name in disktab.
>If so, could you email it to me? Also, does anyone have a command, under
>OSF, which returns the geomtry information for a hard disk (which communicates
>directly with the SCSI device).
I don't know of a program on the distribution that uses the DEVGETGEOM,
but one is relatively easy to write. I have a program that does it,
which I'll include at the end of the follow-up. It should work on
both ULTRIX and Digital UNIX.
>I do not have the specifications for this IBM drive.
You can also use the scu(8) command to show the contents of selected
SCSI mode pages. One of them is bound to have the fixed geometry
information in it. If it is in the formst that scu(8) expects it
should be a reasonable job of formatting the page. I think you
want:
# scu -f special-file show page rigid
> Anyone out there who can help? Thanks in advance.
/*
* Author: Alan Rollow, DBS/SRM, Digital Equipment Corp.
* File: geometry.c
* Date: 11/29/91
* Version: 1.2
*
* geometry.c - Print the disk geometry. Currently under construction having
* only taken the base code from devget.c.
*/
#ifndef lint
static char SccsId[] = "@(#)geometry.c 1.2 (DEVGETGEOM) 11/29/91" ;
#endif
#include <sys/types.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/devio.h>
#include <stdio.h>
#include <errno.h>
main(argc, argv)
int argc ;
char *argv[] ;
{
register i, fd, save ;
union devgeom data ;
char *progname ;
progname = argv[0] ;
for(i = 1; i < argc; i++) {
if((fd = open(argv[i], O_RDONLY|O_NONBLOCK)) == -1 ) {
fprintf(stderr, "%s: Can't open %s: %s.\n", progname,
argv[i], strerror(errno)) ;
continue ;
}
if( ioctl(fd, DEVGETGEOM, &data) == -1 ) {
save = errno ;
printf("%s: IOctl(DEVGETGEOM) failed on %s: %s.\n", progname,
argv[i], strerror(save)) ;
}
else
print_geom(argv[i], &data) ;
close(fd) ;
}
}
print_geom(dev, p)
char *dev ;
union devgeom *p ;
{
printf("%s:\n", dev) ;
printf("Device size: %d\n", p->geom_info.dev_size) ;
printf("Tracks/cylinder: %d\n", p->geom_info.ntracks) ;
printf("Sectors/track: %d\n", p->geom_info.nsectors) ;
printf("Cylinders: %d\n", p->geom_info.ncylinders) ;
printf("Attributes: %x\n", p->geom_info.attributes) ;
}
>
> Trevor.
>
>
--
Alan Rollow alan@nabeth.cxo.dec.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1995-05-05 4:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-05-02 4:00 Disktab Entry for 4GB IBM Disk? Trevor Coulson
1995-05-05 4:00 ` Alan Rollow - Dr. File System's Home for Wayward Inodes.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox