Home Administration Resizing disk partitions on Oracle Exadata Database Machine

Resizing disk partitions on Oracle Exadata Database Machine

Oracle Engineers usually setup and configure an Exadata Database Machine when it is provisioned. The configurations are based on Oracle’s best practices and include customizations based on customer needs – usually initiated via Oracle Exadata Deployment Assistant (OEDA) that is filled by us. While most delivered systems have adequate sizing and will meet the needs of most customers, we may still have to make some changes to configurations to better suit our database environment. In this post, we will look at how to extend or resize the local disk space (partitions) for ‘root’ and non-root partitions. We will see how it is done for filesystems of type ext4 and the newer xfs.

Determine filesystem type

The steps you do depends on the type of filesystem you have. Most Exadata systems provisioned have used the traditional ext4 type file system. However, newer Exadata systems are provisioned using xfs file system. Check fstab to identify the filesystem type.

Example for ext4

> sudo cat /etc/fstab
LABEL=DBSYS             /                       ext4    defaults        1 1

Example for xfs

> sudo cat /etc/fstab
LABEL=DBSYS             /                       xfs    defaults        0 0

Since most users will have ext4, we will first look at how it is done when using ext4 type filesystem.

Resizing the root(/) partition – ext4

The procedure for extending the root partition depends on your Oracle Exadata System Software release. In most cases, you should be running Oracle Exadata System Software Release 11.2.3.2.1 or later. If you are running an older release, refer to the steps listed here.

Note, when resizing the root (/) partition, you should resize the active and inactive Sys LVM’s. And both LVDbSys1 and LVDbSys2 should be sized the same.

The steps here are performed as root user.

Current Space – filesystem

Use the df command to get the current size, used and available free space in the root (/) partition.

# df -Ph
Filesystem                                                       Size  Used Avail Use% Mounted on
/dev/mapper/VGExaDb-LVDbSys1                                      30G   23G  5.2G  82% /

Current Space – volume

Use the lvs command to get the current volume information.

# lvs -o lv_name,lv_path,vg_name,lv_size
  LV                 Path                            VG      LSize
  LVDbOra1           /dev/VGExaDb/LVDbOra1           VGExaDb 300.00g
  LVDbSwap1          /dev/VGExaDb/LVDbSwap1          VGExaDb  24.00g
  LVDbSys1           /dev/VGExaDb/LVDbSys1           VGExaDb  30.00g
  LVDbSys2           /dev/VGExaDb/LVDbSys2           VGExaDb  30.00g
  LVDoNotRemoveOrUse /dev/VGExaDb/LVDoNotRemoveOrUse VGExaDb   1.00g

As mentioned above, we should increase space for both logical volumes LVDbSys1 and LVDbSys1. They should be sized the same.

Current Space – Underlying Disk

Use vgdisplay and pvs commands to get information about the used and available space in the underlying disk/ volume group. The free space from the output is the maximum available free space. In this case, we have about 1.26 TB space available.

# vgdisplay -s
  "VGExaDb" 1.63 TiB  [385.00 GiB used / <1.26 TiB free]
# pvs
  PV         VG      Fmt  Attr PSize PFree
  /dev/sda2  VGExaDb lvm2 a--  1.63t <1.26t

Can we resize online?

Use the tune2fs command to check the online resize option. The resize_inode option should be listed in the output from the command. If the option is not listed, then the file system must be unmounted before resizing the partition. 

# tune2fs -l /dev/mapper/VGExaDb-LVDbSys1 | grep resize_inode
# tune2fs -l /dev/mapper/VGExaDb-LVDbSys2 | grep resize_inode

Example Output

# tune2fs -l /dev/mapper/VGExaDb-LVDbOra1 | grep resize_inode
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize

Extend the root volume

Resize both LVDbSys1 and LVDbSys2 logical volumes using the lvextend command. Here we add 30G to both the volumes.

# lvextend -L +30G /dev/VGExaDb/LVDbSys1
# lvextend -L +30G /dev/VGExaDb/LVDbSys2

Example Output

# lvextend -L +200G /dev/VGExaDb/LVDbOra1
  Size of logical volume VGExaDb/LVDbOra1 changed from 100.00 GiB (25600 extents) to 300.00 GiB (76800 extents).
  Logical volume LVDbOra1 successfully resized

Resize the filesystem

Use the resize2fs command to resize the file system. Only after this step will you be able to see the additional space when you run df command.

Active volume

# resize2fs /dev/VGExaDb/LVDbSys1
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/VGExaDb/LVDbSys1 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 4
The filesystem on /dev/VGExaDb/LVDbSys1 is now 15728640 blocks long.

Non-Active volume

# resize2fs /dev/VGExaDb/LVDbSys2
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/VGExaDb/LVDbSys2' first.


