I have a digital server under VMware, where I got 10 even more GB harddisk from the sysadm.
Inside Linux (operating Ubuntu 11.04 machine), things are arranged up with LVM. In cfdisk, I do find these additional 10 gigs - they are usually present straight after the primary LVM partition.
I recognize that I could create a fresh LVM partition out of this extra room, and then add this to the volume group, and after that to the reasonable volume, and after that resize the filesystem.
Nevertheless, is definitely it probable to assimilate these extra gigs into the present LVM partition? Therefore that the LVM'beds see of the physical volume increased rather of including another physical volume into the volume group (preferably automatically percolating up to the volume group)?
![Debian Debian](/uploads/1/2/4/8/124847554/179548937.png)
One games Xbox 360 games PC invalid argument for database syspro games Windows games Windows phone games Entertainment All. Invalid Argument For Database Business Objects.
stolsvik
stolsvikstolsvik
4 Answers
I simply constructed a test virtual machine with a 15GW disc and LVM on /dev/sda2. After that I grew the storage to 20GC and made LVM see the additional 5GB without incorporating another physical volume.
Here are the tips I implemented:
- apt-get install gnu-fdisk (or yum install gnu-fdisk)
I had to make use ofgfdiskto make the entire thing function. No good fortune with the 'regular' fdisk.
- gfdisk /dev/sda
Switch to 'industries' as the device (this will be critical!!!) and print out the partition table:
Write down the 'begin' sector of the 'Linux LVM' partition (/dev/vda2). Delete the partition and reconstruct it making use of the exact same 'start' sector (501758) and the same partition type (8e):
Caution: please notice that I didn't accept the default begin sector for the partition, I joined itpersonallyso that it fits the original value! I did accept the default value for the 'last sector' though, because I wish this partition to become as large as the storage.
Verify that you did everything properly with 'p' and compose the fresh partition desk to disc:
Reboot the digital machine.Right now log-in the virtual machine and operate:
Done! Right now operate vgdisplay and you will notice the additional 5GW accessible as free of charge extents.
CAVEATS:
- If LVM is usually not really the final (or just) partition on the virtual machine drive, you might have got an hard time extending the size of the partition. It might also be impossible.
- If LVM is definitely on a logical partition (which is where Debian places it by default at install time) or in various other phrases if LVM is definitely on /dev/sda5 rather of /dev/sda2, you must compose down the beginning industry of both the extended partition (allow's call it /dev/sda2) and the logical partition (allow's call it /dev/sda5), then remove both dividers, then recreate them with the same starting field. The last sector of both /dev/sda2 and /dev/sda5 should be the final industry of the cd disk.
- Since this is usually a dangerous treatment I recommend carrying out a backup of the digital device before trying it.
Luca GibelliLuca Gibelli
Right here are usually the directions I often use when I'm doing the exact same matter.
Do “fdisk -t /dev/sda” I'michael presuming /dev/sda2 is definitely your LVM partition and you put on't have got a /dev/sda3. Modify the directions to suit your config.
1) Create certain you have extended the VM disc.
2) do “fdisk /dev/sda”
- g (to discover existing partitioning)
- n (new partition)
- g (major partition) - give it the next available partition number, most likely 3
- accept the defaults. It will use the relaxation of the disc
- watts (write adjustments)
3) REBOOT
4) run ‘pvcreate /dev/sda3'
5) run ‘vgdisplay' to obtain the name of the volume group. In this illustration, it's “VolGroup”, as in:
6) run vgextend VolGroup /dev/sda3
7) operate “df” to notice the name of the basic volume team.
8) run lvextend /dev/mapper/VolGroup-lvroot -ur -m+100%FREE ( the (-l) choice causes it to format it, too)
9 work “df -h” to observe your fresh disk space
gpayne007gpayne007
This will be one of the reasons I choose to have one large physical volume on the VMs that will be individual from the /shoe and additional initial components. This enables you to produce a whole disc as an LVM physical cd disk (
pvcreate /dev/sdb
). After that if you require to do a resize, none of them of the document system adjustments need to occur because it is certainly directly on cd disk.In that scenario, you basically operate
pvresize /dev/sdb
and shift on with your vgextend, lvextend and resize2fs. Significantly simpler to sustain.JosiahJosiah
Personally I followed the instructions in this blog.
To sum up the ways:
- Enhance the virtual disk size making use of the vm-ware equipment
vmware-vdiskmanager
- Shoe on another system (GParted live life CD or attach an Iso CD-ROM to shoe on)
- Make use of the Gparted equipment (simple and visual interface) to boost the lately expended push
- remove the CD-ROM (or the ISO) and shoe on the unique partition.
For growing my Linux VM (RedHat Un 6) I do shoe on the GParted ISO image (from right here) and I had been able to extend the partition I needed. Be aware I experienced to move the partition I needed unrevised at the end.
It has been secure with one of my friend as nicely, but I would recommand to backup the VM before working Gparted Linux.
рüффпрüффп
Not really the solution you're also looking for? Browse other queries tagged vmwarehard-drivelvm or ask your very own query.
I need to resize my initial disk (/dev/xvda) from 40 Gigabyte to 80 GB. I'meters using XEN virtualization, and the disk is definitely resized in XenCenter, but I require to resize its partitioning without shedding any data. The virtual machine is usually running Debian 8.6.
Oldřich Šsixth is védaOldřich Šsixth is véda
2 Answers
This should end up being relatively simple, since you're also making use of LVM:
- First, as generally, take a back-up.
- Resize the drive in Xen (you've already accomplished this; despite this, make sure you re-read stage 1).
- Use parted to resize the extended partition (
xvda2
); runparted /dev/xvda
, then at the parted promptresizepart 2 -1s
to resize it to end at the end of the cd disk (BTW:quit
will obtain out of parted). - Either(a) develop another reasonable partition (
xvda6
) with the free space, after that:- reboot to pick up the partition table adjustments
pvcreate /dev/xvda6
vgextend xenhosting-vg /dev/xvda6
or(c)- prolong xvda5 making use of
resizepart 5 -1s
- reboot to choose up the partition desk modifications
pvresize /dev/xvda5
- Lastly, if you need to add that to your main filesystem,
lvextend -r -d +100%FREE /dev/xenhosting-vg/main
. The-ur
option tolvextend
informs it to contactresize2fs
itself.
Another option you didn't consider:
Add another digital disk. If you can do this in Xen w/o rebooting the guest, after that you can do this entirely on-line (without any reboots). Partition the fresh cd disk
xvdc
(this will not requite a reboot, since its not in use), after that proceed withpvcreate
amp;vgextend
using/dev/xvdc1
.derobertderobert
I'meters currently running Devuan Jessie 1.0 (Stable) in a VM on ProxMox. The partition I needed to lengthen has been
/var/lib
mounted on/dev/sda5
for elasticsearch. Since this wasn'testosterone levels OS vital, I could do it with the VM up. I just made certain that there was nothing making use of the partition withlsof
. To achieve this, I do the using:- Check out the partition to make certain it't not busy:
- If you get any output from this command, you must figure out what will be using the partition in query and end the process. Here is usually a benchmark. LSOF Comand Examples
- Unmount the partition:
- Work parted
- Inside parted:
- Quit parted:
- Verify the disk:
- Extend the storage so the OS sees it:
- Remount:
- Check out to create certain the Operating-system sees the recently extended travel:
Today everything should be great to move. On a part take note,
lvextend
threw an mistake, so for me, theresize2fs
route was the simplest method to proceed. HTH.Linux U'BeardlyLinux O'Beardly