Commonly Used LVM Procedures


The best way to learn how to use LVM commands is to evaluate some commonly used procedures. System administrators tend to be careful before running any intrusive (there is a chance something LVM- related will be changed) LVM commands. Always back up your system and create a bootable recovery tape with Ignite-UX before you run any intrusive LVM commands. The following are some procedures for tasks I have encountered on a regular basis. Please modify them to suit your needs. Don't run the commands as shown. You will need to prepare your system, substitute the names of your volumes , and perform additional steps. These commands, however, serve as good examples for ways in which the tasks shown can be performed.

The first task we'll perform is to mirror the root disk to a second disk. This is one of the most commonly run procedures. Most HP 9000s are ordered with a minimum of two internal disks for root and swap. After loading the first disk with HP-UX, selecting logical volume sizes, file system types, and so on, we're ready to mirror the disk (please see Chapter 2 on installing HP-UX 11i to see this procedure.)

Figure 3-3 shows some typical steps to mirror root and swap:

Figure 3-3 Mirror root and swap Disk
 #  pvcreate -B /dev/rdsk/cxtxdx  ; create physical volume for disk to be used as mirror #  vgextend /dev/vg00 /dev/dsk/cxtxdx  ; extend  vg00  to include disk to be used as mirror #  mkboot /dev/rdsk/cxtxdx  ; mkboot places boot utilities in boot area #  mkboot -a "hpux -lq" /dev/rdsk/cxtxdx  ; add the AUTO file and specify low quorum #  mkboot -a "hpux -lq" /dev/rdsk/primary  ; update the AUTO file on  primary  disk low quorum #  lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/cxdxtx  ; mirror  lvol1  which is  /stand  #  lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/cxtxdx  ; mirror  lvol2  which is root #  lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/cxtxdx  ; mirror  lvol3  which is swap #  lvextend  all others on  primary  #  setboot -a 8/8.6.0  ; have alternate boot path point to H/W path of new mirror disk 

This is the one of the most common procedures performed in LVM because you like to have the root and swap disk mirrored whenever possible.

Since this is such an important procedure to know, let's go through an example of running this procedure.

Let's first see what volume groups we have on the system by running strings /etc/lvmtab and then run ioscan to see what disks exist on the system:

 #  strings /etc/lvmtab  /dev/vg00 /dev/dsk/c1t15d0 #  ioscan -funC disk  Class     I  H/W Path        Driver   S/W State   H/W Type     Description =========================================================================== disk      0  0/0/1/0.1.0     sdisk    CLAIMED     DEVICE       HP      DVD-ROM 305                             /dev/dsk/c0t1d0   /dev/rdsk/c0t1d0 disk      1  0/0/1/1.15.0    sdisk    CLAIMED     DEVICE       SEAGATE ST318404LC                             /dev/dsk/c1t15d0   /dev/rdsk/c1t15d0 disk      2  0/0/2/1.15.0    sdisk    CLAIMED     DEVICE       SEAGATE ST318404LC                             /dev/dsk/c3t15d0   /dev/rdsk/c3t15d0 disk      3  0/4/0/0/4/0.8.0   sdisk    CLAIMED     DEVICE       HP 18.2GST318406LC                             /dev/dsk/c4t8d0   /dev/rdsk/c4t8d0 disk      4  0/4/0/0/4/0.10.0  sdisk    CLAIMED     DEVICE       HP 18.2GST318406LC #                           /dev/dsk/c4t10d0   /dev/rdsk/c4t10d0 

