Extension Partition-Logical Volume Keeping existing data
Posted: 20. Dec 2015, 12:56
VBox 5.0.8
Windows 8.1 - Host
Linux as Guest
I would like to Extend an existing Partition-Logical Volume in the Linux Guest. I have followed the steps to increase the size in 20G:
1. From Windows cmd:
VBoxManage modifyhd myvdifilepath --resize x 20000
2. From Linux Guest
sudo fdisk -l -> to simply display current system information
Gparted --> Run to set the New Unallocated partition
lvextend -LG12G /dev/sda1 --> To extend the Logical Volume
(next steps that should be done, correct me if I am wrong, I stopped in step 2 = umount + rsize2fs + mount)
4. The Big problem is that at this point I have to shutdown the VM in order for the extension to take effect ! I dont want to do a shutdown becase it will make all the existing data, and installed programs and configured, to be lost.
Even if I 1st take a shapshot, then shutdown te VM, extend the LV, and finally revert to the snapshot will cancel the extended LV size, right ? so in my case the Snaphot is useless (please correct me if I am wrong again)
I guess there are 2 solutions; please confirm and detail:
1. Understand how can the VM can be shutdown without loosing the current status machine (data and installed program)
2. Extend the LV without shutdown (which I really think it is No possible)
I am sure I am missing something... I just want to extend my LV and keep my current data !. If extension is not possible, is it possible mounting a 2nd file system, which would add extra capaity ?
Thanks in advance for your support.
Miguel
Windows 8.1 - Host
Linux as Guest
I would like to Extend an existing Partition-Logical Volume in the Linux Guest. I have followed the steps to increase the size in 20G:
1. From Windows cmd:
VBoxManage modifyhd myvdifilepath --resize x 20000
2. From Linux Guest
sudo fdisk -l -> to simply display current system information
Gparted --> Run to set the New Unallocated partition
lvextend -LG12G /dev/sda1 --> To extend the Logical Volume
(next steps that should be done, correct me if I am wrong, I stopped in step 2 = umount + rsize2fs + mount)
4. The Big problem is that at this point I have to shutdown the VM in order for the extension to take effect ! I dont want to do a shutdown becase it will make all the existing data, and installed programs and configured, to be lost.
Even if I 1st take a shapshot, then shutdown te VM, extend the LV, and finally revert to the snapshot will cancel the extended LV size, right ? so in my case the Snaphot is useless (please correct me if I am wrong again)
I guess there are 2 solutions; please confirm and detail:
1. Understand how can the VM can be shutdown without loosing the current status machine (data and installed program)
2. Extend the LV without shutdown (which I really think it is No possible)
I am sure I am missing something... I just want to extend my LV and keep my current data !. If extension is not possible, is it possible mounting a 2nd file system, which would add extra capaity ?
Thanks in advance for your support.
Miguel