Pages

Tuesday, December 13, 2016

Increasing the space of active img file


Increasing the space of active img file








To increase the space of live img file of xen VM image
 .By this method there will be no loss of data and no 
re format is required .




Here in VM image sixe of /dev/xvdb will increase from 49 GB to 58GB


Now
[root@VMIMAGE1 data]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 9.4G 3.2G 6.2G 35% /
/dev/xvda1 99M 13M 82M 13% /boot
tmpfs 1.0G 0 1.0G 0% /dev/shm
/dev/xvdb 49G 35G 11G 77% /data






1. Stop the VM image



    root@VMSERVER: xm destroy <ID>




2.Increase the size of img file using qemu-img


-rw-r--r-- 1 root root 52428800000 Dec 14 06:08 data.img


     root @VMSERVER : qemu-img resize data.img +10G e






Image resized.
-rw-r--r-- 1 root root 63166218240 Dec 14 06:44 data.img


3.Resize it using resize2fs




    root @VMSERVER : resize2fs -f data.img


resize2fs 1.43-WIP (20-Jun-2013)
Resizing the filesystem on data.img to 15421440 (4k) blocks.
The filesystem on data.img is now 15421440 blocks long.



4.Reboot the VM image .


5.check the size of the drive


df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 9.4G 3.2G 6.2G 35% /
/dev/xvda1 99M 13M 82M 13% /boot
tmpfs 1.0G 0 1.0G 0% /dev/shm
/dev/xvdb 58G 35G 21G 64% /data
[oracle@VMIMAGE ~]$ cd /data/
[oracle@ VMIMAGE data]$ ls -l
total 2104844

drwxr-xr-x 3 oracle oinstall 4096 Feb 27 2014 10g

No comments:

Post a Comment