search
HomeOperation and MaintenanceSafetyHow to expand disk space of xen virtual machine

With the extensive use of virtualization technology, there are more and more ideas about using virtualization, such as directly expanding the disk space. In this case, I recommend the method of adding a new disk, which is consistent with the normal use of physical machines. Way.

There is another way to increase disk space, which is to directly expand the space of the existing disk. This method is used in this article.

1. View the virtual machine configuration file

xm list
How to expand disk space of xen virtual machine

##2. The dd2 virtual machine uses /data /dd2.img

How to expand disk space of xen virtual machine

3. Directly expand the existing virtual disk space

Now check the virtual machine disk file size

ll -h

How to expand disk space of xen virtual machine

Directly extend the virtual machine disk file

dd if=/dev/sdb1 bs=1024M count=4 > ;>/data/dd2.img

How to expand disk space of xen virtual machine

has been expanded to 10G, let’s enter the virtual machine for configuration

How to expand disk space of xen virtual machine

4. Start and enter the virtual machine and partition

virt-manager &

How to expand disk space of xen virtual machine

(1) Enter the virtual machine Machine console

How to expand disk space of xen virtual machine

(2) Check the disk partition

It is found that the disk space has not changed and the disk space has not changed. The size has been expanded to 10G. If you directly add the expanded space, you can create another partition and use it directly. Merge the newly created partition directly into the current LVM logical volume.

How to expand disk space of xen virtual machine

How to expand disk space of xen virtual machine

(3) Partition

Add the new disk Add the unused disk space to create a new primary partition /dev/xvda3, and identify the disk as the lvm partition

fdisk /dev/xvda

n

p

##3

t

3

8e

w

How to expand disk space of xen virtual machine

5. Merge the new partition into the LVM logical volume

(1) Create a physical volume

pvcreate /dev/xvda3

pvs

How to expand disk space of xen virtual machine##(2) Create a logical volume group

vgs

vgextend VolGroup /dev/xvda3

##(3) Extend the existing logical volume How to expand disk space of xen virtual machine

lvs

##lvextend -l 100%FREE /dev/VolGroup/lv_root

(4) resize extended logical partition

How to expand disk space of xen virtual machine

resize2fs /dev/VolGroup/lv_root

At this time, add disk space and the expansion is completed.

The above is the detailed content of How to expand disk space of xen virtual machine. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:亿速云. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor