📜 ⬆️ ⬇️

VxVM 5.0MP3 - How to increase the size of the rootdisk

In this article I want to talk about not very loved by all, but previously very popular Veritas. It's no secret that handling this manager requires experience and care, especially in such a case as increasing the root disk on the active system. Of course, in this case, there is always excitement, but it quickly passes if we sort out a little deeper into the problem, which we will try to do.
To illustrate the process that occurs when using the vxrootadm command to increase the size of the root file system, we will look at the minimum configuration — only one root disk encapsulated under the control of VxVM, on one of my servers in the test lab. This article will be quite long conclusions of the teams, so I apologize in advance for the long canvas.
Let's demonstrate the initial information. From the following output, we see only one member drive "ckdg":
  # vxdisk list
    DEVICE TYPE DISK GROUP STATUS
    c1t0d0s2 auto: sliced ​​rootdisk ckdg online
    c1t1d0s2 auto: none - - online invalid
    c1t2d0s2 auto: none - - online invalid
    c1t3d0s2 auto: none - - online invalid 
In the following output, I will show the current partition table and its dimensions. “Rootvol” and “usr” are about 4 GB each, and “swapvol” and “var” are about 2 GB each.
  # vxprint -ht
    Disk group: ckdg
    dg ckdg default default 9000 1231534571.8.v4u-v240d-fll03
    dm rootdisk c1t0d0s2 auto 66446 71060733 -
    v rootvol - ENABLED ACTIVE 8389656 ROUND - root
    pl rootvol-01 rootvol ENABLED ACTIVE 8389656 CONCAT - RW
    sd rootdisk-02 rootvol-01 rootdisk 4194827 8389656 0 c1t0d0 ENA
    v swapvol - ENABLED ACTIVE 4194828 ROUND - swap
    pl swapvol-01 swapvol ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-B0 swapvol-01 rootdisk 71060732 1 0 c1t0d0 ENA
    sd rootdisk-01 swapvol-01 rootdisk 0 4194827 1 c1t0d0 ENA
    v usr - ENABLED ACTIVE 8193204 ROUND - fsgen
    pl usr-01 usr ENABLED ACTIVE 8193204 CONCAT - RW
    sd rootdisk-03 usr-01 rootdisk 16779311 8193204 0 c1t0d0 ENA
    v var - ENABLED ACTIVE 4194828 ROUND - fsgen
    pl var-01 var ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-04 var-01 rootdisk 12584483 4194828 0 c1t0d0 ENA 

The third output is the df -kl command (I removed unnecessary information for readability)
  # df -kl
    Filesystem kbytes used avail capacity Mounted on
    / dev / vx / dsk / bootdg / rootvol 4130826 1016437 3073081 25% /
    / dev / vx / dsk / bootdg / usr 4034088 3478926 514822 88% / usr
    / dev / vx / dsk / bootdg / var 2055085 206078 1787355 11% / var 

The next team is obliged to review the “prtvtoc” of the root disk, we will need it for the following actions with nat partitions:
  # prtvtoc / dev / rdsk / c1t0d0s2
    * Dimensions:
    * 512 bytes / sector
    * 107 sectors / track
    * 27 tracks / cylinder
    * 2889 sectors / cylinder
    * 24622 cylinders
    * 24620 accessible cylinders
    *
    * First Sector Last
    * Partition Tag Flags Sector Count Sector Mount Directory
           0 2 00 4194828 8389656 12584483
           1 3 01 0 4194828 4194827
           2 5 0 0 71127180 71127179
           3 7 00 12584484 4194828 16779311
           4 4 00 16779312 8193204 24972515
           6 14 01 0 71127180 71127179
           7 15 01 71060733 66447 71127179 

and the “prtvtoc” disk on which we want to increase our file system, as you can see, the disk is still initialized via VxVM.
  # prtvtoc / dev / rdsk / c1t1d0s2
    * Dimensions:
    * 512 bytes / sector
    * 107 sectors / track
    * 27 tracks / cylinder
    * 2889 sectors / cylinder
    * 24622 cylinders
    * 24620 accessible cylinders
    *
    * Unallocated space:
    * First Sector Last
    * Sector Count Sector
    * 0 71127180 71127179
    *
    * First Sector Last
    * Partition Tag Flags Sector Count Sector Mount Directory
           2 5 01 0 71127180 71127179 