The disk at 3 is on a different bus than the internal disk and would therefore be an ideal disk on which to mirror the root disk. We'll take the disk at 3 , get some information on it with diskinfo and run a vgscan to ensure that there is now only one disk in the volume group .

 #  diskinfo /dev/rdsk/c4t8d0  SCSI describe of /dev/rdsk/c4t8d0:              vendor: HP 18.2G          product id: ST318406LC                type: direct access                size: 17783240 Kbytes    bytes per sector: 512 #  vgdisplay -v /dev/vg00  --- Volume groups --- VG Name                     /dev/vg00 VG Write Access             read/write VG Status                   available Max LV                      255 Cur LV                      8 Open LV                     8 Max PV                      16 Cur PV                      1 Act PV                      1 Max PE per PV               4350 VGDA                        2 PE Size (Mbytes)            4 Total PE                    4340 Alloc PE                    1965 Free PE                     2375 Total PVG                   0 Total Spare PVs             0 Total Spare PVs in use      0    --- Logical volumes ---    LV Name                     /dev/vg00/lvol1    LV Status                   available/syncd    LV Size (Mbytes)            300    Current LE                  75    Allocated PE                75    Used PV                     1    LV Name                     /dev/vg00/lvol2    LV Status                   available/syncd    LV Size (Mbytes)            2048    Current LE                  512    Allocated PE                512    Used PV                     1    LV Name                     /dev/vg00/lvol3    LV Status                   available/syncd    LV Size (Mbytes)            200    Current LE                  50    Allocated PE                50    Used PV                     1    LV Name                     /dev/vg00/lvol4    LV Status                   available/syncd    LV Size (Mbytes)            500    Current LE                  125    Allocated PE                125    Used PV                     1    LV Name                     /dev/vg00/lvol5    LV Status                   available/syncd    LV Size (Mbytes)            200    Current LE                  50    Allocated PE                50    Used PV                     1    LV Name                     /dev/vg00/lvol6    LV Status                   available/syncd    LV Size (Mbytes)            1032    Current LE                  258    Allocated PE                258    Used PV                     1    LV Name                     /dev/vg00/lvol7    LV Status                   available/syncd    LV Size (Mbytes)            1032    Current LE                  258    Allocated PE                258    Used PV                     1    LV Name                     /dev/vg00/lvol8    LV Status                   available/syncd    LV Size (Mbytes)            2548    Current LE                  637    Allocated PE                637    Used PV                     1    --- Physical volumes ---    PV Name                     /dev/dsk/c1t15d0    PV Status                   available    Total PE                    4340    Free PE                     2375    Autoswitch                  On 

Now that we're sure of the way in which vg00 is set up and we have all of the information on the disk, we wish to act as a mirror for the root disk. Let's run all of the commands necessary to create the mirror:

 #  pvcreate -B /dev/rdsk/c4t8d0  Physical volume "/dev/rdsk/c4t8d0" has been successfully created. #  vgextend /dev/vg00 /dev/dsk/c4t8d0  Volume group "/dev/vg00" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  mkboot /dev/rdsk/c4t8d0  #  mkboot -a "hpux -lq" /dev/rdsk/c4t8d0  #  mkboot -a "hpux -lq" /dev/rdsk/c1t15d0  #  lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol1" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf # #  lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol2" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol3" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol4" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol5" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol6" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol7" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c4t8d0  The newly allocated mirrors are now being synchronized. This operation will take some time. Please wait .... Logical volume "/dev/vg00/lvol8" has been successfully extended. Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf #  setboot -a 0/4/0/0/4/0.8.0  

The setup of the mirrored volume should now be complete. Let's run strings /etc/lvmtab and vgdisplay again to ensure that our disk has been added to the volume group:

 #  strings /etc/lvmtab  /dev/vg00 /dev/dsk/c1t15d0 /dev/dsk/c4t8d0 #  vgdisplay -v /dev/vg00  --- Volume groups --- VG Name                     /dev/vg00 VG Write Access             read/write VG Status                   available Max LV                      255 Cur LV                      8 Open LV                     8 Max PV                      16 Cur PV                      2 Act PV                      2 Max PE per PV               4350 VGDA                        4 PE Size (Mbytes)            4 Total PE                    8680 Alloc PE                    3930 Free PE                     4750 Total PVG                   0 Total Spare PVs             0 Total Spare PVs in use      0    --- Logical volumes ---    LV Name                     /dev/vg00/lvol1    LV Status                   available/syncd    LV Size (Mbytes)            300    Current LE                  75    Allocated PE                150    Used PV                     2    LV Name                     /dev/vg00/lvol2    LV Status                   available/syncd    LV Size (Mbytes)            2048    Current LE                  512    Allocated PE                1024    Used PV                     2    LV Name                     /dev/vg00/lvol3    LV Status                   available/syncd    LV Size (Mbytes)            200    Current LE                  50    Allocated PE                100    Used PV                     2    LV Name                     /dev/vg00/lvol4    LV Status                   available/syncd    LV Size (Mbytes)            500    Current LE                  125    Allocated PE                250    Used PV                     2    LV Name                     /dev/vg00/lvol5    LV Status                   available/syncd    LV Size (Mbytes)            200    Current LE                  50    Allocated PE                100    Used PV                     2    LV Name                     /dev/vg00/lvol6    LV Status                   available/syncd    LV Size (Mbytes)            1032    Current LE                  258    Allocated PE                516    Used PV                     2    LV Name                     /dev/vg00/lvol7    LV Status                   available/syncd    LV Size (Mbytes)            1032    Current LE                  258    Allocated PE                516    Used PV                     2    LV Name                     /dev/vg00/lvol8    LV Status                   available/syncd    LV Size (Mbytes)            2548    Current LE                  637    Allocated PE                1274    Used PV                     2    --- Physical volumes ---    PV Name                     /dev/dsk/c1t15d0    PV Status                   available    Total PE                    4340    Free PE                     2375    Autoswitch                  On    PV Name                     /dev/dsk/c4t8d0    PV Status                   available    Total PE                    4340    Free PE                     2375    Autoswitch                  On 

