Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Resizing a LV when the KVM is Not Looking [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44027
Location: 56N 3W

PostPosted: Sun Oct 05, 2014 8:04 pm    Post subject: Resizing a LV when the KVM is Not Looking [solved] Reply with quote

Team,

I just know I'm overlooking something obvious.
I have a KVM media server which has a media LV which I need grow. I've done this several times in the past, its a little hair raising but its
always worked. The physical volume info is
Code:
Eccles ~ # pvdisplay
  WARNING: lvmetad is running but disabled. Restart lvmetad before
enabling it!
  --- Physical volume ---
  PV Name               /dev/md2
  VG Name               vm
  PV Size               7.25 TiB / not usable 0
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1899914
  Free PE               0
  Allocated PE          1899914
  PV UUID               Dtw3Ly-QP0a-RqR2-hjir-Xt6J-j4xE-z9v40k

The Free PE is zero because I have just donated 30943 extents (all the free space) to /dev/vm/media which now loooks like
Code:
Eccles ~ # lvdisplay
/dev/vm/media
  WARNING: lvmetad is running but disabled. Restart lvmetad before
enabling it!
  --- Logical volume ---
  LV Path                /dev/vm/media
  LV Name                media
  VG Name                vm
  LV UUID                9wQ3fw-2eB4-Ztfg-lfyu-k3Gn-2WlZ-tgbB5G
  LV Write Access        read/write
  LV Creation host, time ,
  LV Status              available
  # open                 1
  LV Size                7.07 TiB
  Current LE             1853807
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           252:15


The new gpt disklabel in the VM is now
Code:
MediaServer ~ # parted /dev/vdb
GNU Parted 3.1
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free                                                       
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 6546GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name   Flags
        17.4kB  1049kB  1031kB  Free Space
 1      1049kB  6546GB  6546GB  ext4         media
        6546GB  6546GB  1032kB  Free Space


So its not seen the new free space.

From the host side, parted tells me that the backup partition table is not at the end of the volume and offers to move it for me. Thats fine.
This does not change the filesysem size on the LV.

Meanwhile, back in the VM, the VM does not see the new space and complains that the backup partition table is corrupt (its just been
moved.). Even making a new disk label in the VM has no effect. The new space is still not available.
I've also tried rebooting the host.

So, where does the VM get the old LV size from?
All this LV resizing has been carrieod out with the VM shut down (not paused), so nothing is mounted.

What am I missing?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.


Last edited by NeddySeagoon on Tue Oct 07, 2014 7:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Mon Oct 06, 2014 6:30 am    Post subject: Reply with quote

as far as I have understood you create a new phyiscal volume first. Than you add this new phyiscal volume to your logical volume. AFAIK you only need more extend and therefore making a new phyiscal volume should solve this.

this article looks like the idea I had:
http://www.techotopia.com/index.php/Adding_a_New_Disk_to_a_Fedora_Volume_Group_and_Logical_Volume#Adding_Additional_Space_to_a_Fedora_Volume_Group_from_the_Command_Line
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44027
Location: 56N 3W

PostPosted: Mon Oct 06, 2014 5:12 pm    Post subject: Reply with quote

tw04l124,

The PV existed beforehand but with 30943 unallocated extents.
I donated these free extents to /dev/vm/media, so it now has some free space.
parted on the host confirms this.

Back in the VM, this additional free space is not visible.

/dev/vm/media becomes /dev/vdb here. Its partioned with parted to make a single partition.
I expected to remove this partiton and make a new one in its place, starting at the same place but extending to the end of the enlarged volume.
Then to grow the ext4 filesystem into the free space.

While /dev/vm/media works as expected on the host the free space never appears in /dev/vdb.
I'm aware of rebooting to see the new partition table - it doesn't appar to help.

From your link, I didn't need the pvcreate and vgextend as I had spare space already.
The lvextend -L+... step worked and parted told me that the backup partition table was not at the end of the volume.
I was expecting to destroy and remake the partition tabe in the VM before I could run
resize2fs
but the new space does not appear in the KVM.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44027
Location: 56N 3W

PostPosted: Tue Oct 07, 2014 7:17 pm    Post subject: Reply with quote

The key step I was missing was to remove the volume from the KVM then readd it so the new space was seen.
Looking at /dev/vdb in the KVM with parted then showeh the expected warning about the backup GPT not being at the end ot the volume
Letting parted fix worked.

Then it wan a case of removing the existing partition and creating a new one with the same start point.
This got all my DVDs back.
Attempting resize2fs /dev/vdb1 while it was not mounted prompted resize2fs to want to run fsck. Thats a bad idea as it often makes bpoken filesystems worse.
mounting /dev/vdb1 and doing an online resize produced the desired results.

I still have the DVDs on my media server and 1.2Tb of free space too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum