Subject: Re: disklabel - where is it physically?
To: None <port-i386@NetBSD.ORG, vax@linkdead.paranoia.com>
From: Hiroyuki Ito <hiroy@netcom.com>
List: port-i386
Date: 03/24/1996 07:47:55
> Where exactly does the disklabel reside?  At the beginning of the "a"
> or "c" partition?  What sectors relative to the beginning?

% disklabel sd0 | egrep '^#|^  [ac]:'
# /dev/rsd0d:
#        size   offset    fstype   [fsize bsize   cpg]
  a:    65536   491520    4.2BSD     1024  8192    16   # (Cyl.  240 - 271)
  c:  3686400   491520    unused        0     0         # (Cyl.  240 - 2039)
% dd if=/dev/sd0d of=xxx skip=491521 count=1
1+0 records in
1+0 records out
512 bytes transferred in 1 secs (512 bytes/sec)
% cat fff
"%06_ax:" 16/1 " %02x"
"  " "%_p"
"\n"
% hexdump -f fff xxx
000000: 57 45 56 82 04 00 00 00 6d 79 73 64 00 00 00 00  WEV.....mysd....
000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000020: 00 00 00 00 00 00 00 00 00 02 00 00 20 00 00 00  ............ ...
000030: 40 00 00 00 f8 07 00 00 00 08 00 00 00 c0 3f 00  @.............?.
000040: 00 00 00 00 00 00 00 00 10 0e 01 00 00 00 00 00  ................
000050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
*
000080: 00 00 00 00 57 45 56 82 b0 54 08 00 00 20 00 00  ....WEV..T... ..
000090: 00 20 00 00 00 00 01 00 00 80 07 00 00 04 00 00  . ..............
0000a0: 07 08 10 00 00 80 01 00 00 80 08 00 00 00 00 00  ................
0000b0: 01 00 00 00 00 40 38 00 00 80 07 00 00 00 00 00  .....@8.........
0000c0: 00 00 00 00 00 c0 3f 00 00 00 00 00 00 00 00 00  ......?.........
0000d0: 00 00 00 00 00 00 26 00 00 00 0a 00 00 04 00 00  ......&.........
0000e0: 07 08 10 00 00 c0 08 00 00 00 32 00 00 02 00 00  ..........2.....
0000f0: 07 08 08 00 e0 bf 03 00 20 00 00 00 00 00 00 00  ........ .......
000100: 08 00 00 00 e0 bf 03 00 20 c0 03 00 00 00 00 00  ........ .......
000110: 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
*
% grep DISKMAGIC /usr/include/sys/disklabel.h
#define DISKMAGIC       ((u_int32_t)0x82564557) /* The disk magic number */
% 

Hiroyuki Ito