which raw partitions on a disk ?

which raw partitions on a disk ?

Post by Douglas Fairclo » Thu, 17 Nov 1994 06:38:35



hello!  I am wondering how you can map raw scsi partitions to
disk devices as they appear in iostat & /var/adm/messages.

for example, in /dev/rdsk I have entries of the form :

c0t0d0s0  c0t2d0s4  c1t0d0s0  c1t2d0s4  c2t1d0s0  c2t3d0s4  c3t2d0s0
c0t0d0s1  c0t2d0s5  c1t0d0s1  c1t2d0s5  c2t1d0s1  c2t3d0s5  c3t2d0s1
c0t0d0s2  c0t2d0s6  c1t0d0s2  c1t2d0s6  c2t1d0s2  c2t3d0s6  c3t2d0s2
c0t0d0s3  c0t2d0s7  c1t0d0s3  c1t2d0s7  c2t1d0s3  c2t3d0s7  c3t2d0s3
c0t0d0s4  c0t3d0s0  c1t0d0s4  c1t3d0s0  c2t1d0s4  c3t0d0s0  c3t2d0s4
c0t0d0s5  c0t3d0s1  c1t0d0s5  c1t3d0s1  c2t1d0s5  c3t0d0s1  c3t2d0s5
c0t0d0s6  c0t3d0s2  c1t0d0s6  c1t3d0s2  c2t1d0s6  c3t0d0s2  c3t2d0s6
c0t0d0s7  c0t3d0s3  c1t0d0s7  c1t3d0s3  c2t1d0s7  c3t0d0s3  c3t2d0s7
c0t1d0s0  c0t3d0s4  c1t1d0s0  c1t3d0s4  c2t2d0s0  c3t0d0s4  c3t3d0s0
c0t1d0s1  c0t3d0s5  c1t1d0s1  c1t3d0s5  c2t2d0s1  c3t0d0s5  c3t3d0s1
c0t1d0s2  c0t3d0s6  c1t1d0s2  c1t3d0s6  c2t2d0s2  c3t0d0s6  c3t3d0s2
c0t1d0s3  c0t3d0s7  c1t1d0s3  c1t3d0s7  c2t2d0s3  c3t0d0s7  c3t3d0s3
c0t1d0s4  c0t6d0s0  c1t1d0s4  c2t0d0s0  c2t2d0s4  c3t1d0s0  c3t3d0s4
c0t1d0s5  c0t6d0s1  c1t1d0s5  c2t0d0s1  c2t2d0s5  c3t1d0s1  c3t3d0s5
c0t1d0s6  c0t6d0s2  c1t1d0s6  c2t0d0s2  c2t2d0s6  c3t1d0s2  c3t3d0s6
c0t1d0s7  c0t6d0s3  c1t1d0s7  c2t0d0s3  c2t2d0s7  c3t1d0s3  c3t3d0s7
c0t2d0s0  c0t6d0s4  c1t2d0s0  c2t0d0s4  c2t3d0s0  c3t1d0s4
c0t2d0s1  c0t6d0s5  c1t2d0s1  c2t0d0s5  c2t3d0s1  c3t1d0s5
c0t2d0s2  c0t6d0s6  c1t2d0s2  c2t0d0s6  c2t3d0s2  c3t1d0s6
c0t2d0s3  c0t6d0s7  c1t2d0s3  c2t0d0s7  c2t3d0s3  c3t1d0s7

and from iostat -x I have output of the form :

                                 extended disk statistics
