change disk partitions without reboot
iN cENTOS 6 I noted 2 different behaviour in LVM if I create Physical Volume to whole disk e.g. /dev/sda or if I create a PV to /dev/sda1, in both cases /dev/sda or /dev/sda1 are "Linux LVM - 8e".
If I need to increase size fo /dev/sda PV, I increase my physical disk (e.g. in VMware environment), I assure myself new disk size is detected by kernel (no reboot is necessary), I resize PV, LV and File System and I reach my target with no reboot server. In second case that is /dev/sda1 (when I have LVM partition and not whole disk) I need to reboot server otherwise kernel is not able to detect new Physical volume size. There is way to make it with no reboot ? i THINK kernel has the partition table in memory (2nd case) while if I'm using a partition-tables-less disk (1st case) It's necessary no boot. |
I don't know of any way to make the kernel accept new partitioning while the disk is in use, but consider just adding another disk with just the added space and adding that new disk to the volume group. If you want to clean things up at some later time when you are rebooting, enlarge that first disk, boot, and then pvmove the LVM extents on the second disk back to the first. Once you've done that, you can remove the second disk from the volume group and delete it. Yes, you can do pvmove while the system is running.
|
Here is my method applied in 1st, whole disk is linux LVM
increase vmware disk size echo 1 > /sys/class/scsi_device/x:y:z:k/device/rescan pvresize /dev/sdx lvextend -l +100%FREE /dev/... xfs_growfs /dev/... This procedure works only disk has no partitions, /dev/sdd: Quote:
|
Quote:
Yes the partition table is in memory and may not be automatically reread after using a partitioning utility. There are other utilities to reread the MBR/partition table which might work i.e. partx or partprobe. |
Quote:
Quote:
|
Quote:
|
Thanks for the info.
|
Quote:
What reason for similar behaviour for 1st and 2nd according to your opinion? |
Quote:
|
Quote:
|
Actually, I find it a bit surprising that the kernel will recognize a changed size of an active disk. Any explanation of why those two cases differ would be pure speculation on my part. You will just have to accept that there is no way to get the kernel to recognize a changed partition size without rebooting.
|
All times are GMT -5. The time now is 11:00 PM. |