1dkio(7I)                        Ioctl Requests                        dkio(7I)
2
3
4

NAME

6       dkio - disk control operations
7

SYNOPSIS

9       #include <sys/dkio.h>
10       #include <sys/vtoc.h>
11
12

DESCRIPTION

14       Disk  drivers  support  a set of ioctl(2) requests for disk controller,
15       geometry, and partition information. Basic to  these  ioctl()  requests
16       are the definitions in <sys/dkio.h>.
17

IOCTLS

19       The  following  ioctl()  requests  set and/or retrieve the current disk
20       controller, partitions, or geometry information on all architectures:
21
22       DKIOCINFO
23
24           The argument is  a  pointer  to  a  dk_cinfo  structure  (described
25           below).  This  structure  tells  the controller-type and attributes
26           regarding bad-block processing done on the controller.
27
28
29         /*
30          * Structures and definitions for disk I/O control commands
31          */
32         #define DK_DEVLEN 16   /* device name max length, */
33                                /* including unit # and NULL */
34                                /* Used for controller info */
35         struct dk_cinfo {
36              char      dki_cname[DK_DEVLEN];    /* controller name */
37                                                 /* (no unit #) */
38              ushort_t  dki_ctype;               /* controller type */
39              ushort_t  dki_flags;               /* flags */
40              ushort_t  dki_cnum;                /* controller number */
41              uint_t    dki_addr;                /* controller address */
42              uint_t    dki_space;               /* controller bus type */
43              uint_t    dki_prio;                /* interrupt priority */
44              uint_t    dki_vec;                 /* interrupt vector */
45              char      dki_dname[DK_DEVLEN];    /* drive name (no unit #) */
46              uint_t    dki_unit;                /* unit number */
47              uint_t    dki_slave;               /* slave number */
48              ushort_t  dki_partition;           /* partition number */
49              ushort_t  dki_maxtransfer;         /* maximum transfer size */
50                                                 /* in DEV_BSIZE */
51
52              };
53              /*
54               * Controller types
55               */
56
57              #define DKC_UNKNOWN      0
58              #define DKC_CDROM        1         /* CD-ROM, SCSI or other */
59              #define DKC_WDC2880      2
60              #define DKC_XXX_0        3         /* unassigned */
61              #define DKC_XXX_1        4         /* unassigned */
62              #define DKC_DSD5215      5
63              #define DKC_ACB4000      7
64              #define DKC_XXX_2        9         /* unassigned */
65              #define DKC_NCRFLOPPY    10
66              #define DKC_SMSFLOPPY    12
67              #define DKC_SCSI_CCS     13        /* SCSI CCS compatible */
68              #define DKC_INTEL82072   14        /* native floppy chip */
69              #define DKC_MD           16        /* meta-disk (virtual-disk) */
70                                                 /* driver */
71              #define DKC_INTEL82077   19        /* 82077 floppy disk */
72                                                 /* controller */
73              #define DKC_DIRECT       20        /* Intel direct attached */
74                                                 /* device (IDE) */
75              #define DKC_PCMCIA_MEM   21        /* PCMCIA memory disk-like */
76                                                 /* type */
77              #define DKC_PCMCIA_ATA   22        /* PCMCIA AT Attached type */
78
79              /*
80               * Sun reserves up through 1023
81               */
82
83              #define DKC_CUSTOMER_BASE  1024
84
85              /*
86               * Flags
87               */
88
89              #define DKI_BAD144       0x01          /* use  DEC  std  144  */
90                                                     /* bad  sector fwding */
91              #define DKI_MAPTRK       0x02          /* controller does */
92                                                     /* track mapping */
93              #define DKI_FMTTRK       0x04          /* formats only  full
94                                                     /* track at a time*/
95              #define DKI_FMTVOL       0x08          /* formats only full */
96                                                     /* volume at a time*/
97              #define DKI_FMTCYL       0x10          /* formats only full */
98                                                     /* cylinders at a time*/
99              #define DKI_HEXUNIT      0x20          /* unit number printed as */
100                                                     /* 3 hexdigits */
101              #define DKI_PCMCIA_PFD   0x40          /* PCMCIA pseudo-floppy */
102                                                     /* memory card */
103
104
105       DKIOCGAPART
106
107           The argument is a  pointer  to  a  dk_allmap  structure  (described
108           below).  This  ioctl()  gets the controller's notion of the current
109           partition table for disk drive.
110
111
112       DKIOCSAPART
113
114           The argument is a  pointer  to  a  dk_allmap  structure  (described
115           below).  This ioctl() sets the controller's notion of the partition
116           table without changing the disk itself.
117
118
119         /*
120          * Partition map (part of dk_label)
121          */ struct dk_map {
122              daddr_t dkl_cylno;     /* starting cylinder */
123              daddr_t dkl_nblk;      /* number of blocks */
124              };
125         /*
126          * Used for all partitions
127          */
128         struct dk_allmap {
129             struct dk_map    dka_map[NDKMAP];
130         };
131
132
133       DKIOCGGEOM    The  argument  is  a  pointer  to  a  dk_geom   structure
134                     (described  below).  This  ioctl()  gets the controller's
135                     notion of the current geometry of the disk drive.
136
137
138       DKIOCSGEOM    The  argument  is  a  pointer  to  a  dk_geom   structure
139                     (described  below).  This  ioctl()  sets the controller's
140                     notion of the geometry without changing the disk itself.
141
142
143       DKIOCGVTOC    The argument is a pointer to a vtoc structure  (described
144                     below).  This ioctl() returns the device's current volume
145                     table of contents (VTOC.)  For  disks  larger  than  1TB,
146                     DKIOCGEXTVTOC must be used instead.
147
148
149       DKIOCSVTOC    The  argument is a pointer to a vtoc structure (described
150                     below). This ioctl() changes the VTOC associated with the
151                     device.  For disks larger than 1TB, DKIOCSEXTVTOC must be
152                     used instead.
153
154
155         struct partition {
156         ushort_t      p_tag;         /* ID tag of partition */
157         ushort_t      p_flag;        /* permission flags */
158         daddr_t       p_start;       /* start sector of partition */
159         long          p_size;        /* # of blocks in partition */
160         };
161
162
163
164       If DKIOCSVTOC is used with a floppy diskette, the p_start field must be
165       the  first  sector  of a cylinder. To compute the number of sectors per
166       cylinder, multiply the number of heads by the  number  of  sectors  per
167       track.
168
169         struct vtoc {
170         unsigned long     v_bootinfo[3];               /* info needed by mboot
171                                                        /* (unsupported)*/
172         unsigned long     v_sanity;                    /* to verify vtoc */
173                                                        /* sanity */
174         unsigned long     v_version;                   /* layout version */
175         char              v_volume[LEN_DKL_VVOL];      /* volume name */
176         ushort_t          v_sectorsz;
177              sector size in bytes*/
178         ushort_t          v_nparts;
179              number of partitions*/
180         unsigned long     v_reserved[10];              /* free space */
181         struct partition  v_part[V_NUMPAR];            /* partition headers */
182         time_t            timestamp[V_NUMPAR];         /* partition timestamp */
183                                                        /* (unsupported) */
184         char              v_asciilabel[LEN_DKL_ASCII]; /* compatibility */
185         };
186
187         /*
188         * Partition permission flags
189         */
190
191         #define V_UNMNT      0x01    /* Unmountable partition */
192         #define V_RONLY      0x10    /* Read only */
193
194         /*
195         * Partition identification tags
196         */
197
198         #define V_UNASSIGNED   0x00  /* unassigned partition */
199         #define V_BOOT         0x01  /* Boot partition */
200         #define V_ROOT         0x02  /* Root filesystem */
201         #define V_SWAP         0x03  /* Swap filesystem */
202         #define V_USR          0x04  /* Usr filesystem */
203         #define V_BACKUP       0x05  /* full disk */
204         #define V_VAR          0x07  /* Var partition */
205         #define V_HOME         0x08  /* Home partition */
206         #define V_ALTSCTR      0x09  /* Alternate sector partition */
207
208
209       DKIOCGEXTVTOC
210
211           The  argument  is  a  pointer  to  an  extvtoc structure (described
212           below). This ioctl returns the device's  current  volume  table  of
213           contents  (VTOC).  VTOC  is extended to support a disk up to 2TB in
214           size. For disks larger than 1TB this ioctl must be used instead  of
215           DKIOCGVTOC.
216
217
218       DKIOCSEXTVTOC
219
220           The  argument  is  a  pointer  to  an  extvtoc structure (described
221           below). This ioctl changes the VTOC  associated  with  the  device.
222           VTOC  is  extended  to  support a disk up to 2TB in size. For disks
223           larger than 1TB this ioctl must be used instead of DKIOCSVTOC.
224
225             struct extpartition {
226             ushort_t p_tag;         /* ID tag of partition */
227             ushort_t p_flag;        /* permission flags */
228             ushort_t p_pad[2];       /* reserved */
229             diskaddr_t p_start;      /* start sector no of partition */
230             diskaddr_t p_size;       /* # of blocks in partition */
231             };
232
233
234             struct extvtoc {
235             uint64_t   v_bootinfo[3]; /* info needed by mboot (unsupported) */
236             uint64_t   v_sanity;     /* to verify vtoc sanity */
237             uint64_t   v_version;    /* layout version */
238             char    v_volume[LEN_DKL_VVOL]; /* volume name */
239             ushort_t   v_sectorsz;   /* sector size in bytes */
240             ushort_t   v_nparts;     /* number of partitions */
241             ushort_t   pad[2];
242             uint64_t   v_reserved[10];
243             struct extpartition v_part[V_NUMPAR]; /* partition headers */
244             uint64_t timestamp[V_NUMPAR]; /* partition timestamp (unsupported)*/
245             char    v_asciilabel[LEN_DKL_ASCII];    /* for compatibility */
246             };
247
248             Partition permissions flags and identification tags
249             are defined the same as vtoc structure.
250
251
252
253       DKIOCEJECT
254
255           If the drive supports removable media, this  ioctl()  requests  the
256           disk drive to eject its disk.
257
258
259       DKIOCREMOVABLE
260
261           The  argument  to this ioctl() is an integer. After successful com‐
262           pletion, this ioctl() sets that integer to a non-zero value if  the
263           drive  in  question has removable media. If the media is not remov‐
264           able, the integer is set to 0.
265
266
267       DKIOCHOTPLUGGABLE
268
269           The argument to this ioctl() is an integer. After  successful  com‐
270           pletion,  this ioctl() sets that integer to a non-zero value if the
271           drive in question is hotpluggable. If the  media  is  not  hotplug‐
272           gable, the integer is set to 0.
273
274
275       DKIOCSTATE
276
277           This  ioctl()  blocks  until  the  state  of the drive, inserted or
278           ejected, is changed. The argument is a  pointer  to  a  dkio_state,
279           enum,  whose  possible  enumerations  are listed below. The initial
280           value should be either the last reported state  of  the  drive,  or
281           DKIO_NONE.  Upon  return,  the  enum  pointed to by the argument is
282           updated with the current state of the drive.
283
284             enum dkio_state {
285             DKIO_NONE,          /* Return disk's current state */
286             DKIO_EJECTED,       /* Disk state is 'ejected' */
287             DKIO_INSERTED       /* Disk state is 'inserted' */
288             };
289
290
291
292       DKIOCLOCK
293
294           For devices with removable media, this ioctl()  requests  the  disk
295           drive to lock the door.
296
297
298       DKIOCUNLOCK
299
300           For  devices  with  removable media, this ioctl() requests the disk
301           drive to unlock the door.
302
303
304       DKIOCGMEDIAINFO
305
306           The argument to this ioctl() is a pointer to a dk_minfo  structure.
307           The  structure  indicates the type of media or the command set pro‐
308           file used by the drive to operate on the media. The dk_minfo struc‐
309           ture  also indicates the logical media block size the drive uses as
310           the basic unit block size of operation and the raw formatted capac‐
311           ity of the media in number of logical blocks.
312
313
314       DKIOCGMEDIAINFOEXT
315
316           The  argument to this ioctl() is a pointer to a dk_minfo_ext struc‐
317           ture. The structure indicates the type of media or the command  set
318           profile used by the drive to operate on the media. The dk_minfo_ext
319           structure also indicates the logical media  block  size  the  drive
320           uses  as  the basic unit block size of operation, the raw formatted
321           capacity of the media in number of logical blocks and the  physical
322           block size of the media.
323
324
325         /*
326         * Used for media info or profile info
327         */
328         struct dk_minfo {
329         uint_t dki_media_type; /* Media type or profile info */
330         uint_t dki_lbsize; /* Logical blocksize of media */
331         diskaddr_t dki_capacity; /* Capacity as # of dki_lbsize blks */
332         };
333
334         /*
335         * Used for media info or profile info and physical blocksize
336         */
337         struct dk_minfo_ext {
338         uint_t dki_media_type; /* Media type or profile info */
339         uint_t dki_lbsize; /* Logical blocksize of media */
340         diskaddr_t dki_capacity; /* Capacity as # of dki_lbsize blks */
341         uint_t dki_pbsize; /* Physical blocksize of media */
342         };
343
344
345         /*
346         * Media types or profiles known
347         */
348         #define DK_UNKNOWN         0x00    /* Media inserted - type unknown */
349
350         /*
351         * SFF 8090 Specification Version 3, media types 0x01 - 0xfffe are
352         * retained to maintain compatibility with SFF8090.  The following
353         * define the optical media type.
354         */
355         #define DK_MO_ERASABLE     0x03 /* MO Erasable */
356         #define DK_MO_WRITEONCE    0x04 /* MO Write once */
357         #define DK_AS_MO           0x05 /* AS MO */
358         #define DK_CDROM           0x08 /* CDROM */
359         #define DK_CDR             0x09 /* CD-R */
360         #define DK_CDRW            0x0A /* CD-RW */
361         #define DK_DVDROM          0x10 /* DVD-ROM */
362         #define DK_DVDR            0x11 /* DVD-R */
363         #define DK_DVDRAM          0x12 /* DVD_RAM or DVD-RW */
364
365         /*
366         * Media types for other rewritable magnetic media
367         */
368         #define DK_FIXED_DISK      0x10001 /* Fixed disk SCSI or otherwise */
369         #define DK_FLOPPY          0x10002 /* Floppy media */
370         #define DK_ZIP             0x10003 /* IOMEGA ZIP media */
371         #define DK_JAZ             0x10004 /* IOMEGA JAZ media */
372
373
374
375       If the media exists and the host can obtain a current profile list, the
376       command succeeds and returns the dk_minfo structure  with  data  repre‐
377       senting that media.
378
379
380       If  there  is  no  media  in  the drive, the command fails and the host
381       returns an ENXIO error, indicating that it cannot gather  the  informa‐
382       tion requested.
383
384
385       If the profile list is not available, the host attempts to identify the
386       media-type based on the available information.
387
388
389       If  identification  is  not  possible,  the  host  returns  media  type
390       DK_UNKNOWN. See NOTES for blocksize usage and capacity information.
391
392       DKIOCSMBOOT
393
394           The argument is a pointer to struct mboot.
395
396           Copies  the mboot information supplied in the argument to the abso‐
397           lute sector 0 of the device. Prior to copying the information, this
398           ioctl() performs the following checks on the mboot data:
399
400               o      Ensures that the signature field is set to 0xAA55.
401
402               o      Ensures that partitions do not overlap.
403
404               o      On SPARC platforms, determines if the device is a remov‐
405                      able media.
406           If the above verification fails, errno is set  to  EINVAL  and  the
407           ioctl() command fails.
408
409           x86  Platforms  — Upon successful write of mboot, the partition map
410           structure maintained in the driver is updated. If the  new  Solaris
411           partition is different from the previous one, the internal VTOC ta‐
412           ble maintained in the driver is set as follows:
413
414           If _SUNOS_VTOC_8 is defined:
415
416           Partition: 0. Start: 0. Capacity = Capacity of device.
417
418           Partition: 2. Start: 0. Capacity = Capacity of device.
419
420           If _SUNOS_VTOC_16 is defined:
421
422           Partition: 2. Start: 0. Size = Size specified in mboot -  2  cylin‐
423           ders.
424
425           Partition: 8. Start: 0. Size = Sectors/cylinder.
426
427           Partition: 9. Start: Sectors/cylinder. Size = 2 * sectors/cylinder
428
429           To determine if the Solaris partition has changed:
430
431           If  either offset or the size of the Solaris partition is different
432           from the previous one then it shall be deemed to have  changed.  In
433           all other cases, the internal VTOC info remains as before.
434
435           SPARC  Platforms  —  The  VTOC label and mboot both occupy the same
436           location, namely sector 0. As a result,  following  the  successful
437           write  of  mboot  info,  the  internal VTOC table maintained in the
438           driver is set as follows:
439
440           Partition: 0. Start: 0. Size = Capacity of device.
441
442           Partition: 2. Start: 0. Size = Capacity of device.
443
444           See the NOTES section  for  usage  of  DKIOCSMBOOT  when  modifying
445           Solaris partitions.
446
447
448       DKIOCGETVOLCAP
449
450           This  ioctl  provides information and status of available capabili‐
451           ties.
452
453           vc_info is a bitmap and the valid flag values are:
454
455             DKV_ABR_CAP -  Capable of application-based recovery
456             DKV_DMR_CAP -  Ability to read specific copy of data when
457                            multiple copies exist. For example, in a two
458                            way mirror, this ioctl is used to read each
459                            side of the mirror.
460
461           vc_set is a bitmap and the valid flag values are:
462
463             DKV_ABR_CAP - This flag is set if ABR has been set on a device
464                           that supports ABR functionality.
465             DKV_DMR_CAP - Directed read has been enabled.
466
467           These capabilities are not required to be persistent across a  sys‐
468           tem  reboot  and their persistence depends upon the implementation.
469           For example, if the ABR capability for a DRL mirror  simply  clears
470           the  dirty-region  list  and subsequently stops updating this list,
471           there is no reason for persistence because the VM recovery is a no-
472           op.  Conversely, if the ABR capability is applied to a non-DRL mir‐
473           ror to indicate that the VM should not perform a full  recovery  of
474           the mirror following a system crash, the capability must be persis‐
475           tent so that the VM know whether or not to perform recovery.
476
477           Return Errors:
478
479           EINVAL     Invalid device for this operation.
480
481
482           ENOTSUP    Functionality that is attempted to be set  is  not  sup‐
483                      ported.
484
485
486
487       DKIOCSETVOLCAP
488
489           This  ioctl  sets  the  available capabilities for the device. If a
490           capability flag is not set in vc_set, that capability is cleared.
491
492           vc_info flags are ignored
493
494           vc_set valid flags are:
495
496             DKV_ABR_CAP - Flag to set application-based recovery. A device can
497                           successfully support ABR only if it is capable.
498             DKV_DMR_CAP - Flag to set directed read.
499
500
501             int
502             ioctl(int , DKIODMR, vol_directed_rd *);
503
504
505
506       DKIODMR
507
508           This ioctl allows highly available applications to  perform  round-
509           robin reads from the underlying devices of a replicated device.
510
511             vdr_offset      - offset at which the read should occur.
512             vdr_nbytes      - number of bytes to be read
513             vdr_bytesread   - number of bytes successfully read by the kernel.
514             vdr_data        - pointer to a user allocated buffer to return the
515                               data read
516             vdr_side        - side to be read. Initialized to DKV_SIDE_INIT
517             vdr_side_name   - The volume name that has been read.
518
519             Valid vdr_flags are:
520                   DKV_DMR_NEXT_SIDE (set by user)
521                   DKV_DMR_DONE (return value)
522                   DKV_DMR_ERROR (return value)
523                   DKV_DMR_SUCCESS(return value)
524                   DKV_DMR_SHORT(return value)
525
526           The  calling  sequence is as follows: The caller sets the vdr_flags
527           to DK_DMR_NEXT_SIDE and vdr_side to  DKV_SIDE_INIT  at  the  start.
528           Subsequent  calls  should be made without any changes to these val‐
529           ues. If they are changed the results of the  ioctl  are  indetermi‐
530           nate.
531
532           When  DKV_SIDE_INIT  is set, the call results in the kernel reading
533           from the first side. The kernel updates vdr_side  to  indicate  the
534           side  that  was read, and vdr_side_name to contain the name of that
535           side. vdr_data contains the data that was read. Therefore  to  per‐
536           form  a  round-robin  read all of the valid sides, there is no need
537           for the caller to change the contents of vdr_side.
538
539           Subsequent ioctl calls result in reads from  the  next  valid  side
540           until  all  valid sides have been read. On success, the kernel sets
541           DKV_DMR_SUCCESS. The following table shows the values of  vdr_flags
542           that are returned when an error occurs:
543
544             vdr_flags    |   vdr_side        |       Notes
545             -------------|-------------------|----------------------------
546             DKV_DMR_ERROR|   DKV_SIDE_INIT   |   No valid side to read
547             DKV_DMR_DONE |   Not Init side   |   All valid sides read
548             DKV_DMR_SHORT|   Any value       |   Bytes requested cannot
549                                                  be read. vdr_bytesread
550                                                  set to bytes actually
551                                                  read.
552
553
554             Typical code fragment:
555
556             enable->vc_set |= DKV_ABR_SET;
557             retval = ioctl(filedes, DKIOSETVOLCAP, enable);
558             if (retval != EINVAL || retval != ENOTSUP) {
559                     if (info->vc_set & DKV_DMR_SET) {
560                             dr->vdr_flags |= DKV_DMR_NEXT_SIDE;
561                             dr->vdr_side = DKV_SIDE_INIT;
562                             dr->vdr_nbytes = 1024;
563                             dr->vdr_offset = 0xff00;
564                             do {
565                                     rval =ioctl(fildes, DKIODMR, dr);
566                                     if (rval != EINVAL) {
567                                             /* Process data */
568                                     }
569                             } while (rval != EINVAL || dr->vdr_flags &
570                                 (DKV_DMR_DONE | DKV_DMR_ERROR | DKV_DMR_SHORT)
571                     }
572             }
573
574
575
576   RETURN VALUES
577       Upon  successful  completion, the value returned is 0. Otherwise, -1 is
578       returned and errno is set to indicate the error.
579
580   x86 Only
581       The following ioctl() requests set and/or  retrieve  the  current  disk
582       controller,  partitions,  or  geometry information on the x86 architec‐
583       ture.
584
585       DKIOCG_PHYGEOM
586
587           The argument is a pointer to a dk_geom structure (described below).
588           This  ioctl()  gets the driver's notion of the physical geometry of
589           the disk drive. It is  functionally  identical  to  the  DKIOCGGEOM
590           ioctl().
591
592
593       DKIOCG_VIRTGEOM
594
595           The argument is a pointer to a dk_geom structure (described below).
596           This ioctl() gets the controller's (and hence the driver's)  notion
597           of  the  virtual  geometry of the disk drive. Virtual geometry is a
598           view of the disk geometry maintained by the firmware in a host  bus
599           adapter  or  disk  controller. If the disk is larger than 8 Gbytes,
600           this ioctl fails because a CHS-based geometry is  not  relevant  or
601           useful for this drive.
602
603
604         /*
605         * Definition of a disk's geometry
606         */
607         */struct dk_geom {
608         unsigned shor    dkg_ncyl;             /* # of data cylinders */
609         unsigned shor    dkg_acyl;             /* # of alternate cylinders */
610         unsigned short   dkg_bcyl;             /* cyl offset (for fixed head */
611                                                /* area) */
612         unsigned short   dkg_nhead;            /* # of heads */
613         unsigned short   dkg_obs1;             /* obsolete */
614         unsigned short   dkg_nsect;            /* # of sectors per track*/
615         unsigned short   dkg_intrlv;           /* interleave factor */
616         unsigned short   dkg_obs2;             /* obsolete */
617         unsigned short   dkg_obs3;             /* obsolete */
618         unsigned short   dkg_apc;              /* alternates per cylinder */
619                                                /* (SCSI only) */
620         unsigned short   dkg_rpm;              /* revolutions per min*/
621         unsigned short   dkg_pcyl;             /* # of physical cylinders */
622         unsigned short   dkg_write_reinstruct; /* # sectors to skip, writes*/
623         unsigned short   dkg_read_reinstruct;  /* # sectors to skip, reads*/
624         unsigned short   dkg_extra[7];         /* for compatible expansion*/
625         };
626
627
628       DKIOCADDBAD
629
630           This  ioctl()  forces the driver to re-examine the alternates slice
631           and rebuild the internal bad block map accordingly.  It  should  be
632           used  whenever  the alternates slice is changed by any method other
633           than the addbadsec(1M) or  format(1M)  utilities.  DKIOCADDBAD  can
634           only be used for software remapping on  IDE drives; SCSI drives use
635           hardware remapping of alternate sectors.
636
637
638       DKIOCPARTINFO
639
640           The argument is a  pointer  to  a  part_info  structure  (described
641           below).  This  ioctl()  gets  the  driver's  notion of the size and
642           extent of the partition or slice indicated by the  file  descriptor
643           argument.
644
645             /*
646              * Used by applications to get partition or slice information
647              */
648             struct part_info {
649             daddr_t    p_start;
650             int        p_length;
651                   };
652
653
654
655       DKIOCEXTPARTINFO
656
657           The  argument  is a pointer to an extpart_info structure (described
658           below). This ioctl gets the driver's notion of the size and  extent
659           of  the  partition  or slice indicated by the file descriptor argu‐
660           ment. On disks larger than 1TB, this ioctl must be used instead  of
661           DKIOCPARTINFO.
662
663             /*
664             * Used by applications to get partition or slice information
665             */
666             struct extpart_info {
667             diskkaddr_t      p_start;
668             diskaddr_t       p_length;
669             };
670
671
672
673       DKIOCSETEXTPART
674
675           This  ioctl  is  used  to  update the in-memory copy of the logical
676           drive information maintained by the  driver.  The  ioctl  takes  no
677           arguments.  It  causes  a  re-read of the partition information and
678           recreation of minor nodes if required. Prior to updating  the  data
679           structures,  the  ioctl ensures that the partitions do not overlap.
680           Device nodes are created only for valid partition entries. If there
681           is any change in the partition offset, size or ID from the previous
682           read, the partition is deemed to have been changed  and  hence  the
683           device  nodes are recreated. Any modification to any of the logical
684           partitions results in the recreation of all logical device nodes.
685
686

