I have an ancient xen 4.0 host system with LVM and only one Volume Group Inside the VG there are a few logical volumes.

The Logical Volume i am talking about (slave) is a snapshot of another logical volume (origin master).

I did extend The "Slave" logical volume for a few hundred GB, however the guest debian linux is unable to see this increase.. fdisk still shows the same guest partition shema as before the increase.

The Guests (slave and therefor master) has 3 partitions on the Logical volume.. How would i increase the guest virtual harddrive when i can confirm the logical volume is larger.. (normally with 1 logical volume = 1 partition you would just resize the fs..) But how do i resize the partition table of the guest HDD when it is just the snapshot which i did increase?

I can extend or resize master or slave however i want, but i cannot create a new master or make the slave not beeing a snapshot anymore (due to size limitations)

  • Do I understand correctly that you are running sort of a "clone-server" based on a snapshot of the original server? – inaki Sep 1 '16 at 7:44
  • exactly. The master is a debian which has a specific software installed, while the slave is basically the same but able to be changed by the devs. – Dennis Nolte Sep 1 '16 at 7:49
  • I would suggest making a complete clone of your master and then extend the volumes. Is there a reason why you want the slave to work on a snapshot? If you clone the master (including the snapshot) it looks to me like for your slave you could commit the snapshot state and for your master you can delete the snapshot and continue from there. – inaki Sep 1 '16 at 7:55
  • normally i would go for that method, yes, however size limits here again. the snapshot is only 10% the size of the master, and i cannot duplicate/clone the whole master because of not enough space. This leaves me to think i have to extend the master itself, snapshot after the large changes (file size) are done, and work on a "small" snapshot (client) again. Sadly this process will take about a week until all of this is changed, which i tried to prevent having to take the time for right now :) – Dennis Nolte Sep 1 '16 at 8:19
  • and before you ask: no, not enough space or cash for more hdds, larger ones, or another server. – Dennis Nolte Sep 1 '16 at 8:20

Since your snapshot contains the state of your master vm at one point in time and is not updated afterwards, changing the size of the disks on the master will not be visible to the slave using this snapshot. In other words I reckon you'll have to go about it the long way and like you said, extend the master first and then create a new snapshot for the slave to use.

To expand the disk on the master:
- increase the size of the disk image (on the host)
- make the os of the guest aware of the increase in diskspace: echo '1' > /sys/class/scsi_disk/0\:0\:0\:0/device/rescan
- extend the partition of the disk used as a physical volume in lvm using fdisk
- expand the size of your physical volume: pvresize /dev/<virtual_disk>
- expand the logical volume containing this physical volume using all free space in the volume group: lvresize -l 100%FREE /dev/<vg_name>/<lv_name>
- resize the filesystem: resize2fs /dev/mapper/<lv_name>

  • in hindsight it is obviously i need to increase the master "physical" drive and then create a new snapshot. – Dennis Nolte Sep 5 '16 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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