Score:0

Oracle Enterprise Linux: Growpart 'cannot grow partition'

mm flag

I've read a few blogs here on this but haven't come across similar situation as mine.

  1. i have expanded the drive by 5GiB on /dev/sda
  2. i have without rebooting made it visible by running the following command: echo 1 > /sys/class/block/sda/device/rescan

Please see the remaining rundown below:

[root@proddboem01 ~]# fdisk -l |grep ^Disk\ /dev/sd*
Disk /dev/sda: 205 GiB, 220117073920 bytes, 429916160 sectors
Disk /dev/sdb: 100 GiB, 107374182400 bytes, 209715200 sectors

[root@proddboem01 ~]# lsblk
NAME              MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
fd0                 2:0    1    4K  0 disk
sda                 8:0    0  205G  0 disk
├─sda1              8:1    0    1G  0 part /boot
├─sda2              8:2    0  102G  0 part
│ ├─VG--MAIN-root 252:0    0    8G  0 lvm  /
│ ├─VG--MAIN-opt  252:2    0   50G  0 lvm  /opt
│ ├─VG--MAIN-tmp  252:3    0   20G  0 lvm  /tmp
│ ├─VG--MAIN-var  252:4    0   15G  0 lvm  /var
│ └─VG--MAIN-home 252:5    0    2G  0 lvm  /home
└─sda3              8:3    0   16G  0 part [SWAP]
sdb                 8:16   0  100G  0 disk
└─VG--U01-u01     252:1    0  100G  0 lvm  /u01
sr0                11:0    1 1024M  0 rom

[root@proddboem01 ~]# growpart -v /dev/sda 2
update-partition set to true
FLOCK: try exec open fd 9, on failure exec exits this program
FLOCK: /dev/sda: obtained exclusive lock
resizing 2 on /dev/sda using resize_sfdisk_dos
429916160 sectors of 512. total size=220117073920 bytes
## sfdisk --unit=S --dump /dev/sda
label: dos
label-id: 0x86eb8ee1
device: /dev/sda
unit: sectors

/dev/sda1 : start=        2048, size=     2097152, type=83, bootable
/dev/sda2 : start=     2099200, size=   213909504, type=8e
/dev/sda3 : start=   216008704, size=    33554432, type=82
max_end=216008703 tot=429916160 pt_end=216008703 pt_start=2099200 pt_size=213909504
NOCHANGE: partition 2 is size 213909504. it cannot be grown
FLOCK: /dev/sda: releasing exclusive lock
[root@proddboem01 ~]#

what am i doing wrong?

Score:1
in flag

sda3 is in the way. swapoff, delete it, then you can increase the size of sda2.

You can recreate sda3 afterwards, or create a logical volume on your lvm on it, or use a swap file instead. The second and third options will make changes in the future easier.

Score:0
tr flag

A partition needs to be one chunk of your disk and it cannot be made of more than one pieces. Your newly created space is at the end of the disk and the partition you ant to extend is in the middle of the disk. So there's partition 3 in the way.

sda partitions: [sda1][sda2][sda3]{free space}

You can only grow partition 3 at this time.

Best solution would be to disable swap and delete partition 3

sda partitions: [sda1][sda2]{free space}

Then you can extend partition 2:

sda partitions: [sda1][sda2]

After that I would recommend to create the new swapping Device as logical volume in your volume group vg--main. Then you don't have to worry about it the next time you increase the disk.

Score:0
in flag

Please try to use oci-growfs. For background you refer oracle knowledge base.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.