How to extend a Linux PV partition online after virtual disk growthExtending LVM Volume Groups with Physical...

High voltage LED indicator 40-1000 VDC without additional power supply

infared filters v nd

Paid for article while in US on F-1 visa?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

dbcc cleantable batch size explanation

Could an aircraft fly or hover using only jets of compressed air?

Convert two switches to a dual stack, and add outlet - possible here?

Why does Kotter return in Welcome Back Kotter?

Do I have a twin with permutated remainders?

Has there ever been an airliner design involving reducing generator load by installing solar panels?

Can a vampire attack twice with their claws using Multiattack?

Watching something be written to a file live with tail

Why is 150k or 200k jobs considered good when there's 300k+ births a month?

Add text to same line using sed

Can a monk's single staff be considered dual wielded, as per the Dual Wielder feat?

What doth I be?

Why can't we play rap on piano?

Roll the carpet

Why can't I see bouncing of switch on oscilloscope screen?

Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?

Theorems that impeded progress

Is it possible to run Internet Explorer on OS X El Capitan?

Can I make popcorn with any corn?

Client team has low performances and low technical skills: we always fix their work and now they stop collaborate with us. How to solve?



How to extend a Linux PV partition online after virtual disk growth


Extending LVM Volume Groups with Physical Extents & pvresizeDebian Preseed use whole device for LVM Physical VolumeHow do I resize the partition of my guest Ubuntu OS in a VMware Fusion VM?Resize ext4 partition without losing data in virtual serverextend size of partitionUsing LVM to extend 2TB diskd on a linux VM?What is the difference between the Linux and Linux LVM partition type?Volumegroup using entire disks instead of partition - Extending online VmwareHow to extend LVM PV to the beginning of disk?Ubuntu 16.04 Virtual Machine / XenServer Storage Extend IssueLVM extend Filesystem: new partition vs. grow existing oneKVM guest doesn't recognize new size of raw disk after lvresize






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







13















VMware allows to extend the size of a virtual disk online - when the VM is running.
The next expected steps for Linux system are:




  1. extend the partition: delete and create a larger one with fdisk

  2. extend the PV size with pvresize

  3. use free extents for lvresize operations

  4. and then resize2fs for file system


But I am stuck on the first step: fdisk and sfdisk still display the old size for the disk.



My disk is a SCSI virtual disk connected thanks to the virtual LSI Logic controller.



How to refresh the virtual disk size and partition table information available in Linux kernel without reboot ?



As far as I know all that steps are possible for a running Windows, without reboot and even without any user actions thanks to VMWare tools. On Linux, I expects to do all steps online too and I already know steps 2, 3 and 4 work online. But the first one - change partition size declared in the partition table (still) seems to require a reboot.



Update: My system is a Debian Lenny with kernel 2.6.26 and the disk I have extended is the main disk with a large PV containing the "root" LV for "/".










