Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Extend a partition without reboot

PeterVanRijnNov 4 2014 — edited Nov 5 2014

Currently we are setting up and testing our new Oracle Linux environment.

I created on one of our VMWare (5.5) hosts a VM and installed Oracle Linux 6.5

Using LVM I created 1 basic Volume Group with the root partition and swap.

After I finished the installation I created an extra disk in VMware and created a new Volume Group containing the Oracle Logical Volumes and mount points.

Then I thought: this could better be a bit larger, so I extended in VMWare the second disk from 50GB to 100GB.

In the OL6-box I forced a SCSI rescan and with fdisk I first deleted /dev/sdb1 (size = 50GB) and in the same session created a new partition, size 100GB.

So far so good:

[root@koerlan 2:0:1:0]# fdisk -l /dev/sdb

Disk /dev/sdb: 107.4 GB, 107374182400 bytes

64 heads, 32 sectors/track, 102400 cylinders

Units = cylinders of 2048 * 512 = 1048576 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1      102400   104857584   8e  Linux LVM

Now the kernel has to be told that the partition has grown from 50 to 100GB.

As can be seen in /proc/partitions this is not yet the case:

...

   8       16  104857600 sdb

   8       17   52428784 sdb1

...

This should be fixed by using the partprobe command:

[root@koerlan 2:0:1:0]# partprobe /dev/sdb

Warning: WARNING: the kernel failed to re-read the partition table on /dev/sdb (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.

But as you can see, this operations fails.

From other resources on the web I understood this is new to OL6, in OL5 it used to work, but was considerd an unsafe operation.

That leaves a few other options:

[1] I can reboot the system.

We are not a 24x7 shop, but even I think it very clumsy not te be able to extend a filesystem without rebooting the system.

[2] in stead of extending an existing disk I could create a new one. The kernel can see this new disk and I can then use it in LVM to add to an existing LV.

Which means that I will end up with lots of extra disks during the lifetime of the server. It's possible, but not what I want.

Coming to my question: is there really no other way to add an disk extension to an existing VG without rebooting the system or creating new disks?

Thanks,

Peter

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 2 2014
Added on Nov 4 2014
1 comment
1,990 views