12 Replies Latest reply on Jun 11, 2018 11:57 PM by Dude!

    OL7u5 goodness

    feeble

      Just wanted to let people know something I discovered. I did not see this in the release notes. But I may have overlooked it. Anyway, It seems we can now online resize the system disk. This is particularly useful with VMs. I grew a vdisk from 50GB to 100GB. I then resized the second partition. Then did a partprobe on the partition and it came back without error. totally unexpected. Usually you get an error about not being able to re-read the partition. I did my pvresize and grew a few lvols. Really awesome. No longer have to reboot to resize the system disk.

        • 1. Re: OL7u5 goodness
          Sergio-Oracle

          Cool! Could you share how you did it?

           

          Sergio

          • 2. Re: OL7u5 goodness
            feeble

            1. grow the vdisk

            2. login to the VM

            3. delete and resize the LVM partition, using fdisk, or parted.

            4. run partprobe on the system disk.

                # partprobe /dev/xvda

            5, run pvresize on the LVM partition. Ex.

                # pvresize /dev/xvda2

            6. resize an lvol

                # lvresize -r -L +5g /dev/mapper/vg00-lvol5

             

            All done. If you don't use LVM, then it's different. But the key is that the partprobe now works online without a reboot. Hopefully it's not a fluke. Looks like it works as of parted 3.1-29.

             

                * Thu Aug 10 2017 Brian C. Lane <bcl@redhat.com> - 3.1-29

                - Add support for NVMe devices

                Resolves: rhbz#1316239

                - Backport partition resize command

                Resolves: rhbz#1423357

            • 3. Re: OL7u5 goodness
              feeble

              Actually looks like this may have been changed in 7.4. I had not tried this in a while.

              • 4. Re: OL7u5 goodness
                Dude!

                I suggest to review https://access.redhat.com/solutions/199573

                 

                There's also a nice example, including partprobe. You don't need a subscription to read the information.

                 

                Apparently it already existed for LVM volumes, but has been added to older style partitions as of RHEL 7.

                 

                However, there's a warning that it's not recommended.

                 

                "While it is possible to perform online partition resize operation, it is not recommended simply from a data integrity standpoint and not because it's not possible."

                • 5. Re: OL7u5 goodness
                  Dude!

                  Btw, fwiw, I just remembered that I posted how to resize the root LVM volume:

                   

                  How to Resize LVM Root in Oracle Linux 7

                   

                  This should be useful in particular if you plan to shrink an XFS volume.

                  • 6. Re: OL7u5 goodness
                    feeble
                    • Unfortunately, since the partitions in the boot virtual block device are already in use, those can't be modified online and the virtual machine won't pick up the changes on the boot virtual block device without a reboot.

                    I am referring to this from the Doc. The boot device, what I have been calling the system disk, can now be resized online without a reboot. What I do not know is if this is intentional. I don't do partitions with LVM. It's a waste. But the boot disk usually has 2 to 3 partitions (EFI). And when I need more space, I usually grow the boot device, resize the LVM parition, reboot, etc, etc.

                     

                    I have a suspicion that this works due to a change in parted and may not be desired. I added info to a closed rhbz, just in case this was unintentional. I would have expected to see something like mentioned in some of the release notes. Growing the boot disk online is something people have wanted for years.

                    • 7. Re: OL7u5 goodness
                      feeble

                      Wow! Just read the full doc. I didn't realize it was possible to do this already using partx.

                       

                      Execute partx (provided by util-linux package) with --update option on the block device to update the in-memory kernel partition table from the on-disk partition table:

                       

                      Interesting.

                      • 8. Re: OL7u5 goodness
                        Dude!

                        I have a suspicion that this works due to a change in parted and may not be desired.

                        As the document outlines, the feature was added, but using it isn't recommended. Why do you think the change was unintentional or not desired?

                         

                        I don't do partitions with LVM. It's a waste.

                        Waste of what? You don't have to create partitions to use it for LVM, but it is best practice under Linux to partition any used space, including LVM. And mark the partition type accordingly. You're not accessing the disk media directly anyway, like it used to be under IBM/DOS CHS, and instead use a logical block anyway, so you cannot misalign. If any HDD is not partitioned, it's meant to indicate that it is not used and spare.

                        • 9. Re: OL7u5 goodness
                          feeble

                          Dude! wrote:

                           

                          I have a suspicion that this works due to a change in parted and may not be desired.

                          As the document outlines, the feature was added, but using it isn't recommended. Why do you think the change was unintentional or not desired?

                          This is so goofy. Almost every time IO correspond with you, I'd rather pull out my teeth. I don't always trust the documentation. There is always a possibility for unintended consequences. And a possibly that programs don't get fully tested.

                           

                          I don't do partitions with LVM. It's a waste.

                          Waste of what? You don't have to create partitions to use it for LVM, but it is best practice under Linux to partition any used space, including LVM. And mark the partition type accordingly. You're not accessing the disk media directly anyway, like it used to be under IBM/DOS CHS, and instead use a logical block anyway, so you cannot misalign. If any HDD is not partitioned, it's meant to indicate that it is not used and spare.

                           

                          I believe I said time. Maybe not for you, but I don't do it. I don't know your environment, but you can align with the pvcreate command. After the first sentence, you lost me. I only do whole disk on SAN drives. Mostly VMAX at this time.

                          • 10. Re: OL7u5 goodness
                            Dude!

                            It's takes less time to partition a drive, and you can use the whole disk too, than to fix using the wrong one. But a bad idea doesn't necessarily mean it won't be a good time.

                            • 11. Re: OL7u5 goodness
                              feeble

                              Dude! wrote:

                               

                              It's takes less time to partition a drive, and you can use the whole disk too, than to fix using the wrong one. But a bad idea doesn't necessarily mean it won't be a good time.

                              Most OS's today already deal with alignment. Maybe 8 years ago this was still an issue. And depending on your workloads, you may never have noticed. If I was still working with old OSes and legacy hardware, then maybe I would consider it. LVM2 these days starts the extents at 1mb. But on much larger volumes it starts at 16mb. Anyway, I still think it's a wast of time to partition SAN disks from modern arrays. You don't gain anything. You can resize a thin device, run a pvresize on the disk, then use lvresize to resize the lvol and resize the file system. You can continue to partition your disks to your hearts content.

                               

                              This comment on this page sums it up for me.

                               

                              https://access.redhat.com/discussions/1488023#comment-932993

                              • 12. Re: OL7u5 goodness
                                Dude!

                                I did not write that you should partition a drive to avoid misalignment. Block addressing is done by the drive (LBA), hence you don't have to worry about it. Problems can exist with advanced 4k addressing when using older partitioning software that does not use LBA 0. I suggest to review the following info, which explains it.

                                 

                                https://www.seagate.com/tech-insights/advanced-format-4k-sector-hard-drives-master-ti/

                                 

                                Anyway, I still think it's a wast of time to partition SAN disks from modern arrays. You don't gain anything.

                                It takes only a second to partition a drive. The benefit is storage management and avoiding human error. For example, if you get a bunch of hard drives or devices assigned for your system and any of these are already partitioned, chances are you may be using the wrong devices. So in order to avoid overwriting useful data, partitions can be helpful.