Resizing root virtual disk on the CentOS


 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Resizing root virtual disk on the CentOS
# 1  
Old 01-18-2012
Resizing root virtual disk on the CentOS

Hello,

Can someone suggest me what I missing, I re-sized a root virtual disk to 30GB on the CentOS VM. After re-sizing the disk, I booted the OS and ran fdisk -list command I was able view the size of the disk as 30GB.

Paritions in the vm before I resize are:

/boot - Primary parition
/ and swap are logical volumes filesystem.

but when I ran pvdisplay command I see the same output, but not sure how to scan the additional size that I added to virtual disk and bring it under lvm.

Thanks,
# 2  
Old 01-21-2012
I think fdisk will show you that the size of the disk has changed, but the size of the partition being used as the pv for LVM hasn't changed. The space you added is just now shown as free space on the disk. I'd use fdisk to create another partition using the space you added. Then pvcreate on the new partition (probably /dev/sda3), add it to the volume group with vgextend, extend the logical volume with lvextend and then resize the filesystem with resize2fs.

Something like this (after creating the new partition with fdisk and assuming you added 10GB):

Code:
 
# pvcreate /dev/sda3
# vgextend rootvg /dev/sda3
# lvextend -L +10G /dev/rootvg/rootlv
# resize2fs -p /dev/rootvg/rootlv

Adjust the size added and the name of the vg and lv to fit your situation...

BTW, we'd usually just add another virtual disk to the guest, pvcreate it, vgextend the volume group onto it, lvextend the lv and resize2fs the filesystem. That way, you're not trying to resize or repartition a live disk.

Also, if you add another virtual disk and are going to use the whole thing as a pv, you don't need to have a partition table or to create a partition - just use the name of the whole disk.

Code:
 
pvcreate /dev/sdb
vgextend rootvg /dev/sdb
... and so on

Cheers!
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Lost Root Password on VXVM Encapsulated Root Disk

Hi All Hope it's okay to post on this sub-forum, couldn't find a better place I've got a 480R running solaris 8 with veritas volume manager managing all filesystems, including an encapsulated root disk (I believe the root disk is encapsulated as one of the root mirror disks has an entry under... (1 Reply)
Discussion started by: sunnyd76
1 Replies

2. UNIX for Dummies Questions & Answers

how to go about resizing the virtual disk?

Hi guys , We are running machines in virtual environment. As a part of virtual solution we have a disk created in form of files on host machine. The problem is we are facing space crunch and need to re size the harddisk files of virtual machines. There a catch the virtual machines are... (0 Replies)
Discussion started by: pinga123
0 Replies

3. Solaris

Hard disk resizing Solaris

Dear All, I have a task of resizing the Solaris Partitions. This server contains SVM. Kindly let me know the steps in resizing the partitions and precautions. Regards Rj (3 Replies)
Discussion started by: jegaraman
3 Replies

4. Red Hat

deleted a virtual machine with critical data under CentOS

Hi all, I'm in a pretty messed-up situation, hope you can give me a hand. I deleted by accident a folder containing a VMware server virtual machine, that contains most critical information. The host OS is CentOS 5.5, which I believe by default uses Ext3. I shut down the PC intermediately... (2 Replies)
Discussion started by: starriol
2 Replies

5. Virtualization and Cloud Computing

Installing CentOS 5.5 on Virtual Box

Hi, I have installed VirtualBox, downloaded CentOS 5.5 and created a VirtualMachine where i have installed the 'server' versión of CentOS 5.5 As I installed Virtual Box a new network device appeared '192.16.1.250' in my 'real' machine. I was unable to reach my webserver so i istalled CentOS once... (5 Replies)
Discussion started by: motoko
5 Replies

6. Solaris

Resizing a disk

I'm used to using AIX but a new box running Solaris I need a little help with. The disk are presented from a SAN, the disk needing to change is presented as 148GBs drive which was allocated to a file system as the same. I need to change that without losing any data. I know I can change the disk... (7 Replies)
Discussion started by: ltlawnman
7 Replies

7. UNIX for Dummies Questions & Answers

Mail/ftp/web servers, on VIRTUAL!! dedicated server. Also resource usage. Centos 5.

Hi. First of all, would 4 or 5 websites, 1 ftp server (when downloading by someone or a few persons or one, concretize) and one mail server (not many emails, just to sound official and have a nice, spam-free email for myself). Websites with not that many, but some, later more visitors, quite... (0 Replies)
Discussion started by: newn
0 Replies

8. Solaris

Resizing the Root Filesystem

Is it possible to increase the root filesystem size without reboot ?? (4 Replies)
Discussion started by: gowthamakanthan
4 Replies
Login or Register to Ask a Question