From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,f292381bae31f0f6 X-Google-Attributes: gid1164f8,public From: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.) Subject: Re: Disktab Entry for 4GB IBM Disk? Date: 1995/05/05 Message-ID: <3obrkc$hmn@nntpd2.cxo.dec.com>#1/1 X-Deja-AN: 101996812 distribution: world references: <3o3vqc$pn@quandong.itd.adelaide.edu.au> organization: Digital Equipment Corporation reply-to: alan@nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.) newsgroups: comp.sys.dec In article <3o3vqc$pn@quandong.itd.adelaide.edu.au>, Trevor Coulson 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 #include #include #include #include #include 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