These outputs look great in that both disks are in vg00 . The end of the vgdisplay output ( Physical Volumes) shows both disks with identical Total PE and Free PE .

Let's now run lvdisplay to see that the physical extents are mirrored across the two disks, lifls on both disks to see the boot information, and setboot to ensure that we have the primary and alternate paths set up properly:

 #  lvdisplay -v /dev/vg00/lvol1  --- Logical volumes --- LV Name                     /dev/vg00/lvol1 VG Name                     /dev/vg00 LV Permission               read/write LV Status                   available/syncd Mirror copies               1 Consistency Recovery        MWC Schedule                    parallel LV Size (Mbytes)            300 Current LE                  75 Allocated PE                150 Stripes                     0 Stripe Size (Kbytes)        0 Bad block                   off Allocation                  strict/contiguous IO Timeout (Seconds)        default    --- Distribution of logical volume ---    PV Name            LE on PV  PE on PV    /dev/dsk/c1t15d0   75        75    /dev/dsk/c4t8d0    75        75    --- Logical extents ---    LE    PV1                PE1   Status 1 PV2                PE2   Status 2    00000 /dev/dsk/c1t15d0   00000 current  /dev/dsk/c4t8d0    00000 current    00001 /dev/dsk/c1t15d0   00001 current  /dev/dsk/c4t8d0    00001 current    00002 /dev/dsk/c1t15d0   00002 current  /dev/dsk/c4t8d0    00002 current    00003 /dev/dsk/c1t15d0   00003 current  /dev/dsk/c4t8d0    00003 current    00004 /dev/dsk/c1t15d0   00004 current  /dev/dsk/c4t8d0    00004 current    00005 /dev/dsk/c1t15d0   00005 current  /dev/dsk/c4t8d0    00005 current    00006 /dev/dsk/c1t15d0   00006 current  /dev/dsk/c4t8d0    00006 current    00007 /dev/dsk/c1t15d0   00007 current  /dev/dsk/c4t8d0    00007 current    00008 /dev/dsk/c1t15d0   00008 current  /dev/dsk/c4t8d0    00008 current    00009 /dev/dsk/c1t15d0   00009 current  /dev/dsk/c4t8d0    00009 current    00010 /dev/dsk/c1t15d0   00010 current  /dev/dsk/c4t8d0    00010 current    00011 /dev/dsk/c1t15d0   00011 current  /dev/dsk/c4t8d0    00011 current  .   .   .  00071 /dev/dsk/c1t15d0   00071 current  /dev/dsk/c4t8d0    00071 current    00072 /dev/dsk/c1t15d0   00072 current  /dev/dsk/c4t8d0    00072 current    00073 /dev/dsk/c1t15d0   00073 current  /dev/dsk/c4t8d0    00073 current    00074 /dev/dsk/c1t15d0   00074 current  /dev/dsk/c4t8d0    00074 current #  lifls /dev/rdsk/c1t15d0  ODE          MAPFILE      SYSLIB       CONFIGDATA   SLMOD2 SLDEV2       SLDRV2       SLSCSI2      MAPPER2      IOTEST2 PERFVER2     PVCU         SSINFO       ISL          AUTO HPUX         LABEL #  lifls /dev/rdsk/c4t8d0  ISL          AUTO         HPUX         PAD          LABEL #  setboot  Primary bootpath : 0/0/1/1.15.0 Alternate bootpath : 0/4/0/0/4/0.8.0 Autoboot is ON (enabled) Autosearch is ON (enabled) # 

