Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Ok,

I am trying to resize a Xen HVM disk. I have added the space to the vm as you can see here it is now 780GB.

--- Logical volume --- LV Name /dev/VM_VolGroup/vm104_img VG Name VM_VolGroup LV UUID qWx0fZ-R99f-pYSf-UpyV-c3bI-9ulk-Oi0iie LV Write Access read/write LV Status available # open 2 LV Size 780.00 GB Current LE 24960 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:3

but I have not been able to resize the filesystem so I can allocate the space in the vm. I ended up following a tutorial that stated to fdisk vm104_img which I did but now the disk is showing as 837.5GB instead of the 780GB it is allocated. To fix this I believe I would just do fdisk again and give a smaller block size for vm104_img2 as when I originally did fdisk I just used the default.

fdisk -l /dev/VM_VolGroup/vm104_img

Disk /dev/VM_VolGroup/vm104_img: 837.5 GB, 837518622720 bytes 255 heads, 63 sectors/track, 101822 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

                 Device Boot      Start         End      Blocks   Id  System

/dev/VM_VolGroup/vm104_img1 * 1 13 104391 83 Linux /dev/VM_VolGroup/vm104_img2 14 101822 817780792+ 83 Linux

I also noticed after I did the fdisk the img2 partion went from being System type Linux LVM to just Linux. I am not sure if this has something to do with it or not but this is where I sit now. I have tried many things and have not been able to resize the fs to make the new space available in the os. Any assistance would be greatly appreciated.

share|improve this question
add comment

1 Answer

It's not really clear what is going wrong here - it would help to specify exactly what commands you ran and at what point things went wrong, with any error messages.

I'm not sure why you are using fdisk - the point of LVM is to fdisk once only when initially creating physical volumes (PVs) mapped to disk partitions; from that point onwards you never use fdisk, you just use filesystem command (resize, fsck) and LVM admin commands.

Finding a better tutorial on resizing might help. The LVM HOWTO is the canonical guide but there are others.

In the mean time, the resizing section of this answer on LVM risks might be useful.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.