Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, i just updated the disk size from 20 to 40gb, and i'm looking how to expand the partition withous shutdown the system, i just need to have only one partition of total available space.
~# parted /dev/sda print
Model: VMware Virtual disk (scsi)
Disk /dev/sda: 42.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 500MB 499MB primary ext2 boot
2 500MB 10.7GB 10.2GB primary lvm
3 10.7GB 21.5GB 10.7GB primary lvm
#fdisk -l
Disk /dev/sda: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1606d709
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 976895 974848 476M 83 Linux
/dev/sda2 976896 20969471 19992576 9.5G 8e Linux LVM
/dev/sda3 20969472 41943039 20973568 10G 8e Linux LVM
It would be nice to see the output from the command pvdisplay and vgdisplay. I assume that you originally ran out of space in your root VG and added sda3.
To remove sda3 you need to move enough files from /(root) to go back to just using sda2 root VG which is around 7 GB. If you can not or do not want to move the files then I would suggest keeping sda2 and enlarging it to the added disk size. You can use parted and pvresize command to increase sda2.
Once the PV is resized you can resize the LV and then the filesystem itself(depends on the actual type).
All of the commands can be executed on a running system but as always make sure you have a good backup.
You can't arbitrarily increase partitions - the space to increase it must be contiguous. And there is absolutely no point in even considering it in an LVM system. That's what LVM was designed to avoid.
Create a partition on the free space, do a pvcreate, add it to the vg, increase the lv, and it's all done. As you seem to be in the habit of doing this, better create an extended partition and use a logical partition for the pv - else next time there won't be a next time.
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 7.0 (and kvm/qemu)
Posts: 91
Rep:
Quote:
You can't arbitrarily increase partitions - the space to increase it must be contiguous. And there is absolutely no point in even considering it in an LVM system. That's what LVM was designed to avoid.
Sorry, you've got it backwards. LVM lets two (physically) non-contiguous APPEAR (logically) contiguous.
Quick Google should tell you what you need to know, for instance: https://www.rootusers.com/lvm-resize...lvm-partition/
Remember there are two sides of the process (actually three):
(one) the KVM has to change the size to the VM
(two) the VM has to be made aware that their disk has changed size.
[The third side if is you have to physically change the size, like adding a disk to the LVM]
It's pretty straight forward when Linux is involved.
It's a bit painful if windows is involved and you need PowerShell.
With Apple's OS/X version of virtualization, it's almost one slider bar and everyone is all set.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.