It looks as though this setup of a mirrored volume is complete in that the data is mirrored across two different disks on two different buses and that the mirrored volume is also bootable.

Another important procedure that is helpful to know is to create a new volume group and add a disk to it. We'll also put a logical volume on the disk and mount it. Figure 3-4 shows the steps involved in this procedure.

Figure 3-4 Create a New Volume Group, Add a Disk to it with a Logical Volume
[View full width]
 #  pvcreate /dev/rdsk/cxtxdx  ; create physical volume for disk to be used in VG #  mkdir /dev/vg01  ; make directory for new  vg01  #  mknod /dev/vg01/group c 64 0x010000  ; mknod of  vg01  ( minor  01  corresponds graphics/ccc.gif to vg  num  ) #  vgcreate /dev/vg01 /dev/dsk/cxtxdx  ; create  vg01  #  lvcreate -L 2000 /dev/vg01  ; create default  lvol1  in  vg01  of 2 GBytes #  newfs -F vxfs -o largefiles /dev/vg01/rlvol1  ; create a new filesystem on  lvol1  #  mkdir /backup  ; create a directory on which to mount  graphics/ccc.gif lvol1   # mount /dev/vg01/lvol1 /backup  ; mount  lvol1  #  bdf  ; to see mounted filesystem 

Since this is such an important procedure to know, let's go through an example of running this procedure.

In the previous example we performed a diskinfo to see all of the disks on our system. We'll use the disk at 4 in this example as the basis for creating a new volume group.

We'll run the steps as they appear in Figure 3-4 to create vg01 and mount one of its logical volumes on /backup :

 #  pvcreate -B -f /dev/rdsk/c3t15d0  Physical volume "/dev/rdsk/c3t15d0" has been successfully created. #  mkdir /dev/vg01  #  mknod /dev/vg01/group c 64 0x010000  #  vgcreate /dev/vg01 /dev/dsk/c3t15d0  Increased the number of physical extents per physical volume to 4341. Volume group "/dev/vg01" has been successfully created. Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf #  lvcreate -L 2000 /dev/vg01  Logical volume "/dev/vg01/lvol1" has been successfully created with character device "/dev/vg01/rlvol1". Logical volume "/dev/vg01/lvol1" has been successfully extended. Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf #  newfs -F vxfs -o largefiles /dev/vg01/rlvol1  version 4 layout    2048000 sectors, 2048000 blocks of size 1024, log size 1024 blocks     unlimited inodes, largefiles supported     2048000 data blocks, 2046392 free data blocks     63 allocation units of 32768 blocks, 32768 data blocks     last allocation unit has 16384 data blocks #  mkdir /backup  #  mount /dev/vg01/lvol1 /backup  #  bdf  Filesystem          kbytes    used   avail %used Mounted on /dev/vg00/lvol3     204800   67065  129166   34% / /dev/vg00/lvol1     299157   26222  243019   10% /stand /dev/vg00/lvol8    2609152  138568 2316618    6% /var /dev/vg00/lvol7    1056768  767077  271632   74% /usr /dev/vg00/lvol5     204800    1338  190810    1% /tmp /dev/vg00/lvol6    1056768  691085  342889   67% /opt /dev/vg00/lvol4     512000    1234  478849    0% /home /dev/vg01/lvol1    2048000    1606 1918502    0% /backup #  strings /etc/lvmtab  /dev/vg00 /dev/dsk/c1t15d0 /dev/dsk/c4t8d0 /dev/vg01 /dev/dsk/c3t15d0 # 

We successfully created a new volume group in this example of size two GBytes. We'll later increase this size of this logical volume without unmounting /backup . We did not have to put boot-related files on this physical volume since we don't need to boot off of it.

The next series of figures give tips on performing some additional frequently performed LVM procedures.

Figure 3-5 Replace a Non-Mirrored Disk
 #  vgcfgrestore - /dev/vgXX /dev/rdsk/cxtxdx  ; volume group configuration restore #  vgchange -a y /dev/vgXX  ; change volume group to available (  -a y  ) #  newfs -F fstype /dev/vgXX/rlvolx  ; create filesystem for every  lvol  on physical volume #  mount /   mountpointname  ; mount every new filesystem Notes: Confirm you have  /etc/lvmconf/vgXX.conf   vgcfgbackup  is run automatically Defective disk was not mirrored before it failed Additional steps may be required on your system 

