dp(1M) dp(1M)NAME dp - performs disk partitioning SYNOPSIS dp [-q] [-u] device-file ARGUMENTS device-file Specifies a device-file for slice 31 of the disk to be partitioned. (Slice 31 provides access to the entire contents of the disks, not just one partition) It is also possible to specify a normal file rather than a device file. In such a case, the information in the partition-map area of the disk remains intact, while you update the normal file with information that must exist in the partition map to be effective. -q Specifies that dp should not prompt for input. -u Causes output to be unbuffered. DESCRIPTION dp performs disk partitioning and disk block zero manipulation for the device file you specify. Note: This utility does not provide the convenience and safety of the A/UX version of Apple HD SC Setup, a graphical application that performs the essential functions of dp, as well as additional ones. The additional functions of HD SC Setup include initializing a partition with a hierarchical file system (HFS) or a UNIX file system. Furthermore, if you perform disk-partitioning functions from within the A/UX Installer application, which includes its own version of HD SC Setup, additional features are offered. For example, it can update the fstab file (in the root file system you identify to receive installed files) with the mount points for other UNIX file systems on the same disk, or other disks. The dp command can be considered a special-purpose editor; it accepts commands from standard input and performs the specified operations. When you give commands to dp, you can include comments by placing them after a number sign (#) and before a newline character. You do not have to separate commands with newlines-more than one command can be entered at an input prompt. The dp program normally strips white space, but can use the backslash as a leading escape character (\) to preserve white space. This convention is useful when you March 1993 1
dp(1M) dp(1M)are including white space in string input. By placing a leading zero (0) before a number, you cause an octal conversion to take place; by placing a leading 0x or 0X before a number, you cause a hexadecimal conversion to take place; by not placing a leading zero before a number, you cause the number to be interpreted as a normal decimal number. The dp command has some safeguards built in to help avoid destruction or deletion of data. For example, when dp detects a request to delete data, it prompts you for confirmation before the action is performed. You can circumvent these safeguards by specifying certain commands in uppercase; such commands include the words ``forcibly'' in their descriptions. The dp command has the following operation ``modes.'' command DPME-field BZB-field ABM-field timestamp-field Most of these modes determine what data structures the dp command is working on at any given time. For example, in DPME-field mode the fields you alter are the DPME fields for the partition you selected upon entry into that mode. The dp command accepts commands for displaying, adding, deleting, or changing partitions (within command mode), for manipulating the fields of a DPME (disk-partition-map-entry) structure, for manipulating the fields of a BZB (block zero block) structure, for manipulating the timestamp fields of a BZB structure, and for manipulating the fields of an ABM (alternate block map) structure. For more information about these structures, see altblk(4), bzb(4), and dpme(4). The command mode is the mode that you enter first; it is also the mode you return to last before you can quit the dp program; and it is the mode you need in order to use w command to update the disk's partition map with any of the changes you made during the edit session (that you did not already save). You reach the other operating modes by first entering the change partition command in command mode. The change partition command places you in the DPME-field mode of operation, through which you can reach all the other modes. To display a menu containing the list of commands valid for the current mode, use the ? command. To exit a mode, use the q command. 2 March 1993
dp(1M) dp(1M)In command mode, dp accepts the following commands: a Begins a series of steps to add a partition. A Begins a series of steps to forcibly add a partition. c Begins a series of steps to enter DPME-field mode for updating the DPME information for a particular partition. d Begins a series of steps to delete a partition. f Begins a series of steps to change the device file (or other output file) where changes will be written. i Begins a series of steps to initialize the entire disk (not just the partition map). I Forcibly initializes the entire disk (not just the partition map). p Begins a series of steps to print the DPME information for a particular partition. P Displays the DPME information for each partition that has been created. q Quits the dp program. Q Forcibly quits the dp program even if partition map changes were not written to disk prior to quitting. s Displays overall partition-map status. U Uninitializes the partition map, clearing all partitions and all DPME information for any partitions that existed. v Displays dp version information. w Writes changes to disk (or the file currently open). ? Displays the commands available in this mode. # Indicates that subsequent text is a comment. March 1993 3
dp(1M) dp(1M)In DPME-field mode, dp accepts the following commands: a Enters the ABM-field mode of operation. b Enters the BZB-field mode of operation. n Begins a series of steps for resetting the name field (dpme_dpident.dpiname). t Begins a series of steps for resetting the type field (dpme_dpident.dpitype). [ Begins a series of steps for resetting the physical start of a field (dpme_pblock_start). ] Begins a series of steps for resetting the physical length of a field (dpme_pblocks). ( Begins a series of steps for resetting the logical start of a field (dpme_lblock_start). ) Begins a series of steps for resetting the logical length of a field (dpme_lblocks). > Begins a series of steps for resetting writable mode (dpme_writable). < Begins a series of steps for resetting readable mode (dpme_readable). p Displays the current DPME information for the partition selected upon entry into DPME-field mode. q Quits the DPME-field mode of operation, returning to command mode. ? Displays the commands available in this mode. # Indicates that subsequent text is a comment. In BZB-field mode, dp accepts the following commands: c Begins a series of steps to flag whether this partition is critical (bzb_crit). i Begins a series of steps to enter a bad-block inode number (bzb_inode). m Enters timestamp mode. n Begins a series of steps to reset the cluster 4 March 1993
dp(1M) dp(1M)number (bzb_cluster). This value is no longer used but it is still modifiable to allow backward compatibility. p Displays the current block zero block information. q Quits BZB-field mode, returning to DPME-field mode. r Begins a series of steps to flag this as a UNIX Root partition (bzb_root), a partition that contains a (bootable) root file system s Begins a series of steps for resetting the slice number. The number you supply should be one greater than the slice number you want to establish. If you specify 0, you turn this feature off so that no slice number is automatically associated with the partition. t Begins a series of steps for resetting the file- system type (bzb_type). T Begins a series of steps for forcibly resetting the file-system type (bzb_type). u Begins a series of steps to flag this as a UNIX Usr partition (bzb_usr), a partition that contains a file system that contains the the files customarily placed in the /usr directory. U Clears (uninitializes) all existing block zero block information for the current partition. ? Displays the commands available in this mode. # Indicates that subsequent text is a comment. In timestamp-field mode, dp accepts the following commands: c Begins a series of steps for resetting the creation time (bzb_tmade). m Begins a series of steps for resetting the mount time (bzb_tmount). p Displays the timestamps for the current partition. q Quits the timestamp mode, returning to BZB-field mode. u Begins a series of steps for resetting the umount March 1993 5
dp(1M) dp(1M)time (bzb_tumount). ? Displays the commands available in this mode. # Indicates that subsequent text is a comment. In ABM-field mode, dp accepts the following commands: b Begins a series of steps for resetting the size of the alternate blocks map in blocks (abm_size). c Performs a consistency check. e Begins a series of steps for resetting the number of used entries (abm_ents). Use of this command is discouraged. i Initializes the alternate block map, removing any previous bad-block information stored there. I Initializes the alternate block map as specified by the latest settings for the starting block and size of the alternate block map (see the b, o, and s commands). o Begins a series of steps for resetting the physical block of the beginning of alternate block map (abm_start). p Displays current abm. q Quits ABM-field mode, returning to the DPME-field mode of operation. s Begins a series of steps for resetting the size of the alternate block map in bytes (abm_size). Use of this command is discouraged. ? Displays the commands available in this mode. # Indicates that subsequent text is a comment. Like most ordinary editors, dp encourages you to save any changes that you make before quitting. EXAMPLES To display a description of the currently defined partitions, use the following command: echo P | dp -q /dev/rdsk/c101d0s31 6 March 1993
dp(1M) dp(1M)The next example shows one way to create a dp editing session that alters disk partition maps non-interactively. Suppose you must partition many disks in exactly the same way. You may want to create a partitioning command script. The following command script should be called by supplying the SCSI numbers of the disks to be partitioned as command- line arguments. for SCSIarg in $* do cat << EOF | dp -q /dev/rdsk/c${SCSIarg}d0s31 #!dp # @(#)dpscript 2.1 # I64 # Initialize the map with 64 entries # add some partitions # # FS type key: 1=UNIX 2=Autorec. 3=Swap # [ ] Name Type ( ) EC FS RFS UFS a0 4224 111184 A/UX\ Root y 0 111184 0 1 y y a1 115408 32768 Swap y 0 32768 0 3 wq # Write changes and quit EOF done STATUS MESSAGES AND VALUES The dp command produces various messages if the specified file does not exist. WARNINGS While fields are being modified, dp may display warning messages if it questions the integrity of a modification. However, don't rely on dp to produce warnings whenever you request a modification that may have an undesired effect. If dp questions a modification made within a noninteractive edit session (see ``Examples''), dp exits immediately. LIMITATIONS The dp command does not allow the creation of a disk- partition map containing more than 1024 entries. FILES /bin/dp Executable file SEE ALSO pname(1M) altblk(4), bzb(4), dpme(4), ptab(4), gd(7) in A/UX Programmer's Reference March 1993 7