What to do when partprobe doesn't detect new partition created?

Latest response

So I'm using gdisk to create a new partition to allocate towards LVM here at work and I'm having an issue with it.

At home, I have some instances of RHEL systems via AWS, and if I create say 100 to 125 MB partitions via gdisk. Once I create the new partition successfully, I can run partprobe, then blkid and see the UUID's tied to the partition. No need for a reboot.

At work, I just added 25 GB to a /var partition, however after running partprobe and blkid, I never saw the UUID, however I could see the new partition via gdisk.

So, in order to see the new partition, I reboot the vm and then I was able to run the various LVM commands to add the new space successfully.

So I'm just wondering why sometimes I have to reboot to see the new space to allocate towards LVM and then other times, I don't have to. Granted at work, I know we have SAN and hypervisor, however at home, when working with AWS, I don't know what is on the backend. I would think it would be consistent.

thanks

Responses

In general, if you change the geometry of an active partition, partprobe will tell you "you need to reboot". In general, if you change the geometry of an idle partition or create a completely new partition, you won't have to reboot.

So just for the sake of learning, what is the difference between an active partition Vs an idle partition.

I would think that is the OS is up and running, data is ether being read or written, and therefore active.

Just because the OS is up doesn't necessarily mean a given device is active. It really depends on how your filesystems are laid out versus the available devices and partitions.

An active partition is one that's opened for writing. Typically, this can be because you've got a mounted filesystem and/or an active LVM2 volume group on the partition. Using lsblk /dev/<DEVICE> will typically show you what structures are built on top of the and its partitions. From there, you can use umount to unmount any filesystems that are active on the partition/disk and lvchange or vgchange to offline any LVM2 volumes that are active for the device.

Online resize of LVM should happen immediate and no need of reboot. I assume that you had tried to slice up a new partition on the same block device which was being used for /var file system and then this new partition didn't identified by the kernel (/proc/partitions) until reboot. Yes, I've seen such situations and it was because of active LVMs on the same block device, to make kernel re-read partition table, need to unmount & de-activate corresponding lvm, after which partprobe would work and then /proc/partitions would shows new partition. Saying so, for /var file system this is not practical, hence, doing a reboot or doing it in single user mode (if complete reboot not permitted) may be ideal.

Is there a way to get this done, without un-mounting and de-activating underlying lvm? Lets hear it from our community about this. May be there is way which I'm not aware of it.

Try kpartx. I have better luck with VMs in VMware with kpartx over partprobe. On occasion I have to reboot no matter what. I've never dug into it to see why.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.