disk      r/s  w/s   Kr/s   Kw/s wait actv  svc_t  %w  %b
sd0       0.2  0.3    1.2    2.7  0.0  0.0   58.2   0   1
sd1       0.1  0.1    0.8    0.6  0.0  0.0   29.2   0   0
sd2       0.0  0.0    0.1    0.2  0.0  0.0   19.2   0   0
sd3       0.0  0.0    0.0    0.0  0.0  0.0    1.4   0   0
sd30      0.1  1.5    1.1    7.7  0.0  0.0   21.5   0   2
sd31      0.2  0.4    1.2    0.8  0.0  0.0   11.1   0   1
sd32      0.0  0.2    0.7    7.0  0.0  0.0  160.0   0   0
sd33      5.5  1.7   18.5    3.5  0.0  0.1    8.0   0   4
sd45      0.0  0.4    0.1    0.8  0.0  0.0   12.5   0   0
sd46      0.1  1.7    0.2    3.5  0.0  0.0   16.1   0   2
sd47      1.6  0.1   11.7    3.6  0.0  0.0    5.4   0   1
sd48      0.7  0.0    5.5    0.4  0.0  0.0    4.0   0   0
sd60      0.1  0.0    0.9    0.2  0.0  0.0   82.5   0   0
sd61      0.1  0.0    1.1    0.2  0.0  0.0   84.7   0   0
sd62      0.2  0.0    1.8    0.2  0.0  0.0   57.1   0   0
sd63      0.1  0.0    1.0    0.1  0.0  0.0   68.4   0   0

any know how to make the connection ??

doug

 
 
 

which raw partitions on a disk ?

Post by Adrian Cockcroft - SMCC Product Marketing Engineeri » Fri, 25 Nov 1994 06:44:40


[this posting was delayed a few days by my local NNTP feed having an overfull disk,
so I couldn't post it]

Quote:>hello!  I am wondering how you can map raw scsi partitions to
>disk devices as they appear in iostat & /var/adm/messages.

Try this script, I call it whatdev.

#!/bin/csh
# print out the drive name - st0 or sd0 - given the /dev entry

set dev = `/bin/ls -l $1 | nawk '{ n = split($11, a, "/"); split(a[n],b,":"); for(i = 4; i < n; i++) printf("/%s",a[i]); printf("/%s\n", b[1]) }'`
if ($dev == "") exit
# then get the instance number and concatenate with the "sd"

% foreach file (/dev/rdsk/*s2)
? echo $file -- `whatdev $file`
? end
/dev/rdsk/c0t0d0s2 -- sd0
/dev/rdsk/c0t3d0s2 -- sd3
%

One other way to tell is to work out what kind of device it is, e.g. if you
know it is a SCSI disk (not IPI or some other type of device) you can then
look at the minor device number and divide by 8 to get the "sd" number.

I always use s2 since it should always exist, there are 8 minor device numbers
for each drive, one per slice/partition.

% ls -lL /dev/rdsk/*s2
crw-r-----   1 root     sys       32,  2 Sep 10  1993 /dev/rdsk/c0t0d0s2
crw-r-----   1 root     sys       32, 26 Sep 10  1993 /dev/rdsk/c0t3d0s2

2/8 = 0 so sd0
26/8 = 3 so sd3

Please note that I think this is horrible as well, but we seem to be stuck with
it.

regards Adrian

---

SMCC Product Marketing Engineering - Phone 415 336 0615 - Fax 415 336 0648
Sun Microsystems, 2550 Garcia Avenue, Mountainview, CA 94043, USA

 
 
 

1. Help! - Need to mmap() raw disk partition

Merry Xmas to all,

I need to access a raw disk partition for
read/write as a linear space, and hopefully by
mmap (file memory mapping).  Does Linux 2.2
support either of these methods?  The partition
size is anywhere from 1 GB to 3 GB.

Any help would be greatly appreciated.

Thanks in advance.

(I tried to search Deja, but ever since they
massacred the GUI, it is impossible to find
anything anymore.)

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Where do I put in these commands in the Startup Directories?

3. Raw disk copies including partition tables

4. UUCP and SMTP in Linux Sendmail??

5. Support of Raw Disk Partitions

6. IS anyone reading users' complaints?

7. RAW disk partition: chunk manager src?

8. 2.2.6 net performance and panic with 1000's of sockets open

9. Opening disk partition in raw mode

10. Help! - Need to mmap() raw disk partition

11. support for Raw Disk partitions

12. Raw disk partition access and mmap

13. Use of 3rd partition when entire disk is raw.