UNIX System Administration Handbook - Evi Nemeth [94]
...
disk 2 8/16/5.3.0 sdisk CLAIMED SEAGATE ST446452W
/dev/dsk/c0t3d0 /dev/rdsk/c0t3d0
disk 1 8/16/5.6.0 sdisk CLAIMED SEAGATE ST34573N
/dev/dsk/c0t6d0 /dev/rdsk/c0t6d0
After you have verified that the disk is visible to the hardware and the kernel, you are ready to begin software configuration. The volume manager specifies three tiers of abstraction. First, you must identify physical volumes, such as the new disk we are about to install. Second, you group physical volumes into volume groups, which are treated as a single large pool of disk space. Finally, you divide a volume group into logical volumes, which are treated as separate disks. In essence, logical volumes serve the same function as disk partitions on other systems.
The pvcreate command identifies physical volumes. Physical volumes are referred to by their device files, which can be found in /dev/dsk and /dev/rdsk (for the block and character devices, respectively). These files are created automatically by the insf command at boot time. The naming convention is
/dev/[r]dsk/cItDdN[sP]
where I is the controller bus instance number of the interface, D is the disk’s SCSI address (target number), N is the logical unit number (LUN, normally 0), and P is an optional partition number. For our example, the devices we use for our new disk are /dev/rdsk/c0t3d0 and /dev/dsk/c0t3d0 for the character and block devices, respectively. See the man page for disk in section 7 of the manual for the complete scoop on naming.
Under normal circumstances you really shouldn’t low-level format a modern hard drive. However, if you’re determined to do it, now’s the time; use the mediainit command. Once a low-level format operation has been started, it cannot be interrupted or the disk will be corrupt and you will have to format it again. Formatting can take a very long time.
For this example, we skip low-level formatting and simply identify the physical volume with pvcreate. The -B option leaves space for booting information, which is added with the mkboot command:
# /usr/sbin/pvcreate -B /dev/rdsk/c0t3d0
Physical volume "/dev/rdsk/c0t3d0" has been created.
# mkboot /dev/rdsk/c0t3d0
After defining the disk as a physical volume, you must add it to a new volume group with the vgcreate command. You can add additional disks to a volume group with vgextend, but our example volume group will contain only a single disk.
Before you create a volume group, you must manually create a directory for it (typically /dev/vgXX, where XX is the volume group number) and create a device file called group in that directory to represent it. The minor device number of the device file must be unique among all the volume groups on the system. It has the format 0xNN0000, where NN is a hexadecimal (base 16) number that ranges from a minimum of 00 to a maximum number of groups controlled by the tunable kernel parameter called maxvgs. The default maximum is 10 (in decimal), which allows values for NN to be between 00 and 09 hex. You can increase the value of maxvgs if you need more than 10 volume groups.
See Chapter 12 for more information about kernel parameters.
You may also need to adjust the physical extent size of the volume group if your disk is very large. The physical extent size is the basic allocation unit, and the sizes of logical volumes (described later) will be rounded up to a multiple of this value. The physical extent size is specified in megabytes and defaults to 4MB. If when configuring your logical volumes you see an error message such as “File too big” or “No such device,” try specifying a larger physical extent size with the -s flag to vgcreate. We suggest starting at 8MB and working your way up; we used 16MB for our 47GB disk.
# mkdir /dev/vg01
# mknod /dev/vg01/group c 64 0x010000
# vgcreate -s 16 /dev/vg01 /dev/dsk/c0t3d0
Increased the number of physical extents per physical volume to 2805.
Volume group "/dev/vg01" has been successfully created.
Volume Group configuration for /dev/vg01 has been saved in
/etc/lvmconf/vg01.conf