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)
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>