SEE ALSO

688       addbadsec(1M), fdisk(1M),  format(1M),  ioctl(2),  cdio(7I),  cmdk(7D),
689       fdio(7I), hdio(7I), sd(7D)
690

NOTES

692       Blocksize  information  provided  in  DKIOCGMEDIAINFO  is  the size (in
693       bytes) of the device's basic unit of operation and can differ from  the
694       blocksize  that  the Solaris operating environment exports to the user.
695       Capacity information provided in the DKIOCGMEDIAINFO are for  reference
696       only  and  you  are advised to use the values returned by DKIOCGGEOM or
697       other appropriate ioctl for accessing data using  the  standard  inter‐
698       faces.
699
700
701       For  x86 only: If the DKIOCSMBOOT command is used to modify the Solaris
702       partitions, the VTOC information should also be  set  appropriately  to
703       reflect  the changes to partition. Failure to do so leads to unexpected
704       results when the device is closed and reopened fresh at a  later  time.
705       This is because a default VTOC is assumed by driver when a Solaris par‐
706       tition is changed. The default VTOC persists until the ioctl DKIOCSVTOC
707       is  called to modify VTOC or the device is closed and reopened. At that
708       point, the old valid VTOC is read from the disk if it is  still  avail‐
709       able.
710
711
712
713SunOS 5.11                        3 Aug 2009                          dkio(7I)
Impressum