Hello,
First, a little explanation of where I am standing:
I have a virtual instance of Fedora 16 running on KVM/Qemu.
The partition table is simple: /boot (500 MB) and lv_root (5.5 GB) (yes, no swap).
Now, I resized the fedora HDD image with qemu-img. It was 6 GB and now it's 7 GB.
I'd like to resize the lvm partition /dev/vda2
how can I do that?
lvresize is not working; neither is pvresize.
I'm trying to make a script that resizes (extends, no reduction) your partition (using rc.local) at boot time. Automatic resizing, eh?
Anyway, I'd appreciate some help regarding the /dev/vda2 resize. It should be better if it's a one-liner; requiring no user interaction.
---------- Post added at 01:51 AM ---------- Previous post was at 12:30 AM ----------
Ok, it's solved. Here's what I did:
First, delete and recreate the partition table:
Code:
gdisk /dev/vda (yep, I'm using GPT)
d 2 <enter>
n 2 <enter>
<enter>
<enter>
<enter>
8e00 (this should be your partition type. In this case, this one is a LVM partition)
w (don't forget to write the partition table)
Then, very important, run:
in order to update the partitions on your OS. I had to reboot after this... ;=s
Then, everything is sooooo simple:
Code:
pvresize /var/vda2
lvresize -r -l +100%FREE /dev/mapper/vg_f16-lv_root
Done!
I'd still would like to automate this. Any bash script proposal (/etc/rc.local) is appreciated!