vgreduce LMV
I have installed Fedora 15 on my laptop a couple of days ago, but now i want to install windows next to it.
T do this i have to resize the lvm partition. Using a live disk, I used this post as guide: http://www.linuxquestions.org/questi...6/#post2784317 But at the final step (vgreduce) i get this message: Physical volume "/dev/sda2" still in use What now? Can someone help me reducing the size of my lvm partition? Some info: Code:
[root@Rene-Fedora rene]# vgs Code:
[root@localhost liveuser]# swapoff -a |
vgreduce does NOT resize a PV it - removes it. Since sda2 is the only PV in your VG you can not reduce it. At this point you can "vgremove" to remove the entire volume group if that is your intent.
If your intent is to resize the VG rather than remove it you can use the pvresize command which will allow you to shrink the size of the PV on sda2 then you can use fdisk or parted to resize the partition on /dev/sda. If you type "man pvresize" it gives you some good information. |
When using pvresize i get this message:
Code:
[root@Rene-Fedora rene]# pvresize --setphysicalvolumesize 131G /dev/sda2 |
So i found out that lv_home and lv_swap are at the beginning of the pv and lv_root at the end. SO how do i move the lv_root on the pv so i get the free space at the and?
|
Haven't done this. From research it appears moving extents with the same PV can be done on the same disk using "pvmove --alloc" with additional flags. (Do a web search for that in quotes as shown and you'll get lots of hits.) I can't give any guidance as I haven't done that but it appears others have. I've seen it suggested that "pvmove --alloc anywhere" would do it but the "anywhere" makes me think you couldn't be sure where the extents would end up.
You could for this purpose get rid of the swap completely then add it back after the resize is all done by using swapoff to remove your swap usage on the system. (man swapoff). You'd then do an lvremove to remove the swap LV. That will free up the space at the front of the PV which might make your pvmove --alloc move other extents to the front. ***WARNING*** As noted I haven't done the above - try it at your own risk. You should definitely have a full backup before attempting this. ***WARNING*** |
I found this when searching for it:
http://www.linuxquestions.org/questi...-in-it-765047/ Looks promising. Will try this when i get home. |
All times are GMT -5. The time now is 05:41 AM. |