In Figure 3-5, we had a non-mirrored and non-root disk that was defective and had to be replaced . After replacing the disk, the volume group information was restored for the specific disk with vgcfgrestore . We then changed the volume group to available, ran a newfs on the disk, and mounted the filesystems that used the disk.

In Figure 3-6 we will again replace a defective non-root disk, but this time, the disk will be mirrored.

Figure 3-6 Replace a Mirrored Disk
 #  vgcfgrestore -n /dev/vgXX /dev/rdsk/cxtxdx  ; volume group configuration restore #  vgchange -a y /dev/vgXX  ; change volume group to available (  -a y  ) #  vgsync /dev/vgXX  ; resync logical volumes in volume group Notes: Defective disk was mirrored before it failed Additional steps may be required on your system 

In this example, we performed the same first two steps of restoring the volume group configuration and changing the volume group to available. Because the disk was mirrored, we only have to synchronize the data on the new disk with that on its mirror with vgsync .

In Figure 3-7 we will again replace a mirrored disk, but this time the disk will have a boot area on it.

Figure 3-7 Replace Mirrored Disk Boot Disk
 #  vgcfgrestore -n /dev/vgXX /dev/rdsk/cxtxdx  ; volume group configuration restore #  vgchange -a y /dev/vgXX  ; change volume group to available  (-a  y) #  vgsync /dev/vgXX  ; resync logical volumes in volume group #  mkboot /dev/rdsk/cxtxdx  ; create bootarea on disk  # mkboot -a "hpux lq" /dev/rdsk/cxtxdx  ; specify low quorum in boot area  # shutdown   <desired options>  ; reboot system to take effect  vgcfgbackup  is run automatically Notes: Confirm you have  /etc/lvmconf/vgXX.conf  Defective disk was mirrored before it failed Addtional steps may be required on your system 

In this example, we performed the same first three steps as the previous example, but we also have to create a boot area on the disk. The system has to be rebooted in order for this to take effect.

In Figure 3-8a we want to move a volume group onto a different system.

Figure 3-8a Exporting (Removing) and Importing a Volume Group Onto Another System
  On system 1:  #  vgchange -a n /dev/vg01  ; change volume group to unavailable (  -a n  ) on 1st sys #  vgexport -v -m /tmp/mapfile -s /dev/vg01  ; make volume group unavailable on 1st system                                               ; use  -p -s -m  options if you need shared for HA #  rcp /tmp/mapfile system2:/tmp/mapfile  ; copy mapfile to  target  or  second  system.  On system 2:  #  mkdir /dev/vg01  ; make directory on 2nd system for volume group  # mknod /dev/vg01/group c 64 0xyy0000  ; create special file for vol group (  yy  =group number                                                   such as  00  for  vg00, 01  for  vg01  , and so on)  # vgimport -v -m mapfile -s /dev/vg01  ; import volume group using mapfile copied from                                                   1st system or specify device filenames                                                   (use  -s  and  -m  in HA cluster) #  vgchange -a y /dev/vg01  ; make volume group available #  mkdir /backup  #  mount /dev/vg01/backup /backup  ;    add to  /etc/fstab  if you want this mounted at boot Notes:  vgcfgbackup  is run automatically Addtional steps may be required on your system The  -s -p -m -v  options are used in HA cluster environments to create sharable mapfile with  vgexport  and  -s -m  on  vgmport  

In this example we performed the first three steps on the system from which we're moving the volume group. We make the volume group unavailable and then export the volume group. The mapfile from the first system needs to be copied to the second system. You don't have to specify the mapfile name if standard names such as /dev/vg01 are used. In any event, the mapfile has to be copied to the system to which the volume group is being migrated .

On the second system we create a directory and device special file for the new volume group. We then import the mapfile for the volume group and make the volume group active. We then make the volume group available and perform the appropriate mounts.

There are many comments regarding a High Availability Cluster and the options used. In a ServiceGuard environment you don't have to make the volume group unavailable and you use some different options for sharing. Figure 3-8b shows the ServiceGuard steps:

