{"id":1054,"date":"2025-09-17T08:26:53","date_gmt":"2025-09-17T06:26:53","guid":{"rendered":"https:\/\/anjo.pt\/keyword-oracle\/?p=1054"},"modified":"2025-09-17T08:28:54","modified_gmt":"2025-09-17T06:28:54","slug":"extend-partition-from-vmware-in-oracle-linux-part-2","status":"publish","type":"post","link":"https:\/\/anjo.pt\/keyword-oracle\/2025\/09\/17\/extend-partition-from-vmware-in-oracle-linux-part-2\/","title":{"rendered":"Extend partition from VMWare in Oracle Linux \u2013 part 2"},"content":{"rendered":"\n<p>The client uses VMWare as virtualization platform for the Oracle Database VMs (yes, he is aware of the License implications).<\/p>\n\n\n\n<p>The VM is running out of space in two partitions. The VMWare Admin extended the disks on their platform. Now I need to make this extension visible in Oracle Linux. This things we do once every 10 years, when versions, filesystems and tools already changed.<\/p>\n\n\n\n<p>For this post in 2025, I&#8217;m using Oracle Linux 9, xfs filesystems. All operation are online, with databases running.<\/p>\n\n\n\n<p>I divide this post in two parts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/anjo.pt\/keyword-oracle\/2025\/09\/17\/extend-partition-from-vmware-in-oracle-linux-part-1\/\" data-type=\"post\" data-id=\"1051\">Part 1 &#8211; extend mountpoint alone in a block device (\/u02 in the table below)<\/a> &#8211; more detailed explanations<\/li>\n\n\n\n<li>Part 2 &#8211; extend a specific mountpoint within several partitions in a block device (\/u01 in the table below)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Extend a mountpoint within several partitions in a block device<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\noracle@vmware-vm01 MIG01C $ cat \/etc\/system-release \nOracle Linux Server release 9.6\n<\/pre><\/div>\n\n\n<p>The partition tree is below, and I need to increase the \/u01 from 50G to 100G. The disk is \/dev\/sda<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm01 ~]# lsblk\nNAME                             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nsda                                8:0    0   774G  0 disk \n\u251c\u2500sda1                             8:1    0   250M  0 part \/boot\/efi\n\u251c\u2500sda2                             8:2    0     1G  0 part \/boot\n\u2514\u2500sda3                             8:3    0    77G  0 part \n  \u251c\u2500ol_vmware-vm02-root          252:0    0    10G  0 lvm  \/\n  \u251c\u2500ol_vmware-vm02-swap          252:1    0     4G  0 lvm  &#x5B;SWAP]\n  \u251c\u2500ol_vmware-vm02-var_log_audit 252:2    0     1G  0 lvm  \/var\/log\/audit\n  \u251c\u2500ol_vmware-vm02-u01           252:3    0    50G  0 lvm  \/u01\n  \u251c\u2500ol_vmware-vm02-home          252:4    0     5G  0 lvm  \/home\n  \u251c\u2500ol_vmware-vm02-var_log       252:5    0     2G  0 lvm  \/var\/log\n  \u2514\u2500ol_vmware-vm02-var           252:6    0     5G  0 lvm  \/var\nsdb                                8:16   0   100G  0 disk \n\u2514\u2500sdb1                             8:17   0   100G  0 part \n  \u2514\u2500vg_u02-lv_u02                252:7    0   100G  0 lvm  \/u02\n<\/pre><\/div>\n\n\n<!--more-->\n\n\n\n<p>First thing to do in a VMWare environment is to rescan the device, after that the disk was extended by VMWare admins.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm01 ~]# echo 1&gt;\/sys\/class\/block\/sda\/device\/rescan\n<\/pre><\/div>\n\n\n<p>Now we can already see that the \/dev\/sda device is 600GB, which can be used for all partitions under it<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm01 ~]# parted \/dev\/sda print\nModel: VMware Virtual disk (scsi)\nDisk \/dev\/sda: 644GB\nSector size (logical\/physical): 512B\/512B\nPartition Table: gpt\nDisk Flags: \n\nNumber  Start   End     Size    File system  Name                  Flags\n 1      1049kB  263MB   262MB   fat16        EFI System Partition  boot, esp\n 2      263MB   1337MB  1074MB  xfs\n 3      1337MB  84.0GB  82.7GB                                     lvm\n\n&#x5B;root@vmware-vm01 ~]# lsblk \/dev\/sda\nNAME                             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nsda                                8:0    0  600G  0 disk \n\u251c\u2500sda1                             8:1    0  250M  0 part \/boot\/efi\n\u251c\u2500sda2                             8:2    0    1G  0 part \/boot\n\u2514\u2500sda3                             8:3    0   77G  0 part \n  \u251c\u2500ol_vmware-vm01-root          252:0    0   10G  0 lvm  \/\n  \u251c\u2500ol_vmware-vm01-swap          252:1    0    4G  0 lvm  &#x5B;SWAP]\n  \u251c\u2500ol_vmware-vm01-var_log_audit 252:3    0    1G  0 lvm  \/var\/log\/audit\n  \u251c\u2500ol_vmware-vm01-home          252:4    0    5G  0 lvm  \/home\n  \u251c\u2500ol_vmware-vm01-var           252:5    0    5G  0 lvm  \/var\n  \u251c\u2500ol_vmware-vm01-var_log       252:6    0    2G  0 lvm  \/var\/log\n  \u2514\u2500ol_vmware-vm01-u01           252:7    0   50G  0 lvm  \/u01\n<\/pre><\/div>\n\n\n<p>The key element from the output above is, I need to increase the partition where the \/u01 mountpoint is located. In my case it is the third partition \/dev\/sda3 which has now 77GB. The parted command shows the size (82.7GB) and the end point of the partition (84GB). The resize command lets to change the end point. I decide to move it to 150G.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm01 ~]# parted \/dev\/sda &quot;resizepart 3 150G&quot;\nInformation: You may need to update \/etc\/fstab.\n\n&#x5B;root@vmware-vm01 ~]# lsblk \/dev\/sda\nNAME                             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nsda                                8:0    0   600G  0 disk \n\u251c\u2500sda1                             8:1    0   250M  0 part \/boot\/efi\n\u251c\u2500sda2                             8:2    0     1G  0 part \/boot\n\u2514\u2500sda3                             8:3    0 138.5G  0 part \n  \u251c\u2500ol_vmware-vm01-root          252:0    0    10G  0 lvm  \/\n  \u251c\u2500ol_vmware-vm01-swap          252:1    0     4G  0 lvm  &#x5B;SWAP]\n  \u251c\u2500ol_vmware-vm01-var_log_audit 252:3    0     1G  0 lvm  \/var\/log\/audit\n  \u251c\u2500ol_vmware-vm01-home          252:4    0     5G  0 lvm  \/home\n  \u251c\u2500ol_vmware-vm01-var           252:5    0     5G  0 lvm  \/var\n  \u251c\u2500ol_vmware-vm01-var_log       252:6    0     2G  0 lvm  \/var\/log\n  \u2514\u2500ol_vmware-vm01-u01           252:7    0    50G  0 lvm  \/u01\n<\/pre><\/div>\n\n\n<p>Now I need to make it visible to the physical volume, using <code>pvresize<\/code>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm01 ~]# pvdisplay \/dev\/sda3\n  --- Physical volume ---\n  PV Name               \/dev\/sda3\n  VG Name               ol_vmware-vm01\n  PV Size               &amp;lt;77.01 GiB \/ not usable 4.00 MiB\n  Allocatable           yes \n  PE Size               4.00 MiB\n  Total PE              19713\n  Free PE               1\n  Allocated PE          19712\n  PV UUID               nc8Cay-LXfL-3eIc-iJSM-cAhh-rh1V-tZ8rba\n  \n\n&#x5B;root@vmware-vm01 ~]# pvresize \/dev\/sda3\n  Physical volume &quot;\/dev\/sda3&quot; changed\n  1 physical volume(s) resized or updated \/ 0 physical volume(s) not resized\n<\/pre><\/div>\n\n\n<p>And extend the logical volume associated with \/u01 to 100% of the volume group.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm01 ~]# lvextend -l 100%VG \/dev\/mapper\/ol_vmware-vm01-u01\n  Reducing 100%VG to remaining free space &amp;lt;111.45 GiB in VG.\n  Size of logical volume ol_vmware-vm01\/u01 changed from 50.00 GiB (12800 extents) to &amp;lt;111.45 GiB (28531 extents).\n  Logical volume ol_vmware-vm01\/u01 successfully resized.\n\n&#x5B;root@vmware-vm01 ~]# lsblk \/dev\/sda\nNAME                             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nsda                                8:0    0   600G  0 disk \n\u251c\u2500sda1                             8:1    0   250M  0 part \/boot\/efi\n\u251c\u2500sda2                             8:2    0     1G  0 part \/boot\n\u2514\u2500sda3                             8:3    0 138.5G  0 part \n  \u251c\u2500ol_vmware-vm01-root          252:0    0    10G  0 lvm  \/\n  \u251c\u2500ol_vmware-vm01-swap          252:1    0     4G  0 lvm  &#x5B;SWAP]\n  \u251c\u2500ol_vmware-vm01-var_log_audit 252:3    0     1G  0 lvm  \/var\/log\/audit\n  \u251c\u2500ol_vmware-vm01-home          252:4    0     5G  0 lvm  \/home\n  \u251c\u2500ol_vmware-vm01-var           252:5    0     5G  0 lvm  \/var\n  \u251c\u2500ol_vmware-vm01-var_log       252:6    0     2G  0 lvm  \/var\/log\n  \u2514\u2500ol_vmware-vm01-u01           252:7    0 111.4G  0 lvm  \/u01\n<\/pre><\/div>\n\n\n<p>At the end I increase the xfs filesystem of the mountpoint with <code>xfs_growfs<\/code>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm01 ~]# df -Th \/u01\nFilesystem                     Type  Size  Used Avail Use% Mounted on\n\/dev\/mapper\/ol_vmware-vm01-u01 xfs    50G   47G  3.5G  94% \/u01\n\n&#x5B;root@vmware-vm01 ~]# xfs_growfs \/dev\/mapper\/ol_vmware-vm01-u01\nmeta-data=\/dev\/mapper\/ol_vmware-vm01-u01 isize=512    agcount=4, agsize=3276800 blks\n         =                       sectsz=512   attr=2, projid32bit=1\n         =                       crc=1        finobt=1, sparse=1, rmapbt=0\n         =                       reflink=1    bigtime=1 inobtcount=1 nrext64=0\n         =                       exchange=0  \ndata     =                       bsize=4096   blocks=13107200, imaxpct=25\n         =                       sunit=0      swidth=0 blks\nnaming   =version 2              bsize=4096   ascii-ci=0, ftype=1, parent=0\nlog      =internal log           bsize=4096   blocks=16384, version=2\n         =                       sectsz=512   sunit=0 blks, lazy-count=1\nrealtime =none                   extsz=4096   blocks=0, rtextents=0\ndata blocks changed from 13107200 to 29215744\n\n&#x5B;root@vmware-vm01 ~]# df -Th \/u01\nFilesystem                     Type  Size  Used Avail Use% Mounted on\n\/dev\/mapper\/ol_vmware-vm01-u01 xfs   112G   47G   65G  43% \/u01\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The client uses VMWare as virtualization platform for the Oracle Database VMs (yes, he is aware of the License implications). The VM is running out of space in two partitions. The VMWare Admin extended the disks on their platform. Now I need to make this extension visible in Oracle Linux. This things we do once [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[87],"class_list":{"0":"post-1054","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-linux","7":"tag-oracle-linux-9","8":"czr-hentry"},"_links":{"self":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/comments?post=1054"}],"version-history":[{"count":2,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1054\/revisions"}],"predecessor-version":[{"id":1058,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1054\/revisions\/1058"}],"wp:attachment":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/media?parent=1054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/categories?post=1054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/tags?post=1054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}