Now, having learned all that we need, we are ready to begin work.
We will try to change the size of the “root” and “var” of the file system, which is the most common case due to an uncalculated increase in the size of file systems. After the operations, all the file systems will be located on the new disk, the “rootvol” will be increased from 8389656 sectors to 9000000, and “var” from 4194828 to 5555547 sectors.
Now it is a little about sizes which we will choose for new expanded file systems. Although we can choose any size, it is better to choose a multiple of disk sectors. Otherwise, VxVM will round it up for use in the new “subdisk” and new “slice”, as a result we can get small pieces of hard disk space that can never be used, this is certainly not the end of the world, but it is still recommended to create Partitions based on the multiplicity of the number of sectors on the disk. To prove by example, I will consider both cases, where we will expand “rootvol” to 9000000 sectors, which is not a multiple of 2889, and “var” (5555547 sectors), which is very well divisible by 2889.
So, let's go:
# /usr/lib/vxvm/bin/vxrootadm -v -g ckdg grow c1t1d0s2 rootvol=9000000 var=5555547
In this command, the key "-v" means that we will be able to observe what is happening through the output to the screen, "c1t1d0s2" is an empty disk on which the entire system will be located at the end. As a result of this command, we see the output:
  VxVM vxrootadm INFO V-5-2-4953
         Growing root volume
         system reboots to complete.  These will result in moving plexes
         from the source boot disk to the target disk.  If you choose
         the will disk will replace
         the source boot disk.
    Do you wish to continue [y, n, q ,?] (default: n) y
    [16:08:08] VxVM vxrootadm INFO V-5-2-4828 Adding target disk to group ...
    [16:08:13] # vxdisksetup -i c1t1d0 format = sliced
    [16:08:21] # vxdisk -f init c1t1d0s2 format = sliced
    [16:08:24] # vxdg -g ckdg adddisk rootdisk-s0 = c1t1d0s2
    [16:08:27] VxVM vxrootadm INFO V-5-2-4837 Creating mirrors ...
    [16:08:27] # vxassist -g ckdg mirror swapvol layout = contig, diskalign rootdisk-s0
    [16:09:39] # vxassist -g ckdg mirror rootvol layout = contig, diskalign rootdisk-s0
    [16:12:13] # vxassist -g ckdg make space_rootvol 610344 rootdisk-s0
    [16:12:13] # vxassist -g ckdg mirror var layout = contig, diskalign rootdisk-s0
    [16:13:28] # vxassist -g ckdg make space_var 1360719 rootdisk-s0
    [16:13:28] # vxassist -g ckdg mirror usr layout = contig, diskalign rootdisk-s0
    [16:15:51] VxVM vxrootadm INFO V-5-2-4829 Bootsetup ckdg rootdisk-s0 ...
    [16:16:16] VxVM vxrootadm INFO V-5-2-4829 Bootsetup ckdg rootdisk ...
    VxVM vxrootadm INFO V-5-2-4880
         Phase 1 completed.  Devalias for the target disk: vx-rootdisk-s0
         Please reboot with this disk.  To do this type:
                 reboot - vx-rootdisk-s0
         After the system comes up, continue typing:
                 vxrootadm grow continue 

So check what happened,
  # vxdisk list
    DEVICE TYPE DISK GROUP STATUS
    c1t0d0s2 auto: sliced ​​rootdisk ckdg online
    c1t1d0s2 auto: sliced ​​rootdisk-s0 ckdg online
    c1t2d0s2 auto: none - - online invalid
    c1t3d0s2 auto: none - - online invalid 