Figure 3-8b Exporting (Removing) and Importing a Volume Group Onto Another System in a ServiceGuard Environment
  On system 1:  #  vgexport -p -s -m /tmp/mapfile /dev/vg01  ; you'll get a volume group active warning #  rcp /tmp/mapfile system2:/tmp/mapfile  ; copy mapfile to  target  or  second  system.  On system 2:  #  mkdir /dev/vg01  ; make directory on 2nd system for volume group  # mknod /dev/vg01/group c 64 0xyy0000  ; create special file for vol group (  yy  =group number                                                  such as  00  for  vg00, 01  for  vg01  , and so on)  # vgimport -s -m mapfile /dev/vg01  ; import volume group using mapfile copied from                                                   1st system or specify device filenames #  vgchange -a y /dev/vg01  ; make volume group available #  mkdir /backup  #  mount /dev/vg01/backup /backup  ; add to  /etc/fstab  if you want this mounted at boot Notes:  vgcfgbackup  is run automatically Addtional steps may be required on your system The  -s -p -m -v  options are used in HA cluster environments to create sharable mapfile with  vgexport  and  -s -m  on  vgmport  

These steps are very similar to those in Figure 3-8a. The options to vgexport and vgimport are different and you may want to look at those manual pages.

Figure 3-9 shows extending a VxFS filesystem by 800 MBytes.

Figure 3-9 Extend VxFS File System Using OnlineJFS
 #  lvextend -L 800 /dev/vgXX/lvolY  ; extend logical volume  rlvolY  by 800 MBytes #  fsadm -F vxfs -b 800M /   mountpointname  ; use  fsadm  to extend or  extendfs  on non-JFS Notes: This is a VxFS filesystem and OnlineJFS is installed on system Additional steps may be required on your system 

This is a commonly run procedure because OnlineJFS is used in most high availability environments. Let's extend the logical volume in vg01 that we earlier created from two GBytes to four GBytes using the steps in the following example:

 #  bdf  Filesystem          kbytes    used   avail %used Mounted on /dev/vg00/lvol3     204800   67067  129164   34% / /dev/vg00/lvol1     299157   26222  243019   10% /stand /dev/vg00/lvol8    2609152  138519 2316664    6% /var /dev/vg00/lvol7    1056768  767085  271624   74% /usr /dev/vg00/lvol5     204800    1338  190810    1% /tmp /dev/vg00/lvol6    1056768  691085  342889   67% /opt /dev/vg00/lvol4     512000    1234  478849    0% /home /dev/vg01/lvol1    2048000    1606 1918502    0% /backup #  lvextend -L 4000 /dev/vg01/lvol1  Logical volume "/dev/vg01/lvol1" has been successfully extended. Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf #  fsadm -F vxfs -b 4000M /backup  vxfs fsadm: /dev/vg01/rlvol1 is currently 2048000 sectors - size will be increased #  bdf  Filesystem          kbytes    used   avail %used Mounted on /dev/vg00/lvol3     204800   67067  129164   34% / /dev/vg00/lvol1     299157   26222  243019   10% /stand /dev/vg00/lvol8    2609152  138521 2316663    6% /var /dev/vg00/lvol7    1056768  767085  271624   74% /usr /dev/vg00/lvol5     204800    1338  190810    1% /tmp /dev/vg00/lvol6    1056768  691085  342889   67% /opt /dev/vg00/lvol4     512000    1234  478849    0% /home /dev/vg01/lvol1    4096000    2104 3838035    0% /backup # 

Note that this change from two GBytes to four GBytes took place while /backup was mounted. The ability to resize logical volumes while they're mounted is one of the advanced features of OnlineJFS.

If this directory were to be mounted at boot time, we would add an entry to /etc/fstab .

The Figure 3-10 shows changing a VxFS filesystem to support large files.

Figure 3-10 Change a Logical Volume to Support Large Files
 #  fsadm -F vxfs -o largefiles /dev/vgXX/rlvolY  ; use  fsadm  and specify  largefile  option Notes: This is VxFS filesystem, you can substitute  hfs  for  vxfs  in above example for an  hfs  filesystem and use  lvolY  in place of  rlvolY  Unmount filesystem before running Additional steps may be required on your system 

Using fsadm , we specify the raw logical volume on which we want large files supported.

This change would be unnecessary had the logical volume been created to support large files.



HP-UX 11i Systems Administration Handbook and Toolkit
HP-UX 11i Systems Administration Handbook and Toolkit (2nd Edition)
ISBN: 0131018833
EAN: 2147483647
Year: 2003
Pages: 301

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net