LVM resize question

Dmitry S. Makovey dmitry at athabascau.ca
Tue Feb 26 19:08:59 UTC 2008


On February 26, 2008, Lopez, Denise wrote:
> Hi all,
>
>
>
> I am in the process of setting up a Xen server and I want to have the
> Guest OS's on LVM's.  I have created a 10GB LVM and installed a CentOS
> guest on it.  Now before it goes production I want to do testing of
> increasing the space for the Guest OS.  I have found documentation that
> says to use resize2fs after you extend the logical volume but when I try
> this command on the logical volume I get the following error.
>
>
>
> root at xen ~]# resize2fs /dev/XenServers/CentOS5
>
> resize2fs 1.39 (29-May-2006)
>
> resize2fs: Bad magic number in super-block while trying to open
> /dev/XenServers/CentOS5
>
> Couldn't find valid filesystem superblock.
>
>
>
> I tried with the -f option too but still the same error.

your /dev/XenServers/CentOS5 is not a "normal" partition. do 
fdisk -l /dev/XenServers/CentOS5

and you'll se that you have partitions inside of that partition. Thus the 
rules of resize2fs don't apply. You could possibly try:

1. stop VM
2. kpartx -a /dev/XenServers/CentOS5
3. now you have /dev/mapper/ entries for all guest's partitions
4. try to run resize2fs from there.

however what I found to be a working solution is whenever you want "more" 
space do:

1. in dom0 create new LVM partition
2. connect it to domU either on-the-fly with the help of xm or just changing 
configuration in /etc/xen/domain.cfg or both
3. inside domU use LVM to add this new device to the existing volume group
4. resize needed logic volume using lvresize
5. use resize2fs to re-adjust FS on that partition.




-- 
Dmitry Makovey
Web Systems Administrator
Athabasca University
(780) 675-6245
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/redhat-sysadmin-list/attachments/20080226/bdcf3b89/attachment.sig>


More information about the redhat-sysadmin-list mailing list