VxVM mirrored all volumes from the original disk to our new disk. However, two temporary and empty volumes were also created with the corresponding names space_rootvol and space_var. These two new volyum, deliberately located on the disk so as to allow the file system to increase.
I will give the following conclusion:
  # vxprint -ht
    Disk group: ckdg
    dg ckdg default default 9000 1231534571.8.v4u-v240d-fll03
    dm rootdisk c1t0d0s2 auto 66446 71060733 -
    dm rootdisk-s0 c1t1d0s2 auto 66446 71057844 -
    v rootvol - ENABLED ACTIVE 8389656 ROUND - root
    pl rootvol-01 rootvol ENABLED ACTIVE 8389656 CONCAT - RW
    sd rootdisk-02 rootvol-01 rootdisk 4194827 8389656 0 c1t0d0 ENA
    pl rootvol-02 rootvol ENABLED ACTIVE 8389656 CONCAT - RW
    sd rootdisk-s0-02 rootvol-02 rootdisk-s0 4194828 8389656 0 c1t1d0 ENA
    v space_rootvol - ENABLED ACTIVE 610344 SELECT - fsgen
    pl space_rootvol-01 space_rootvol ENABLED ACTIVE 612468 CONCAT - RW
    sd rootdisk-s0-03 space_rootvol-01 rootdisk-s0 12584484 612468 0 c1t1d0 ENA
    v space_var - ENABLED ACTIVE 1360719 SELECT - fsgen
    pl space_var-01 space_var ENABLED ACTIVE 1360719 CONCAT - RW
    sd rootdisk-s0-05 space_var-01 rootdisk-s0 17391780 1360719 0 c1t1d0 ENA
    v swapvol - ENABLED ACTIVE 4194828 ROUND - swap
    pl swapvol-01 swapvol ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-B0 swapvol-01 rootdisk 71060732 1 0 c1t0d0 ENA
    sd rootdisk-01 swapvol-01 rootdisk 0 4194827 1 c1t0d0 ENA
    pl swapvol-02 swapvol ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-s0-01 swapvol-02 rootdisk-s0 0 4194828 0 c1t1d0 ENA
    v usr - ENABLED ACTIVE 8193204 ROUND - fsgen
    pl usr-01 usr ENABLED ACTIVE 8193204 CONCAT - RW
    sd rootdisk-03 usr-01 rootdisk 16779311 8193204 0 c1t0d0 ENA
    pl usr-02 usr ENABLED ACTIVE 8193204 CONCAT - RW
    sd rootdisk-s0-06 usr-02 rootdisk-s0 18752499 8193204 0 c1t1d0 ENA
    v var - ENABLED ACTIVE 4194828 ROUND - fsgen
    pl var-01 var ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-04 var-01 rootdisk 12584483 4194828 0 c1t0d0 ENA
    pl var-02 var ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-s0-04 var-02 rootdisk-s0 13196952 4194828 0 c1t1d0 ENA 

For clarity, I will try to display graphically how it looks in the system:
  rootdisk rootdisk-s0
              (c1t0d0s2) (c1t1d0s2)
             + ------------- + + ------------- +
             |  swapvol |  |  swapvol |
             + ------------- + + ------------- +
             |  rootvol |  |  rootvol |
             + ------------- + + ------------- +
             |  var |  | space_rootvol |
             + ------------- + + ------------- +
             |  usr |  |  var |
             + ------------- + + ------------- +
                                     |  space_var |
                                     + ------------- +
                                     |  usr |
                                     + ------------- + 

“Vxrootadm” took care of us in advance and created an alias for both disks. The next step we need to reboot using the mirror created (thereby making sure that it is bootable). Unfortunately - this will not be the last reboot, such is the order.
# reboot -- vx-rootdisk-s0
After the reboot, we see that in principle nothing happened, except that we have a different boot disk. Enter the following command:
  # vxrootadm grow continue
    [16:22:10] VxVM vxrootadm INFO V-5-2-4861 Remove source mirrors ...
    VxVM vxrootadm INFO V-5-2-4880
         Phase 2 completed.  Devalias for the source disk: vx-rootdisk
         Please reboot with this disk.  To do this type:
                 reboot - vx-rootdisk
         After the system comes up, continue typing:
                 vxrootadm grow continue 

