2.9.2.3 Reducing a Non-root LVM Partition on Systems Running Oracle Exadata System Software Release 11.2.3.2.1 or Later

You can reduce the size of a non-root (/u01) partition on systems running Oracle Exadata System Software release 11.2.3.2.1 or later.

Note:

  • This procedure does not require an outage on the server.

  • It is recommended that you back up your file system before performing this procedure.

  1. Use the df command to determine the amount of free and used space in the /u01 partition:
    # df -h /u01
    

    The following is an example of the output:

    Filesystem                    Size  Used Avail Use% Mounted on
    /dev/mapper/VGExaDb-LVDbOra1  193G   25G  159G  14% /u01
    
  2. Use the lvm command to display the current logical volume configuration used by the /u01 file system.

    In this example, the size of the LVDbOra1 partition needs to be reduced so that LVDbSys2 (30.00 GB in size) can be created by the dbserver_backup.sh script.

    # lvm vgdisplay VGExaDb -s
      "VGExaDb" 271.82 GB [250.04 GB used / 21.79 GB free]
    
    # lvm lvscan
      ACTIVE            '/dev/VGExaDb/LVDbSys1' [30.00 GB] inherit
      ACTIVE            '/dev/VGExaDb/LVDbSwap1' [24.00 GB] inherit
      ACTIVE            '/dev/VGExaDb/LVDbOra1' [196.04 GB] inherit
    
  3. Shut down any software that uses /u01.

    The following software typically uses /u01:

    • Oracle Clusterware, Oracle ASM, and Oracle Database

      # Grid_home/bin/crsctl stop crs
      
    • Trace File Analyzer

      # Grid_home/bin/tfactl stop
      
    • OS Watcher (releases earlier than 11.2.3.3.0)

      # /opt/oracle.oswatcher/osw/stopOSW.sh
      
    • ExaWatcher (release 11.2.3.3.0 and later)

      # /opt/oracle.ExaWatcher/ExaWatcher.sh --stop
      
    • Oracle Enterprise Manager agent

      (oracle)$ agent_home/bin/emctl stop agent
      
  4. Unmount the partition as the root user.
    # umount /u01
    

    Note:

    If the umount command reports that the file system is busy, then use the fuser(1) command to identify the processes still accessing the file system that must be stopped before the umount command will succeed.

    # umount /u01
    umount: /u01: device is busy
    umount: /u01: device is busy
    
    # fuser -mv /u01
    
            USER      PID ACCESS COMMAND
    /u01:   root     6788 ..c..  ssh
            root     8422 ..c..  bash
            root    11444 ..c..  su
            oracle  11445 ..c..  bash
            oracle  11816 ....m  mgr
            root    16451 ..c..  bash
  5. Verify the file system.
    # e2fsck -f /dev/VGExaDb/LVDbOra1
    
    fsck 1.39 (29-May-2006)
    e2fsck 1.39 (29-May-2006)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    DBORA: 72831/25706496 files (2.1% non-contiguous), 7152946/51389440 blocks
    
  6. Resize the file system to the required size (120G in the example below).
    # resize2fs /dev/VGExaDb/LVDbOra1 120G
    resize2fs 1.39 (29-May-2017)
    Resizing the filesystem on /dev/VGExaDb/LVDbOra1 to 26214400 (4k) blocks.
    The filesystem on /dev/VGExaDb/LVDbOra1 is now 26214400 blocks long.
    
  7. Resize the LVM to the desired size.
    # lvm lvreduce -L 120G --verbose /dev/VGExaDb/LVDbOra1
        Finding volume group VGExaDb
      WARNING: Reducing active logical volume to 120.00 GB
      THIS MAY DESTROY YOUR DATA (filesystem etc.)
    Do you really want to reduce LVDbOra1? [y/n]: y
        Archiving volume group "VGExaDb" metadata (seqno 8).
      Reducing logical volume LVDbOra1 to 120.00 GB
        Found volume group "VGExaDb"
        Found volume group "VGExaDb"
        Loading VGExaDb-LVDbOra1 table (253:2)
        Suspending VGExaDb-LVDbOra1 (253:2) with device flush
        Found volume group "VGExaDb"
        Resuming VGExaDb-LVDbOra1 (253:2)
        Creating volume group backup "/etc/lvm/backup/VGExaDb" (seqno 9).
      Logical volume LVDbOra1 successfully resized
    
  8. Mount the partition.
    # mount -t ext3 /dev/VGExaDb/LVDbOra1 /u01
    
  9. Verify the space was reduced.
    # df -h /u01
    Filesystem                    Size  Used Avail Use% Mounted on
    /dev/mapper/VGExaDb-LVDbOra1  119G   25G   88G  22% /u01
    
    # lvm vgdisplay -s
      "VGExaDb" 271.82 GB [174.00 GB used / 97.82 GB free]
    
  10. Restart any software that was stopped in step 3.
    • Oracle Clusterware, Oracle ASM, and Oracle Database

      # Grid_home/bin/crsctl start crs
      
    • Trace File Analyzer

      # Grid_home/bin/tfactl start
      
    • OS Watcher (releases earlier than 11.2.3.3.0)

      # /opt/oracle.cellos/vldrun -script oswatcher
      
    • ExaWatcher (release 11.2.3.3.0 to release 18.1.x)

      # /opt/oracle.cellos/vldrun -script oswatcher
      
    • ExaWatcher (release 19.0.0.0 and later)

      # systemctl start ExaWatcher
    • Oracle Enterprise Manager agent

      (oracle)$ agent_home/bin/emctl start agent