share|improve this question































    13















    VMware allows to extend the size of a virtual disk online - when the VM is running.
    The next expected steps for Linux system are:




    1. extend the partition: delete and create a larger one with fdisk

    2. extend the PV size with pvresize

    3. use free extents for lvresize operations

    4. and then resize2fs for file system


    But I am stuck on the first step: fdisk and sfdisk still display the old size for the disk.



    My disk is a SCSI virtual disk connected thanks to the virtual LSI Logic controller.



    How to refresh the virtual disk size and partition table information available in Linux kernel without reboot ?



    As far as I know all that steps are possible for a running Windows, without reboot and even without any user actions thanks to VMWare tools. On Linux, I expects to do all steps online too and I already know steps 2, 3 and 4 work online. But the first one - change partition size declared in the partition table (still) seems to require a reboot.



    Update: My system is a Debian Lenny with kernel 2.6.26 and the disk I have extended is the main disk with a large PV containing the "root" LV for "/".










    share|improve this question



























      13












      13








      13


      11






      VMware allows to extend the size of a virtual disk online - when the VM is running.
      The next expected steps for Linux system are:




      1. extend the partition: delete and create a larger one with fdisk

      2. extend the PV size with pvresize

      3. use free extents for lvresize operations

      4. and then resize2fs for file system


      But I am stuck on the first step: fdisk and sfdisk still display the old size for the disk.



      My disk is a SCSI virtual disk connected thanks to the virtual LSI Logic controller.



      How to refresh the virtual disk size and partition table information available in Linux kernel without reboot ?



      As far as I know all that steps are possible for a running Windows, without reboot and even without any user actions thanks to VMWare tools. On Linux, I expects to do all steps online too and I already know steps 2, 3 and 4 work online. But the first one - change partition size declared in the partition table (still) seems to require a reboot.



      Update: My system is a Debian Lenny with kernel 2.6.26 and the disk I have extended is the main disk with a large PV containing the "root" LV for "/".










      share|improve this question
















      VMware allows to extend the size of a virtual disk online - when the VM is running.
      The next expected steps for Linux system are:




      1. extend the partition: delete and create a larger one with fdisk

      2. extend the PV size with pvresize

      3. use free extents for lvresize operations

      4. and then resize2fs for file system


      But I am stuck on the first step: fdisk and sfdisk still display the old size for the disk.



      My disk is a SCSI virtual disk connected thanks to the virtual LSI Logic controller.



      How to refresh the virtual disk size and partition table information available in Linux kernel without reboot ?



      As far as I know all that steps are possible for a running Windows, without reboot and even without any user actions thanks to VMWare tools. On Linux, I expects to do all steps online too and I already know steps 2, 3 and 4 work online. But the first one - change partition size declared in the partition table (still) seems to require a reboot.



      Update: My system is a Debian Lenny with kernel 2.6.26 and the disk I have extended is the main disk with a large PV containing the "root" LV for "/".







      linux virtualization vmware-esx lvm partition






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 12 '16 at 9:47







      Yves Martin

















      asked Apr 10 '12 at 11:45









      Yves MartinYves Martin

      5442520




      5442520






















          8 Answers
          8






          active

          oldest

          votes


















          9














          You can do this without a reboot. pvresize doesn't resize the physical volume until the partition is updated with the added space. You must fdisk the partition and recreate it with the the new full size of the disk, after you can rescan'd the drives for it to see the extra space in the first place.



          More info:
          http://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/






          share|improve this answer


























          • I agree but whatever I did to rescan the SCSI drive, I never got the new disk size visible in fdisk, so I was stuck until a first reboot. And "partprobe" is a new command for me. Definitely I have to test this procedure... Thank you.

            – Yves Martin
            Oct 9 '12 at 19:39











          • For information partprobe is a command from parted project.

            – Yves Martin
            Mar 25 '13 at 15:32











          • If you weren't seeing the new disk size in fdisk then the issue isn't with LVM. I'd have to ask how you were scanning since that usually picks up the new disk size to me. I also don't partition disks I'm going to use LVM on if I can help it. If you pvcreate the whole disk then updating the partition table is just one less thing you have to do when you go to resize it.

            – Bratchley
            Jun 11 '15 at 19:34



















          11














          The other answered provided do not address your question, I've identified the correct command to rescan an already connected disk.



          We must rescan your already connected disk, first identify which disk you want to rescan.



          ls /sys/class/scsi_disk/


          In my example, I see a symlink named 0:0:0:0, so we rescan this scsi-disk.



          echo '1' > /sys/class/scsi_disk/0:0:0:0/device/rescan


          I just extended my VMware disk also, and had to scour other answers to find the correct command. Hopefully this will save future searchers from futile attempts.






          share|improve this answer
























          • Worked perfectly!

            – Emil Styrke
            Oct 30 '17 at 11:49



















          4














          As far as the root file system / is mounted on the disk that has been resized, the partition table and disk size are not refreshed by a SCSI rescan with Linux 2.6.26.



          I really hope it will be better soon with newer kernel versions.



          So I had to:




          • reboot a first time to see the new disk size in fdisk

          • delete the old primary PV partion in fdisk

          • create a partition entry with the same number and start sector until the end of disk

          • reboot a second time OR run partprobe from parted package only if / is not mounted there

          • Now I can run pvresize to get new free space, lvextend and resize2fs to allocate some more space to a file system


          I have been recommended to simply discard that stupid old partition table and run pvcreate directly on the device as Grub2 is able to load a kernel image directly from a file system on a LVM partition. But such a setup is not obvious at all with distribution installers.



          Update: I have just checked with Debian GNU/Linux Jessie 8.2 running kernel 3.16 and parted 3.2, the partprobe now succeeds after partition table edition with cfdisk with no reboot. pvresize works immediately after.



          If you want to extend a PV stored as logical PC partition, for instance /dev/sda5 on extended primary partition /dev/sda2, do not use fdisk but prefer parted:



          parted /dev/sda2 -1
          parted /dev/sda5 -1
          pvresize /dev/sda5





          share|improve this answer


























          • Commands at end doesn't work # parted /dev/sda2 -1 -> parted: invalid option -- '1'

            – Oskar Berggren
            Jun 20 '17 at 9:15



















          3














          You need to rescan the disks before you can make the bigger partition.



          In Centos you can do this by



          ls /sys/class/scsi_host


          then for each host



          echo "- - -" > /sys/class/scsi_host/host#/scan


          (replace # with the number)



          There is also one more step to the above which is expanding ext or whatever filesystem you are using once you have resized the partition.



          You are still going to have to unmount that partition though at some point. What we tend to do is add a 2nd vmware disk and use lvm to extend onto the new disk (and reduce off the old if it is a replacement) as this allows the whole process to happen live.






          share|improve this answer


























          • My system is a Debian and I run rescan-scsi-bus.sh from scsitools. I think it is equivalent to the command you propose on /sys/class/scsi_host but "fdisk" still display the old size on my disk...

            – Yves Martin
            Apr 11 '12 at 7:47











          • Does it recognise a new vmware disk when you rescan?

            – JamesRyan
            Apr 11 '12 at 10:16











          • No. This disk exists already, it is not new. The disk size has been increased in vSphere client.

            – Yves Martin
            Apr 11 '12 at 12:23













          • I realise that but you should try adding a new one to see if your scan picks it up to narrow down the problem

            – JamesRyan
            Apr 12 '12 at 9:27











          • I agree with you and I already know by practice that add a new SCSI disk to a Linux machine can be done online for all the steps listed. As the VM may run for 10 years... I fear the total number of disks in a near future...

            – Yves Martin
            Apr 12 '12 at 9:50



















          1














          You've not provided us enough detail to tell you the exact commands you'll need but essentially you'll need to use the lvextend command to extend the logical volume, then the e2fsck command and then the resize2fs command to actually expand your filesystem. Each of these commands will need additional parameters, specifically device and filesystem information, that we can't provide but you'll need to know these, just use the --help option for each command to tell you how to use them specifically, plus you'll probably end up using the pvdisplay, lvdisplay and mount commands to help fill out these parameters.






          share|improve this answer
























          • I know all the commands for other steps. My question is: how to grow the primary partition used as PV without reboot ?

            – Yves Martin
            Apr 10 '12 at 20:36











          • Sorry, do you just mean pvresize?

            – Chopper3
            Apr 10 '12 at 20:39











          • I agree my question was not explicit enough (even with the bold part). pvresize is mentioned as step 2. I am stuck at step 1: increase the "PCAT" partition size.

            – Yves Martin
            Apr 10 '12 at 20:45











          • Have you increased the .vmdk size via the VSClient yet?

            – Chopper3
            Apr 10 '12 at 21:18






          • 2





            To confirm /sbin/rescan-scsi-bus dooes not change existing disk size. But echo "1" > '/sys/class/scsi_disk/0:0:1:0/device/rescan' does

            – Yves Martin
            Jul 21 '14 at 16:13





















          1














          As an updated answer, on Ubuntu 16.04.1 I was able to do the following to resize a volume from 1024GB to 1.4TB:



          echo '1' > /sys/class/scsi_disk/32:0:1:0/device/rescan
          pvresize /dev/sdb
          lvextend -l +100%FREE /dev/nvr01-opt/opt
          resize2fs /dev/nvr01-opt/opt


          No fdisk required, and the space was immediately available.






          share|improve this answer



















          • 3





            Lucky you. The reason is because you have no partition table but direct PV on /dev/sdb, which is probably your application data only secondary disk, but not your first disk with system (to mention I configure my systems the same way !). My question was about extending last PV/partition of such a "system disk" (cloned from a template), as far as Linux distributions do not support installation on direct PV whereas Linux kernel and GRUB should be able to boot and run on system disk without partition table at all.

            – Yves Martin
            Dec 12 '16 at 9:44













          • Fair point. For those that find this via Google: keep that in mind.

            – peelman
            Dec 12 '16 at 10:16



















          0














          No one has posted a complete set of commands, so here we go:



          # the following steps are for adding a new HDD
          apt install scsitools
          rescan-scsi-bus
          pvcreate /dev/sdX
          vgextend /dev/vgname /dev/sdx
          lvextend -l +100%FREE /dev/vgname/root
          resize2fs /dev/vgname/root

          #if resizing existing HDD
          fdisk /dev/sdX
          create new partition
          pvcreate /dev/sdXn
          vgextend /dev/vgname /dev/sdXn
          lvextend -l +100%FREE /dev/vgname/root
          resize2fs /dev/vgname/root





          share|improve this answer
























          • Sorry to distrub but I find adding disk, partition and PV at each disk growth is "ugly" and do not scale. My question was about extending an existing primary partition on disk without adding disk or partition or PV.

            – Yves Martin
            Dec 12 '16 at 9:39



















          0














          This can help you :



          https://www.thegeekdiary.com/centos-rhel-how-to-extend-physical-volume-in-lvm-by-extending-the-disk-partition-used/



          https://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/



          Let me now if you need some help






          share|improve this answer








          New contributor




          THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "2"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f378086%2fhow-to-extend-a-linux-pv-partition-online-after-virtual-disk-growth%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            8 Answers
            8






            active

            oldest

            votes








            8 Answers
            8






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            9














            You can do this without a reboot. pvresize doesn't resize the physical volume until the partition is updated with the added space. You must fdisk the partition and recreate it with the the new full size of the disk, after you can rescan'd the drives for it to see the extra space in the first place.



            More info:
            http://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/






            share|improve this answer


























            • I agree but whatever I did to rescan the SCSI drive, I never got the new disk size visible in fdisk, so I was stuck until a first reboot. And "partprobe" is a new command for me. Definitely I have to test this procedure... Thank you.

              – Yves Martin
              Oct 9 '12 at 19:39











            • For information partprobe is a command from parted project.

              – Yves Martin
              Mar 25 '13 at 15:32











            • If you weren't seeing the new disk size in fdisk then the issue isn't with LVM. I'd have to ask how you were scanning since that usually picks up the new disk size to me. I also don't partition disks I'm going to use LVM on if I can help it. If you pvcreate the whole disk then updating the partition table is just one less thing you have to do when you go to resize it.

              – Bratchley
              Jun 11 '15 at 19:34
















            9














            You can do this without a reboot. pvresize doesn't resize the physical volume until the partition is updated with the added space. You must fdisk the partition and recreate it with the the new full size of the disk, after you can rescan'd the drives for it to see the extra space in the first place.



            More info:
            http://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/






            share|improve this answer


























            • I agree but whatever I did to rescan the SCSI drive, I never got the new disk size visible in fdisk, so I was stuck until a first reboot. And "partprobe" is a new command for me. Definitely I have to test this procedure... Thank you.

              – Yves Martin
              Oct 9 '12 at 19:39











            • For information partprobe is a command from parted project.

              – Yves Martin
              Mar 25 '13 at 15:32











            • If you weren't seeing the new disk size in fdisk then the issue isn't with LVM. I'd have to ask how you were scanning since that usually picks up the new disk size to me. I also don't partition disks I'm going to use LVM on if I can help it. If you pvcreate the whole disk then updating the partition table is just one less thing you have to do when you go to resize it.

              – Bratchley
              Jun 11 '15 at 19:34














            9












            9








            9







            You can do this without a reboot. pvresize doesn't resize the physical volume until the partition is updated with the added space. You must fdisk the partition and recreate it with the the new full size of the disk, after you can rescan'd the drives for it to see the extra space in the first place.



            More info:
            http://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/






            share|improve this answer















            You can do this without a reboot. pvresize doesn't resize the physical volume until the partition is updated with the added space. You must fdisk the partition and recreate it with the the new full size of the disk, after you can rescan'd the drives for it to see the extra space in the first place.



            More info:
            http://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 8 '12 at 21:18









            akraut

            271317




            271317










            answered Oct 8 '12 at 20:04









            GReggGRegg

            11411




            11411













            • I agree but whatever I did to rescan the SCSI drive, I never got the new disk size visible in fdisk, so I was stuck until a first reboot. And "partprobe" is a new command for me. Definitely I have to test this procedure... Thank you.

              – Yves Martin
              Oct 9 '12 at 19:39











            • For information partprobe is a command from parted project.

              – Yves Martin
              Mar 25 '13 at 15:32











            • If you weren't seeing the new disk size in fdisk then the issue isn't with LVM. I'd have to ask how you were scanning since that usually picks up the new disk size to me. I also don't partition disks I'm going to use LVM on if I can help it. If you pvcreate the whole disk then updating the partition table is just one less thing you have to do when you go to resize it.

              – Bratchley
              Jun 11 '15 at 19:34



















            • I agree but whatever I did to rescan the SCSI drive, I never got the new disk size visible in fdisk, so I was stuck until a first reboot. And "partprobe" is a new command for me. Definitely I have to test this procedure... Thank you.

              – Yves Martin
              Oct 9 '12 at 19:39











            • For information partprobe is a command from parted project.

              – Yves Martin
              Mar 25 '13 at 15:32











            • If you weren't seeing the new disk size in fdisk then the issue isn't with LVM. I'd have to ask how you were scanning since that usually picks up the new disk size to me. I also don't partition disks I'm going to use LVM on if I can help it. If you pvcreate the whole disk then updating the partition table is just one less thing you have to do when you go to resize it.

              – Bratchley
              Jun 11 '15 at 19:34

















            I agree but whatever I did to rescan the SCSI drive, I never got the new disk size visible in fdisk, so I was stuck until a first reboot. And "partprobe" is a new command for me. Definitely I have to test this procedure... Thank you.

            – Yves Martin
            Oct 9 '12 at 19:39





            I agree but whatever I did to rescan the SCSI drive, I never got the new disk size visible in fdisk, so I was stuck until a first reboot. And "partprobe" is a new command for me. Definitely I have to test this procedure... Thank you.

            – Yves Martin
            Oct 9 '12 at 19:39













            For information partprobe is a command from parted project.

            – Yves Martin
            Mar 25 '13 at 15:32





            For information partprobe is a command from parted project.

            – Yves Martin
            Mar 25 '13 at 15:32













            If you weren't seeing the new disk size in fdisk then the issue isn't with LVM. I'd have to ask how you were scanning since that usually picks up the new disk size to me. I also don't partition disks I'm going to use LVM on if I can help it. If you pvcreate the whole disk then updating the partition table is just one less thing you have to do when you go to resize it.

            – Bratchley
            Jun 11 '15 at 19:34





            If you weren't seeing the new disk size in fdisk then the issue isn't with LVM. I'd have to ask how you were scanning since that usually picks up the new disk size to me. I also don't partition disks I'm going to use LVM on if I can help it. If you pvcreate the whole disk then updating the partition table is just one less thing you have to do when you go to resize it.

            – Bratchley
            Jun 11 '15 at 19:34













            11














            The other answered provided do not address your question, I've identified the correct command to rescan an already connected disk.



            We must rescan your already connected disk, first identify which disk you want to rescan.



            ls /sys/class/scsi_disk/


            In my example, I see a symlink named 0:0:0:0, so we rescan this scsi-disk.



            echo '1' > /sys/class/scsi_disk/0:0:0:0/device/rescan


            I just extended my VMware disk also, and had to scour other answers to find the correct command. Hopefully this will save future searchers from futile attempts.






            share|improve this answer
























            • Worked perfectly!

              – Emil Styrke
              Oct 30 '17 at 11:49
















            11














            The other answered provided do not address your question, I've identified the correct command to rescan an already connected disk.



            We must rescan your already connected disk, first identify which disk you want to rescan.



            ls /sys/class/scsi_disk/


            In my example, I see a symlink named 0:0:0:0, so we rescan this scsi-disk.



            echo '1' > /sys/class/scsi_disk/0:0:0:0/device/rescan


            I just extended my VMware disk also, and had to scour other answers to find the correct command. Hopefully this will save future searchers from futile attempts.






            share|improve this answer
























            • Worked perfectly!

              – Emil Styrke
              Oct 30 '17 at 11:49














            11












            11








            11







            The other answered provided do not address your question, I've identified the correct command to rescan an already connected disk.



            We must rescan your already connected disk, first identify which disk you want to rescan.



            ls /sys/class/scsi_disk/


            In my example, I see a symlink named 0:0:0:0, so we rescan this scsi-disk.



            echo '1' > /sys/class/scsi_disk/0:0:0:0/device/rescan


            I just extended my VMware disk also, and had to scour other answers to find the correct command. Hopefully this will save future searchers from futile attempts.






            share|improve this answer













            The other answered provided do not address your question, I've identified the correct command to rescan an already connected disk.



            We must rescan your already connected disk, first identify which disk you want to rescan.



            ls /sys/class/scsi_disk/


            In my example, I see a symlink named 0:0:0:0, so we rescan this scsi-disk.



            echo '1' > /sys/class/scsi_disk/0:0:0:0/device/rescan


            I just extended my VMware disk also, and had to scour other answers to find the correct command. Hopefully this will save future searchers from futile attempts.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 3 '14 at 16:33









            J. M. BeckerJ. M. Becker

            2,02111220




            2,02111220













            • Worked perfectly!

              – Emil Styrke
              Oct 30 '17 at 11:49



















            • Worked perfectly!

              – Emil Styrke
              Oct 30 '17 at 11:49

















            Worked perfectly!

            – Emil Styrke
            Oct 30 '17 at 11:49





            Worked perfectly!

            – Emil Styrke
            Oct 30 '17 at 11:49











            4














            As far as the root file system / is mounted on the disk that has been resized, the partition table and disk size are not refreshed by a SCSI rescan with Linux 2.6.26.



            I really hope it will be better soon with newer kernel versions.



            So I had to:




            • reboot a first time to see the new disk size in fdisk

            • delete the old primary PV partion in fdisk

            • create a partition entry with the same number and start sector until the end of disk

            • reboot a second time OR run partprobe from parted package only if / is not mounted there

            • Now I can run pvresize to get new free space, lvextend and resize2fs to allocate some more space to a file system


            I have been recommended to simply discard that stupid old partition table and run pvcreate directly on the device as Grub2 is able to load a kernel image directly from a file system on a LVM partition. But such a setup is not obvious at all with distribution installers.



            Update: I have just checked with Debian GNU/Linux Jessie 8.2 running kernel 3.16 and parted 3.2, the partprobe now succeeds after partition table edition with cfdisk with no reboot. pvresize works immediately after.



            If you want to extend a PV stored as logical PC partition, for instance /dev/sda5 on extended primary partition /dev/sda2, do not use fdisk but prefer parted:



            parted /dev/sda2 -1
            parted /dev/sda5 -1
            pvresize /dev/sda5





            share|improve this answer


























            • Commands at end doesn't work # parted /dev/sda2 -1 -> parted: invalid option -- '1'

              – Oskar Berggren
              Jun 20 '17 at 9:15
















            4














            As far as the root file system / is mounted on the disk that has been resized, the partition table and disk size are not refreshed by a SCSI rescan with Linux 2.6.26.



            I really hope it will be better soon with newer kernel versions.



            So I had to:




            • reboot a first time to see the new disk size in fdisk

            • delete the old primary PV partion in fdisk

            • create a partition entry with the same number and start sector until the end of disk

            • reboot a second time OR run partprobe from parted package only if / is not mounted there

            • Now I can run pvresize to get new free space, lvextend and resize2fs to allocate some more space to a file system


            I have been recommended to simply discard that stupid old partition table and run pvcreate directly on the device as Grub2 is able to load a kernel image directly from a file system on a LVM partition. But such a setup is not obvious at all with distribution installers.



            Update: I have just checked with Debian GNU/Linux Jessie 8.2 running kernel 3.16 and parted 3.2, the partprobe now succeeds after partition table edition with cfdisk with no reboot. pvresize works immediately after.



            If you want to extend a PV stored as logical PC partition, for instance /dev/sda5 on extended primary partition /dev/sda2, do not use fdisk but prefer parted:



            parted /dev/sda2 -1
            parted /dev/sda5 -1
            pvresize /dev/sda5





            share|improve this answer


























            • Commands at end doesn't work # parted /dev/sda2 -1 -> parted: invalid option -- '1'

              – Oskar Berggren
              Jun 20 '17 at 9:15














            4












            4








            4







            As far as the root file system / is mounted on the disk that has been resized, the partition table and disk size are not refreshed by a SCSI rescan with Linux 2.6.26.



            I really hope it will be better soon with newer kernel versions.



            So I had to:




            • reboot a first time to see the new disk size in fdisk

            • delete the old primary PV partion in fdisk

            • create a partition entry with the same number and start sector until the end of disk

            • reboot a second time OR run partprobe from parted package only if / is not mounted there

            • Now I can run pvresize to get new free space, lvextend and resize2fs to allocate some more space to a file system


            I have been recommended to simply discard that stupid old partition table and run pvcreate directly on the device as Grub2 is able to load a kernel image directly from a file system on a LVM partition. But such a setup is not obvious at all with distribution installers.



            Update: I have just checked with Debian GNU/Linux Jessie 8.2 running kernel 3.16 and parted 3.2, the partprobe now succeeds after partition table edition with cfdisk with no reboot. pvresize works immediately after.



            If you want to extend a PV stored as logical PC partition, for instance /dev/sda5 on extended primary partition /dev/sda2, do not use fdisk but prefer parted:



            parted /dev/sda2 -1
            parted /dev/sda5 -1
            pvresize /dev/sda5





            share|improve this answer















            As far as the root file system / is mounted on the disk that has been resized, the partition table and disk size are not refreshed by a SCSI rescan with Linux 2.6.26.



            I really hope it will be better soon with newer kernel versions.



            So I had to:




            • reboot a first time to see the new disk size in fdisk

            • delete the old primary PV partion in fdisk

            • create a partition entry with the same number and start sector until the end of disk

            • reboot a second time OR run partprobe from parted package only if / is not mounted there

            • Now I can run pvresize to get new free space, lvextend and resize2fs to allocate some more space to a file system


            I have been recommended to simply discard that stupid old partition table and run pvcreate directly on the device as Grub2 is able to load a kernel image directly from a file system on a LVM partition. But such a setup is not obvious at all with distribution installers.



            Update: I have just checked with Debian GNU/Linux Jessie 8.2 running kernel 3.16 and parted 3.2, the partprobe now succeeds after partition table edition with cfdisk with no reboot. pvresize works immediately after.



            If you want to extend a PV stored as logical PC partition, for instance /dev/sda5 on extended primary partition /dev/sda2, do not use fdisk but prefer parted:



            parted /dev/sda2 -1
            parted /dev/sda5 -1
            pvresize /dev/sda5






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 16 '17 at 20:20

























            answered May 10 '12 at 14:21









            Yves MartinYves Martin

            5442520




            5442520













            • Commands at end doesn't work # parted /dev/sda2 -1 -> parted: invalid option -- '1'

              – Oskar Berggren
              Jun 20 '17 at 9:15



















            • Commands at end doesn't work # parted /dev/sda2 -1 -> parted: invalid option -- '1'

              – Oskar Berggren
              Jun 20 '17 at 9:15

















            Commands at end doesn't work # parted /dev/sda2 -1 -> parted: invalid option -- '1'

            – Oskar Berggren
            Jun 20 '17 at 9:15





            Commands at end doesn't work # parted /dev/sda2 -1 -> parted: invalid option -- '1'

            – Oskar Berggren
            Jun 20 '17 at 9:15











            3














            You need to rescan the disks before you can make the bigger partition.



            In Centos you can do this by



            ls /sys/class/scsi_host


            then for each host



            echo "- - -" > /sys/class/scsi_host/host#/scan


            (replace # with the number)



            There is also one more step to the above which is expanding ext or whatever filesystem you are using once you have resized the partition.



            You are still going to have to unmount that partition though at some point. What we tend to do is add a 2nd vmware disk and use lvm to extend onto the new disk (and reduce off the old if it is a replacement) as this allows the whole process to happen live.






            share|improve this answer


























            • My system is a Debian and I run rescan-scsi-bus.sh from scsitools. I think it is equivalent to the command you propose on /sys/class/scsi_host but "fdisk" still display the old size on my disk...

              – Yves Martin
              Apr 11 '12 at 7:47











            • Does it recognise a new vmware disk when you rescan?

              – JamesRyan
              Apr 11 '12 at 10:16











            • No. This disk exists already, it is not new. The disk size has been increased in vSphere client.

              – Yves Martin
              Apr 11 '12 at 12:23













            • I realise that but you should try adding a new one to see if your scan picks it up to narrow down the problem

              – JamesRyan
              Apr 12 '12 at 9:27











            • I agree with you and I already know by practice that add a new SCSI disk to a Linux machine can be done online for all the steps listed. As the VM may run for 10 years... I fear the total number of disks in a near future...

              – Yves Martin
              Apr 12 '12 at 9:50
















            3














            You need to rescan the disks before you can make the bigger partition.



            In Centos you can do this by



            ls /sys/class/scsi_host


            then for each host



            echo "- - -" > /sys/class/scsi_host/host#/scan


            (replace # with the number)



            There is also one more step to the above which is expanding ext or whatever filesystem you are using once you have resized the partition.



            You are still going to have to unmount that partition though at some point. What we tend to do is add a 2nd vmware disk and use lvm to extend onto the new disk (and reduce off the old if it is a replacement) as this allows the whole process to happen live.






            share|improve this answer


























            • My system is a Debian and I run rescan-scsi-bus.sh from scsitools. I think it is equivalent to the command you propose on /sys/class/scsi_host but "fdisk" still display the old size on my disk...

              – Yves Martin
              Apr 11 '12 at 7:47











            • Does it recognise a new vmware disk when you rescan?

              – JamesRyan
              Apr 11 '12 at 10:16











            • No. This disk exists already, it is not new. The disk size has been increased in vSphere client.

              – Yves Martin
              Apr 11 '12 at 12:23













            • I realise that but you should try adding a new one to see if your scan picks it up to narrow down the problem

              – JamesRyan
              Apr 12 '12 at 9:27











            • I agree with you and I already know by practice that add a new SCSI disk to a Linux machine can be done online for all the steps listed. As the VM may run for 10 years... I fear the total number of disks in a near future...

              – Yves Martin
              Apr 12 '12 at 9:50














            3












            3








            3







            You need to rescan the disks before you can make the bigger partition.



            In Centos you can do this by



            ls /sys/class/scsi_host


            then for each host



            echo "- - -" > /sys/class/scsi_host/host#/scan


            (replace # with the number)



            There is also one more step to the above which is expanding ext or whatever filesystem you are using once you have resized the partition.



            You are still going to have to unmount that partition though at some point. What we tend to do is add a 2nd vmware disk and use lvm to extend onto the new disk (and reduce off the old if it is a replacement) as this allows the whole process to happen live.






            share|improve this answer















            You need to rescan the disks before you can make the bigger partition.



            In Centos you can do this by



            ls /sys/class/scsi_host


            then for each host



            echo "- - -" > /sys/class/scsi_host/host#/scan


            (replace # with the number)



            There is also one more step to the above which is expanding ext or whatever filesystem you are using once you have resized the partition.



            You are still going to have to unmount that partition though at some point. What we tend to do is add a 2nd vmware disk and use lvm to extend onto the new disk (and reduce off the old if it is a replacement) as this allows the whole process to happen live.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 10 '12 at 12:28

























            answered Apr 10 '12 at 12:00









            JamesRyanJamesRyan

            7,78322036




            7,78322036













            • My system is a Debian and I run rescan-scsi-bus.sh from scsitools. I think it is equivalent to the command you propose on /sys/class/scsi_host but "fdisk" still display the old size on my disk...

              – Yves Martin
              Apr 11 '12 at 7:47











            • Does it recognise a new vmware disk when you rescan?

              – JamesRyan
              Apr 11 '12 at 10:16











            • No. This disk exists already, it is not new. The disk size has been increased in vSphere client.

              – Yves Martin
              Apr 11 '12 at 12:23













            • I realise that but you should try adding a new one to see if your scan picks it up to narrow down the problem

              – JamesRyan
              Apr 12 '12 at 9:27











            • I agree with you and I already know by practice that add a new SCSI disk to a Linux machine can be done online for all the steps listed. As the VM may run for 10 years... I fear the total number of disks in a near future...

              – Yves Martin
              Apr 12 '12 at 9:50



















            • My system is a Debian and I run rescan-scsi-bus.sh from scsitools. I think it is equivalent to the command you propose on /sys/class/scsi_host but "fdisk" still display the old size on my disk...

              – Yves Martin
              Apr 11 '12 at 7:47











            • Does it recognise a new vmware disk when you rescan?

              – JamesRyan
              Apr 11 '12 at 10:16











            • No. This disk exists already, it is not new. The disk size has been increased in vSphere client.

              – Yves Martin
              Apr 11 '12 at 12:23













            • I realise that but you should try adding a new one to see if your scan picks it up to narrow down the problem

              – JamesRyan
              Apr 12 '12 at 9:27











            • I agree with you and I already know by practice that add a new SCSI disk to a Linux machine can be done online for all the steps listed. As the VM may run for 10 years... I fear the total number of disks in a near future...

              – Yves Martin
              Apr 12 '12 at 9:50

















            My system is a Debian and I run rescan-scsi-bus.sh from scsitools. I think it is equivalent to the command you propose on /sys/class/scsi_host but "fdisk" still display the old size on my disk...

            – Yves Martin
            Apr 11 '12 at 7:47





            My system is a Debian and I run rescan-scsi-bus.sh from scsitools. I think it is equivalent to the command you propose on /sys/class/scsi_host but "fdisk" still display the old size on my disk...

            – Yves Martin
            Apr 11 '12 at 7:47













            Does it recognise a new vmware disk when you rescan?

            – JamesRyan
            Apr 11 '12 at 10:16





            Does it recognise a new vmware disk when you rescan?

            – JamesRyan
            Apr 11 '12 at 10:16













            No. This disk exists already, it is not new. The disk size has been increased in vSphere client.

            – Yves Martin
            Apr 11 '12 at 12:23







            No. This disk exists already, it is not new. The disk size has been increased in vSphere client.

            – Yves Martin
            Apr 11 '12 at 12:23















            I realise that but you should try adding a new one to see if your scan picks it up to narrow down the problem

            – JamesRyan
            Apr 12 '12 at 9:27





            I realise that but you should try adding a new one to see if your scan picks it up to narrow down the problem

            – JamesRyan
            Apr 12 '12 at 9:27













            I agree with you and I already know by practice that add a new SCSI disk to a Linux machine can be done online for all the steps listed. As the VM may run for 10 years... I fear the total number of disks in a near future...

            – Yves Martin
            Apr 12 '12 at 9:50





            I agree with you and I already know by practice that add a new SCSI disk to a Linux machine can be done online for all the steps listed. As the VM may run for 10 years... I fear the total number of disks in a near future...

            – Yves Martin
            Apr 12 '12 at 9:50











            1














            You've not provided us enough detail to tell you the exact commands you'll need but essentially you'll need to use the lvextend command to extend the logical volume, then the e2fsck command and then the resize2fs command to actually expand your filesystem. Each of these commands will need additional parameters, specifically device and filesystem information, that we can't provide but you'll need to know these, just use the --help option for each command to tell you how to use them specifically, plus you'll probably end up using the pvdisplay, lvdisplay and mount commands to help fill out these parameters.






            share|improve this answer
























            • I know all the commands for other steps. My question is: how to grow the primary partition used as PV without reboot ?

              – Yves Martin
              Apr 10 '12 at 20:36











            • Sorry, do you just mean pvresize?

              – Chopper3
              Apr 10 '12 at 20:39











            • I agree my question was not explicit enough (even with the bold part). pvresize is mentioned as step 2. I am stuck at step 1: increase the "PCAT" partition size.

              – Yves Martin
              Apr 10 '12 at 20:45











            • Have you increased the .vmdk size via the VSClient yet?

              – Chopper3
              Apr 10 '12 at 21:18






            • 2





              To confirm /sbin/rescan-scsi-bus dooes not change existing disk size. But echo "1" > '/sys/class/scsi_disk/0:0:1:0/device/rescan' does

              – Yves Martin
              Jul 21 '14 at 16:13


















            1














            You've not provided us enough detail to tell you the exact commands you'll need but essentially you'll need to use the lvextend command to extend the logical volume, then the e2fsck command and then the resize2fs command to actually expand your filesystem. Each of these commands will need additional parameters, specifically device and filesystem information, that we can't provide but you'll need to know these, just use the --help option for each command to tell you how to use them specifically, plus you'll probably end up using the pvdisplay, lvdisplay and mount commands to help fill out these parameters.






            share|improve this answer
























            • I know all the commands for other steps. My question is: how to grow the primary partition used as PV without reboot ?

              – Yves Martin
              Apr 10 '12 at 20:36











            • Sorry, do you just mean pvresize?

              – Chopper3
              Apr 10 '12 at 20:39











            • I agree my question was not explicit enough (even with the bold part). pvresize is mentioned as step 2. I am stuck at step 1: increase the "PCAT" partition size.

              – Yves Martin
              Apr 10 '12 at 20:45











            • Have you increased the .vmdk size via the VSClient yet?

              – Chopper3
              Apr 10 '12 at 21:18






            • 2





              To confirm /sbin/rescan-scsi-bus dooes not change existing disk size. But echo "1" > '/sys/class/scsi_disk/0:0:1:0/device/rescan' does

              – Yves Martin
              Jul 21 '14 at 16:13
















            1












            1








            1







            You've not provided us enough detail to tell you the exact commands you'll need but essentially you'll need to use the lvextend command to extend the logical volume, then the e2fsck command and then the resize2fs command to actually expand your filesystem. Each of these commands will need additional parameters, specifically device and filesystem information, that we can't provide but you'll need to know these, just use the --help option for each command to tell you how to use them specifically, plus you'll probably end up using the pvdisplay, lvdisplay and mount commands to help fill out these parameters.






            share|improve this answer













            You've not provided us enough detail to tell you the exact commands you'll need but essentially you'll need to use the lvextend command to extend the logical volume, then the e2fsck command and then the resize2fs command to actually expand your filesystem. Each of these commands will need additional parameters, specifically device and filesystem information, that we can't provide but you'll need to know these, just use the --help option for each command to tell you how to use them specifically, plus you'll probably end up using the pvdisplay, lvdisplay and mount commands to help fill out these parameters.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 10 '12 at 12:00









            Chopper3Chopper3

            94.7k999227




            94.7k999227













            • I know all the commands for other steps. My question is: how to grow the primary partition used as PV without reboot ?

              – Yves Martin
              Apr 10 '12 at 20:36











            • Sorry, do you just mean pvresize?

              – Chopper3
              Apr 10 '12 at 20:39











            • I agree my question was not explicit enough (even with the bold part). pvresize is mentioned as step 2. I am stuck at step 1: increase the "PCAT" partition size.

              – Yves Martin
              Apr 10 '12 at 20:45











            • Have you increased the .vmdk size via the VSClient yet?

              – Chopper3
              Apr 10 '12 at 21:18






            • 2





              To confirm /sbin/rescan-scsi-bus dooes not change existing disk size. But echo "1" > '/sys/class/scsi_disk/0:0:1:0/device/rescan' does

              – Yves Martin
              Jul 21 '14 at 16:13





















            • I know all the commands for other steps. My question is: how to grow the primary partition used as PV without reboot ?

              – Yves Martin
              Apr 10 '12 at 20:36











            • Sorry, do you just mean pvresize?

              – Chopper3
              Apr 10 '12 at 20:39











            • I agree my question was not explicit enough (even with the bold part). pvresize is mentioned as step 2. I am stuck at step 1: increase the "PCAT" partition size.

              – Yves Martin
              Apr 10 '12 at 20:45











            • Have you increased the .vmdk size via the VSClient yet?

              – Chopper3
              Apr 10 '12 at 21:18






            • 2





              To confirm /sbin/rescan-scsi-bus dooes not change existing disk size. But echo "1" > '/sys/class/scsi_disk/0:0:1:0/device/rescan' does

              – Yves Martin
              Jul 21 '14 at 16:13



















            I know all the commands for other steps. My question is: how to grow the primary partition used as PV without reboot ?

            – Yves Martin
            Apr 10 '12 at 20:36





            I know all the commands for other steps. My question is: how to grow the primary partition used as PV without reboot ?

            – Yves Martin
            Apr 10 '12 at 20:36













            Sorry, do you just mean pvresize?

            – Chopper3
            Apr 10 '12 at 20:39





            Sorry, do you just mean pvresize?

            – Chopper3
            Apr 10 '12 at 20:39













            I agree my question was not explicit enough (even with the bold part). pvresize is mentioned as step 2. I am stuck at step 1: increase the "PCAT" partition size.

            – Yves Martin
            Apr 10 '12 at 20:45





            I agree my question was not explicit enough (even with the bold part). pvresize is mentioned as step 2. I am stuck at step 1: increase the "PCAT" partition size.

            – Yves Martin
            Apr 10 '12 at 20:45













            Have you increased the .vmdk size via the VSClient yet?

            – Chopper3
            Apr 10 '12 at 21:18





            Have you increased the .vmdk size via the VSClient yet?

            – Chopper3
            Apr 10 '12 at 21:18




            2




            2





            To confirm /sbin/rescan-scsi-bus dooes not change existing disk size. But echo "1" > '/sys/class/scsi_disk/0:0:1:0/device/rescan' does

            – Yves Martin
            Jul 21 '14 at 16:13







            To confirm /sbin/rescan-scsi-bus dooes not change existing disk size. But echo "1" > '/sys/class/scsi_disk/0:0:1:0/device/rescan' does

            – Yves Martin
            Jul 21 '14 at 16:13













            1














            As an updated answer, on Ubuntu 16.04.1 I was able to do the following to resize a volume from 1024GB to 1.4TB:



            echo '1' > /sys/class/scsi_disk/32:0:1:0/device/rescan
            pvresize /dev/sdb
            lvextend -l +100%FREE /dev/nvr01-opt/opt
            resize2fs /dev/nvr01-opt/opt


            No fdisk required, and the space was immediately available.






            share|improve this answer



















            • 3





              Lucky you. The reason is because you have no partition table but direct PV on /dev/sdb, which is probably your application data only secondary disk, but not your first disk with system (to mention I configure my systems the same way !). My question was about extending last PV/partition of such a "system disk" (cloned from a template), as far as Linux distributions do not support installation on direct PV whereas Linux kernel and GRUB should be able to boot and run on system disk without partition table at all.

              – Yves Martin
              Dec 12 '16 at 9:44













            • Fair point. For those that find this via Google: keep that in mind.

              – peelman
              Dec 12 '16 at 10:16
















            1














            As an updated answer, on Ubuntu 16.04.1 I was able to do the following to resize a volume from 1024GB to 1.4TB:



            echo '1' > /sys/class/scsi_disk/32:0:1:0/device/rescan
            pvresize /dev/sdb
            lvextend -l +100%FREE /dev/nvr01-opt/opt
            resize2fs /dev/nvr01-opt/opt


            No fdisk required, and the space was immediately available.






            share|improve this answer



















            • 3





              Lucky you. The reason is because you have no partition table but direct PV on /dev/sdb, which is probably your application data only secondary disk, but not your first disk with system (to mention I configure my systems the same way !). My question was about extending last PV/partition of such a "system disk" (cloned from a template), as far as Linux distributions do not support installation on direct PV whereas Linux kernel and GRUB should be able to boot and run on system disk without partition table at all.

              – Yves Martin
              Dec 12 '16 at 9:44













            • Fair point. For those that find this via Google: keep that in mind.

              – peelman
              Dec 12 '16 at 10:16














            1












            1








            1







            As an updated answer, on Ubuntu 16.04.1 I was able to do the following to resize a volume from 1024GB to 1.4TB:



            echo '1' > /sys/class/scsi_disk/32:0:1:0/device/rescan
            pvresize /dev/sdb
            lvextend -l +100%FREE /dev/nvr01-opt/opt
            resize2fs /dev/nvr01-opt/opt


            No fdisk required, and the space was immediately available.






            share|improve this answer













            As an updated answer, on Ubuntu 16.04.1 I was able to do the following to resize a volume from 1024GB to 1.4TB:



            echo '1' > /sys/class/scsi_disk/32:0:1:0/device/rescan
            pvresize /dev/sdb
            lvextend -l +100%FREE /dev/nvr01-opt/opt
            resize2fs /dev/nvr01-opt/opt


            No fdisk required, and the space was immediately available.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 8 '16 at 13:24









            peelmanpeelman

            7361411




            7361411








            • 3





              Lucky you. The reason is because you have no partition table but direct PV on /dev/sdb, which is probably your application data only secondary disk, but not your first disk with system (to mention I configure my systems the same way !). My question was about extending last PV/partition of such a "system disk" (cloned from a template), as far as Linux distributions do not support installation on direct PV whereas Linux kernel and GRUB should be able to boot and run on system disk without partition table at all.

              – Yves Martin
              Dec 12 '16 at 9:44













            • Fair point. For those that find this via Google: keep that in mind.

              – peelman
              Dec 12 '16 at 10:16














            • 3





              Lucky you. The reason is because you have no partition table but direct PV on /dev/sdb, which is probably your application data only secondary disk, but not your first disk with system (to mention I configure my systems the same way !). My question was about extending last PV/partition of such a "system disk" (cloned from a template), as far as Linux distributions do not support installation on direct PV whereas Linux kernel and GRUB should be able to boot and run on system disk without partition table at all.

              – Yves Martin
              Dec 12 '16 at 9:44













            • Fair point. For those that find this via Google: keep that in mind.

              – peelman
              Dec 12 '16 at 10:16








            3




            3





            Lucky you. The reason is because you have no partition table but direct PV on /dev/sdb, which is probably your application data only secondary disk, but not your first disk with system (to mention I configure my systems the same way !). My question was about extending last PV/partition of such a "system disk" (cloned from a template), as far as Linux distributions do not support installation on direct PV whereas Linux kernel and GRUB should be able to boot and run on system disk without partition table at all.

            – Yves Martin
            Dec 12 '16 at 9:44







            Lucky you. The reason is because you have no partition table but direct PV on /dev/sdb, which is probably your application data only secondary disk, but not your first disk with system (to mention I configure my systems the same way !). My question was about extending last PV/partition of such a "system disk" (cloned from a template), as far as Linux distributions do not support installation on direct PV whereas Linux kernel and GRUB should be able to boot and run on system disk without partition table at all.

            – Yves Martin
            Dec 12 '16 at 9:44















            Fair point. For those that find this via Google: keep that in mind.

            – peelman
            Dec 12 '16 at 10:16





            Fair point. For those that find this via Google: keep that in mind.

            – peelman
            Dec 12 '16 at 10:16











            0














            No one has posted a complete set of commands, so here we go:



            # the following steps are for adding a new HDD
            apt install scsitools
            rescan-scsi-bus
            pvcreate /dev/sdX
            vgextend /dev/vgname /dev/sdx
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root

            #if resizing existing HDD
            fdisk /dev/sdX
            create new partition
            pvcreate /dev/sdXn
            vgextend /dev/vgname /dev/sdXn
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root





            share|improve this answer
























            • Sorry to distrub but I find adding disk, partition and PV at each disk growth is "ugly" and do not scale. My question was about extending an existing primary partition on disk without adding disk or partition or PV.

              – Yves Martin
              Dec 12 '16 at 9:39
















            0














            No one has posted a complete set of commands, so here we go:



            # the following steps are for adding a new HDD
            apt install scsitools
            rescan-scsi-bus
            pvcreate /dev/sdX
            vgextend /dev/vgname /dev/sdx
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root

            #if resizing existing HDD
            fdisk /dev/sdX
            create new partition
            pvcreate /dev/sdXn
            vgextend /dev/vgname /dev/sdXn
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root





            share|improve this answer
























            • Sorry to distrub but I find adding disk, partition and PV at each disk growth is "ugly" and do not scale. My question was about extending an existing primary partition on disk without adding disk or partition or PV.

              – Yves Martin
              Dec 12 '16 at 9:39














            0












            0








            0







            No one has posted a complete set of commands, so here we go:



            # the following steps are for adding a new HDD
            apt install scsitools
            rescan-scsi-bus
            pvcreate /dev/sdX
            vgextend /dev/vgname /dev/sdx
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root

            #if resizing existing HDD
            fdisk /dev/sdX
            create new partition
            pvcreate /dev/sdXn
            vgextend /dev/vgname /dev/sdXn
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root





            share|improve this answer













            No one has posted a complete set of commands, so here we go:



            # the following steps are for adding a new HDD
            apt install scsitools
            rescan-scsi-bus
            pvcreate /dev/sdX
            vgextend /dev/vgname /dev/sdx
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root

            #if resizing existing HDD
            fdisk /dev/sdX
            create new partition
            pvcreate /dev/sdXn
            vgextend /dev/vgname /dev/sdXn
            lvextend -l +100%FREE /dev/vgname/root
            resize2fs /dev/vgname/root






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 8 '16 at 14:29









            mzhaasemzhaase

            3,46711529




            3,46711529













            • Sorry to distrub but I find adding disk, partition and PV at each disk growth is "ugly" and do not scale. My question was about extending an existing primary partition on disk without adding disk or partition or PV.

              – Yves Martin
              Dec 12 '16 at 9:39



















            • Sorry to distrub but I find adding disk, partition and PV at each disk growth is "ugly" and do not scale. My question was about extending an existing primary partition on disk without adding disk or partition or PV.

              – Yves Martin
              Dec 12 '16 at 9:39

















            Sorry to distrub but I find adding disk, partition and PV at each disk growth is "ugly" and do not scale. My question was about extending an existing primary partition on disk without adding disk or partition or PV.

            – Yves Martin
            Dec 12 '16 at 9:39





            Sorry to distrub but I find adding disk, partition and PV at each disk growth is "ugly" and do not scale. My question was about extending an existing primary partition on disk without adding disk or partition or PV.

            – Yves Martin
            Dec 12 '16 at 9:39











            0














            This can help you :



            https://www.thegeekdiary.com/centos-rhel-how-to-extend-physical-volume-in-lvm-by-extending-the-disk-partition-used/



            https://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/



            Let me now if you need some help






            share|improve this answer








            New contributor




            THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              0














              This can help you :



              https://www.thegeekdiary.com/centos-rhel-how-to-extend-physical-volume-in-lvm-by-extending-the-disk-partition-used/



              https://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/



              Let me now if you need some help






              share|improve this answer








              New contributor




              THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0












                0








                0







                This can help you :



                https://www.thegeekdiary.com/centos-rhel-how-to-extend-physical-volume-in-lvm-by-extending-the-disk-partition-used/



                https://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/



                Let me now if you need some help






                share|improve this answer








                New contributor




                THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                This can help you :



                https://www.thegeekdiary.com/centos-rhel-how-to-extend-physical-volume-in-lvm-by-extending-the-disk-partition-used/



                https://theducks.org/2009/11/expanding-lvm-partitions-in-vmware-on-the-fly/



                Let me now if you need some help







                share|improve this answer








                New contributor




                THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 12 mins ago









                THEONETHEONE

                1




                1




                New contributor




                THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                THEONE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f378086%2fhow-to-extend-a-linux-pv-partition-online-after-virtual-disk-growth%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

                    Список ссавців Італії Природоохоронні статуси | Список |...

                    Українські прізвища Зміст Історичні відомості |...