How to resize /u01 on an ODA?

“Can you please add 50 G to/u01 for me?” Many Oracle DBAs or system Admins are nervous about making changes to their Linux systems specially on a ODA (Oracle Database Appliance).
⇒ As you will see it’s very easy!

The default size of 99GB for /u01 may not be sufficient and must be increased to upgrade or patch the ODA with a new bundle.

Indeed, many of the Oracle Engineered Systems (ES), like the ODA use LVM to manage the OS disk space, giving the admin max of flexibility to grow or shrink any file system.

Here is the steps to resize the file system /u01 on a ODA

Verify the actual Situation and the Disk Configuration

[root@montreal1 ~]# df -m /u01
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/VolGroupSys-LogVolU01
100666 77841 17705 82% /u01

[root@mtl1spoda4n1 ~]# pvdisplay
pvdisplay shows the attributes of the physical volumes, like size, physical extent size, space used for the VG descriptor area

— Physical volume —
PV Name /dev/md1
VG Name VolGroupSys
PV Size 446.03 GiB / not usable 29.00 MiB
Allocatable yes
PE Size 32.00 MiB
Total PE 14272
Free PE 6784
Allocated PE 7488
PV UUID LYwpPW-swKo-ZPV8-XVh8-yBbA-1Uyq-8mezRn

[root@montreal1 ~]# lvdisplay /dev/mapper/VolGroupSys-LogVolU01
lvdisplay allows you to see the attributes of a logical volume like size, read/write status, snapshot information
— Logical volume —
LV Path /dev/VolGroupSys/LogVolU01
LV Name LogVolU01
VG Name VolGroupSys
LV UUID JndBuD-aabD-GDVz-C7BP-SpkZ-VcTq-3484Gd
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2018-06-06 09:04:14 -0400
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 3200
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 249:2

Extend /u01

Now we extend online the LVM with the lvextend command from 100 GB to 150 GB:

[root@montreal1~]# lvextend –size +50G /dev/VolGroupSys/LogVolU01
lvextend allows you to extend the size of a logical volume
Size of logical volume VolGroupSys/LogVolU01 changed from 100.00 GiB (3200 extents) to 150.00 GiB (4800 extents).
Logical volume LogVolU01 successfully resized.

The logical volume is now 150 GB:
[root@montreal1~]# lvdisplay /dev/mapper/VolGroupSys-LogVolU01
— Logical volume —
LV Path /dev/VolGroupSys/LogVolU01
LV Name LogVolU01
VG Name VolGroupSys
LV UUID JndBuD-aabD-GDVz-C7BP-SpkZ-VcTq-3484Gd
LV Write Access read/write
LV Creation host, time localhost.localdomain, 2018-06-06 09:04:14 -0400
LV Status available
# open 1
LV Size 150.00 GiB
Current LE 4800
Segments 2
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 249:2

Finally the filesystem has to be resized:

[root@montreal1~]# resize2fs /dev/VolGroupSys/LogVolU01
The resize2fs program will resize the file system. It can be used to enlarge or shrink a file system. By default, resize2fs will expand the filesystem to fill the partition
resize2fs 1.43-WIP (20-Jun-2013)
Filesystem at /dev/VolGroupSys/LogVolU01 is mounted on /u01; on-line resizing required
old_desc_blocks = 7, new_desc_blocks = 10
Performing an on-line resize of /dev/VolGroupSys/LogVolU01 to 39321600 (4k) blocks.
The filesystem on /dev/VolGroupSys/LogVolU01 is now 39321600 blocks long.

[root@montreal1~]# df -m /u01
Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/VolGroupSys-LogVolU01
151062 77843 65540 55% /u01

==> Very GOOD !

Summary

In this article we learned how to resize/increase/grow the size of /u01 file system on a ODA. The/u01 FS is configured to host Oracle binaries like Oracle_home and Grid Infrastructure . By default and it is set to 100GB which is not sufficient for storing big files or for upgrades and patches.