What happened after this command, VxVM moved the plexes from the original disk, so only the new ones remained on the new disk.
  # vxprint -ht
    Disk group: ckdg
    dg ckdg default default 9000 1231534571.8.v4u-v240d-fll03
    dm rootdisk c1t0d0s2 auto 66446 71060733 -
    dm rootdisk-s0 c1t1d0s2 auto 66446 71057844 -
    v rootvol - ENABLED ACTIVE 8389656 ROUND - root
    pl rootvol-02 rootvol ENABLED ACTIVE 8389656 CONCAT - RW
    sd rootdisk-s0-02 rootvol-02 rootdisk-s0 4194828 8389656 0 c1t1d0 ENA
    v space_rootvol - ENABLED ACTIVE 610344 SELECT - fsgen
    pl space_rootvol-01 space_rootvol ENABLED ACTIVE 612468 CONCAT - RW
    sd rootdisk-s0-03 space_rootvol-01 rootdisk-s0 12584484 612468 0 c1t1d0 ENA
    v space_var - ENABLED ACTIVE 1360719 SELECT - fsgen
    pl space_var-01 space_var ENABLED ACTIVE 1360719 CONCAT - RW
    sd rootdisk-s0-05 space_var-01 rootdisk-s0 17391780 1360719 0 c1t1d0 ENA
    v swapvol - ENABLED ACTIVE 4194828 ROUND - swap
    pl swapvol-02 swapvol ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-s0-01 swapvol-02 rootdisk-s0 0 4194828 0 c1t1d0 ENA
    v usr - ENABLED ACTIVE 8193204 ROUND - fsgen
    pl usr-02 usr ENABLED ACTIVE 8193204 CONCAT - RW
    sd rootdisk-s0-06 usr-02 rootdisk-s0 18752499 8193204 0 c1t1d0 ENA
    v var - ENABLED ACTIVE 4194828 ROUND - fsgen
    pl var-02 var ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-s0-04 var-02 rootdisk-s0 13196952 4194828 0 c1t1d0 ENA 

We note that now the volyums are ONLY on the new disk. Despite the fact that the plexes and subdisks from our root disk have been removed, we still have the root file system from the original c1t0d0s2 disk. VxVM also made a change to / etc / vfstab, as well as some other files on the c1t0d0s0 disk in the root file system. So, if we boot from it, the system will use only root, swap.usr and var slices when booting. In the previous team we were asked to reboot using the following command, which we will do.
# reboot -- vx-rootdisk
After the download, we will see that the system has booted not from the VxVM anymore, but directly from the slices on the original disk.

  # df -kl
    Filesystem kbytes used avail capacity Mounted on
    / dev / dsk / c1t0d0s0 4130826 1016531 3072987 25% /
    / dev / dsk / c1t0d0s4 4034088 3478926 514822 88% / usr
    / dev / dsk / c1t0d0s3 2055085 211996 1781437 11% / var 

We continue:
  # vxrootadm grow continue
    [10:39:06] VxVM vxrootadm INFO V-5-2-4843 Growing volumes ...
    [10:39:11] VxVM vxrootadm INFO V-5-2-4829 Bootsetup ckdg rootdisk-s0 ...
    VxVM vxrootadm INFO V-5-2-4880
         Phase 3 completed.  Devalias for the target disk: vx-rootdisk-s0
         Please reboot with this disk.  To do this type:
                 reboot - vx-rootdisk-s0
         After the system comes up, continue typing:
                 vxrootadm grow continue 

