{"id":1051,"date":"2025-09-17T08:09:19","date_gmt":"2025-09-17T06:09:19","guid":{"rendered":"https:\/\/anjo.pt\/keyword-oracle\/?p=1051"},"modified":"2025-09-17T08:27:36","modified_gmt":"2025-09-17T06:27:36","slug":"extend-partition-from-vmware-in-oracle-linux-part-1","status":"publish","type":"post","link":"https:\/\/anjo.pt\/keyword-oracle\/2025\/09\/17\/extend-partition-from-vmware-in-oracle-linux-part-1\/","title":{"rendered":"Extend partition from VMWare in Oracle Linux &#8211; part 1"},"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>Part 1 &#8211; extend mountpoint alone in a block device (\/u02 in the table below)<\/li>\n\n\n\n<li><a href=\"https:\/\/anjo.pt\/keyword-oracle\/2025\/09\/17\/extend-partition-from-vmware-in-oracle-linux-part-2\/\" data-type=\"post\" data-id=\"1054\">Part 2 &#8211; extend a specific mountpoint within several partitions in a block device (\/u01 in the table below)<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Extend single partition of 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 \/u02 from 100G to 300G. The disk is \/dev\/sdb<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm02 ~]# 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\nsr0                               11:0    1 356.9M  0 rom  \n<\/pre><\/div>\n\n\n<!--more-->\n\n\n\n<p>The key point in VMWare provided disks, is to rescan the disk, so that it sees it was increased.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n# Before scan it has 100G. Output is trimmed.\n&#x5B;root@vmware-vm02 ~]# fdisk -l \/dev\/sdb\nDisk \/dev\/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors\n...\n\n# Scan disk\n&#x5B;root@vmware-vm02 ~]# echo 1&gt;\/sys\/class\/block\/sdb\/device\/rescan\n\n# Now it shows 300G\n&#x5B;root@vmware-vm02 ~]# fdisk -l \/dev\/sdb\nDisk \/dev\/sdb: 300 GiB, 322122547200 bytes, 629145600 sectors\nDisk model: Virtual disk    \nUnits: sectors of 1 * 512 = 512 bytes\nSector size (logical\/physical): 512 bytes \/ 512 bytes\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\nDisklabel type: dos\nDisk identifier: 0xb8747b5e\n\nDevice     Boot Start       End   Sectors  Size Id Type\n\/dev\/sdb1        2048 209715199 209713152  100G 83 Linux\n\n# Also lsblk shows 300G for the disk\n&#x5B;root@vmware-vm02 ~]# lsblk \/dev\/sdb\nNAME                             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nsdb                                8:16   0   300G  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<p>As there is only partition \/u02 in this disk, I want to extend it to use the full disk. I used parted tool and the resizepart command with partition number and saying to use 100% of the space.\/<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm02 ~]# parted \/dev\/sdb\nGNU Parted 3.5\nUsing \/dev\/sdb\nWelcome to GNU Parted! Type &#039;help&#039; to view a list of commands.\n(parted) print                                                            \nModel: VMware Virtual disk (scsi)\nDisk \/dev\/sdb: 322GB\nSector size (logical\/physical): 512B\/512B\nPartition Table: msdos\nDisk Flags: \n\nNumber  Start   End    Size   Type     File system  Flags\n 1      1049kB  107GB  107GB  primary\n\n(parted) help resizepart\n  resizepart NUMBER END                    resize partition NUMBER\n\nNUMBER is the partition number used by Linux.  On MS-DOS disk labels, the primary partitions number from 1 to 4, logical partitions from 5 onwards.\n        END is disk location, such as 4GB or 10%.  Negative value counts from the end of the disk.  For example, -1s specifies exactly the last sector.\n\n(parted) resizepart 1 100%                                                \n\n(parted) quit\n<\/pre><\/div>\n\n\n<p>Now I make it visible to the physical volume \/dev\/sdb1 with the pvresize. In lsblk now two lines are updated.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm02 ~]# pvresize \/dev\/sdb1\n  Physical volume &quot;\/dev\/sdb1&quot; changed\n  1 physical volume(s) resized or updated \/ 0 physical volume(s) not resized\n\n&#x5B;root@vmware-vm02 ~]# pvdisplay \/dev\/sdb1\n  --- Physical volume ---\n  PV Name               \/dev\/sdb1\n  VG Name               vg_u02\n  PV Size               &amp;lt;300.00 GiB \/ not usable 2.00 MiB\n  Allocatable           yes \n  PE Size               4.00 MiB\n  Total PE              76799\n  Free PE               51200\n  Allocated PE          25599\n  PV UUID               2NMbpD-OYg0-ahYe-lRn1-Boig-eSu4-zTcoaU                      \n\n&#x5B;root@vmware-vm02 ~]# lsblk \/dev\/sdb\nNAME              MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS\nsdb                 8:16   0  300G  0 disk \n\u2514\u2500sdb1              8:17   0  300G  0 part \n  \u2514\u2500vg_u02-lv_u02 252:7    0  100G  0 lvm  \/u02\n<\/pre><\/div>\n\n\n<p>Then I need to extend the logical volume associated with \/u02 using the lvextend. The filesystem is still 100G. I use df -Th to check what is the filesystem type (in the past was usually ext4, now they are mostly xfs):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm02 ~]# lvextend -l 100%VG \/dev\/mapper\/vg_u02-lv_u02\n  Size of logical volume vg_u02\/lv_u02 changed from &amp;lt;100.00 GiB (25599 extents) to &amp;lt;300.00 GiB (76799 extents).\n  Logical volume vg_u02\/lv_u02 successfully resized.\n\n&#x5B;root@vmware-vm02 ~]# df -Th \/u02\nFilesystem                Type  Size  Used Avail Use% Mounted on\n\/dev\/mapper\/vg_u02-lv_u02 xfs   100G   92G  8.3G  92% \/u02  \n<\/pre><\/div>\n\n\n<p>Finally I extend the filesytem using xfs_growfs:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm02 ~]# xfs_growfs \/dev\/mapper\/vg_u02-lv_u02\nmeta-data=\/dev\/mapper\/vg_u02-lv_u02 isize=512    agcount=4, agsize=6553344 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=26213376, 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 26213376 to 78642176\n<\/pre><\/div>\n\n\n<p>The \/u02 partition is now 300G also for the OS:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;root@vmware-vm02 ~]# df -Th \/u02\nFilesystem                Type  Size  Used Avail Use% Mounted on\n\/dev\/mapper\/vg_u02-lv_u02 xfs   300G   94G  207G  32% \/u02\n<\/pre><\/div>\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,6],"tags":[87],"class_list":{"0":"post-1051","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-linux","7":"category-oracle","8":"tag-oracle-linux-9","9":"czr-hentry"},"_links":{"self":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1051","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=1051"}],"version-history":[{"count":4,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1051\/revisions"}],"predecessor-version":[{"id":1057,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/posts\/1051\/revisions\/1057"}],"wp:attachment":[{"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/media?parent=1051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/categories?post=1051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anjo.pt\/keyword-oracle\/wp-json\/wp\/v2\/tags?post=1051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}