# e2fsck -f /dev/VGExaDb/LVDbSys2
e2fsck 1.42.9 (28-Dec-2013)
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
/dev/VGExaDb/LVDbSys2: 131512/1966080 files (0.1% non-contiguous), 6066364/7864320 blocks


# resize2fs /dev/VGExaDb/LVDbSys2
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/VGExaDb/LVDbSys2 to 15728640 (4k) blocks.
The filesystem on /dev/VGExaDb/LVDbSys2 is now 15728640 blocks long.

At this point, we have resized the root (/) partition and the additional free space should be shown at the volume level when you run lvs command and at the filesystem level when you run the df command.

# lvs -o lv_name,lv_path,vg_name,lv_size
  LV                 Path                            VG      LSize
  LVDbOra1           /dev/VGExaDb/LVDbOra1           VGExaDb 300.00g
  LVDbSwap1          /dev/VGExaDb/LVDbSwap1          VGExaDb  24.00g
  LVDbSys1           /dev/VGExaDb/LVDbSys1           VGExaDb  60.00g
  LVDbSys2           /dev/VGExaDb/LVDbSys2           VGExaDb  60.00g
  LVDoNotRemoveOrUse /dev/VGExaDb/LVDoNotRemoveOrUse VGExaDb   1.00g


# df -Ph
Filesystem                                      Size  Used Avail Use% Mounted on
/dev/mapper/VGExaDb-LVDbSys1                     59G   23G   33G  43% /

The steps should be the same when resizing a non-root volume. The exception here is that there is no second volume to resize. We resize the intended volume only.

Resizing a partition – xfs

Here we will look at the steps to resize a partition when it is formatted using xfs.

Commands to get utilization/configuration of space at filesystem, volume, and disk-level are mostly the same. Use df, lvs, pvs, vgdisplay to get this information.

We cannot use tune2fs or resize2fs on an xfs formatted volume. The Oracle Exadata Database Machine documentation is not updated for an xfs filesystem at the time of writing this post.

Option 1

Expand the volume and resize the filesystem

We can expand the underlying volume/partition and resize the filesystem in a single command if the partition is of type LVM. Use the -r option of the lvextend command.

# lvextend -L +200G /dev/VGExaDb/LVDbOra1 -r
# lvextend -L +35G /dev/VGExaDb/LVDbSys1 -r
# lvextend -L +35G /dev/VGExaDb/LVDbSys2 -r

Example

# lvextend -L +35G /dev/VGExaDb/LVDbSys1 -r
  Size of logical volume VGExaDb/LVDbSys1 changed from 15.00 GiB (3840 extents) to 50.00 GiB (12800 extents).
  Logical volume VGExaDb/LVDbSys1 successfully resized.
meta-data=/dev/mapper/VGExaDb-LVDbSys1 isize=256    agcount=16, agsize=245760 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0 spinodes=0 rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=3932160, imaxpct=25
         =                       sunit=256    swidth=256 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 3932160 to 13107200

That’s it! At this point, you should be able to see the additional free space at the volume level when you run lvs command and at the filesystem level when you run the df command.

If for some reason you are not able to expand the volume and resize the filesystem in one step like shown above, you can still take the 2 step approach.

Option 2

Expand the volume

Expand the volume using lvextend without using the -r option.

# lvextend -L +198G /dev/VGExaDb/LVDbOra1
  Size of logical volume VGExaDb/LVDbOra1 changed from 102.00 GiB (26112 extents) to 300.00 GiB (76800 extents).

Resize the filesystem

Use the xfs_growfs command to grow the filesystem.

# xfs_growfs -d /u01
meta-data=/dev/mapper/VGExaDb-LVDbOra1 isize=256    agcount=17, agsize=1638400 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0 spinodes=0 rmapbt=0
         =                       reflink=0
data     =                       bsize=4096   blocks=26738688, imaxpct=25
         =                       sunit=256    swidth=256 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=12800, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 26738688 to 78643200

Note, you can also use xfs_info command to get information of the filesystem. It is equivalent to invoking xfs_growfs with the -n option. The filesystem geometry is printed, and argument checking is performed, but no growth occurs.

Hope this helps! Leave a comment if you found this post helpful and I’d appreciate it.

References

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest posts

Steps to remove OEM Agent

Recently I migrated all targets (Cluster, Databases, Instances, ASM, etc) and their jobs to a 13c OEM...

DBCA fails with ORA-27125 on 19c

Issue I recently encountered an issue where DBCA failed with ORA-27125 when creating a...

How to rename a PDB in 19c

Let's look at how to rename a PDB in 19c. The steps are the same as 12c....

How to change the ethernet switch password on Exadata

Let's look at how to log in and change the ethernet switch (adm) password on an Exadata...

You might also likeRELATED
Recommended to you