We loaded with slices on the original c1t0d0 disk, and while the new modules on the new c1t1d0 disk are not mounted and not used, VxVM can remove temporary “space” volyums, increase those that need to be followed by expanding UFS.
  # vxprint -ht
    Disk group: ckdg
    dg ckdg default default 9000 1231534571.8.v4u-v240d-fll03
    dm rootdisk c1t0d0s2 auto 66446 71060733 -
    dm rootdisk-s0 c1t1d0s2 auto 66446 71057844 -
    v rootvol - ENABLED ACTIVE 9000000 ROUND - root
    pl rootvol-02 rootvol ENABLED ACTIVE 9002124 CONCAT - RW
    sd rootdisk-s0-02 rootvol-02 rootdisk-s0 4194828 9002124 0 c1t1d0 ENA
    v swapvol - ENABLED ACTIVE 4194828 ROUND - swap
    pl swapvol-02 swapvol ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-s0-01 swapvol-02 rootdisk-s0 0 4194828 0 c1t1d0 ENA
    v usr - ENABLED ACTIVE 8193204 ROUND - fsgen
    pl usr-02 usr ENABLED ACTIVE 8193204 CONCAT - RW
    sd rootdisk-s0-06 usr-02 rootdisk-s0 18752499 8193204 0 c1t1d0 ENA
    v var - ENABLED ACTIVE 5555547 ROUND - fsgen
    pl var-02 var ENABLED ACTIVE 5555547 CONCAT - RW
    sd rootdisk-s0-04 var-02 rootdisk-s0 13196952 5555547 0 c1t1d0 ENA 

As we can see, temporary volums were removed and everything fell into place as we planned. The only thing that we can not see here is whether the UFS system has changed. Now, back to what we talked about at the beginning of the article, about the size of the volyum relative to the subdisk. Recall that slices and subdisks MUST begin and end clearly on the cylinder, but volyums do not have the following limitations. Volums must simply be smaller than or equal to the size of the subdisks. We indicated that rootvol should be increased to 9,000,000 sectors, VxVM did just that, but since the subdisk (and the corresponding slice) needs to be aligned on cylinders, it turned out to be slightly more than 9002124 sectors, a multiple of 2889. This does not cause any problems, however 2124 is slightly more 1MB and this place will not be used on the disk. In the case of the var section, we were prudent, and as a result do not see any discrepancies between the conceived and the resulting value. So now comes the last reboot.
# reboot -- vx-rootdisk-s0
After loading we will enter:
# vxrootadm grow continue
The last teams we will see the result of the work done.

  # vxdisk list
    DEVICE TYPE DISK GROUP STATUS
    c1t0d0s2 auto: sliced ​​- - online
    c1t1d0s2 auto: sliced ​​rootdisk-s0 ckdg online
    c1t2d0s2 auto: none - - online invalid
    c1t3d0s2 auto: none - - online invalid
    # vxprint -ht
    Disk group: ckdg
    dg ckdg default default 9000 1231534571.8.v4u-v240d-fll03
    dm rootdisk-s0 c1t1d0s2 auto 66446 71057844 -
    v rootvol - ENABLED ACTIVE 9000000 ROUND - root
    pl rootvol-02 rootvol ENABLED ACTIVE 9002124 CONCAT - RW
    sd rootdisk-s0-02 rootvol-02 rootdisk-s0 4194828 9002124 0 c1t1d0 ENA
    v swapvol - ENABLED ACTIVE 4194828 ROUND - swap
    pl swapvol-02 swapvol ENABLED ACTIVE 4194828 CONCAT - RW
    sd rootdisk-s0-01 swapvol-02 rootdisk-s0 0 4194828 0 c1t1d0 ENA
    v usr - ENABLED ACTIVE 8193204 ROUND - fsgen
    pl usr-02 usr ENABLED ACTIVE 8193204 CONCAT - RW
    sd rootdisk-s0-06 usr-02 rootdisk-s0 18752499 8193204 0 c1t1d0 ENA
    v var - ENABLED ACTIVE 5555547 ROUND - fsgen
    pl var-02 var ENABLED ACTIVE 5555547 CONCAT - RW
    sd rootdisk-s0-04 var-02 rootdisk-s0 13196952 5555547 0 c1t1d0 ENA
    # df -kl
    Filesystem kbytes used avail capacity Mounted on
    / dev / vx / dsk / bootdg / rootvol 4431534 1016814 3370405 24% /
    / dev / vx / dsk / bootdg / usr 4034088 3478926 514822 88% / usr
    / dev / vx / dsk / bootdg / var 2721668 207180 2432838 8% / var 

I hope this article will be pleasant, and will not tire readers with my ranting.

')

Source: https://habr.com/ru/post/124334/


All Articles