Extension Partition-Logical Volume Keeping existing data

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Miguelito
Posts: 2
Joined: 20. Dec 2015, 12:26

Extension Partition-Logical Volume Keeping existing data

Post by Miguelito »

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
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Extension Partition-Logical Volume Keeping existing data

Post by mpack »

"resize x 20000" is not valid syntax (is that what you actually typed?), plus I assume you want a disk that is larger than 20000MB. Did you read the user manual description of this function?

Have you also read the FAQ? - FAQ: How to resize a Virtual Drive.
I dont want to do a shutdown becase it will make all the existing data, and installed programs and configured, to be lost.
I have no idea what that's about. Applications etc are not lost when you shut down a VM. There are only two ways that makes some sense: one is if you haven't actually installed the guest OS, i.e. you're still running from a live CD, in which case resizing the hard disk - that it isn't yet using - would be a waste of time. The other is if you've configured an immutable drive - and presumably you would know what immutable meant before you did that, and again resizing the base HD would be a waste of time.
Miguelito
Posts: 2
Joined: 20. Dec 2015, 12:26

Re: Extension Partition-Logical Volume Keeping existing data

Post by Miguelito »

Shame on me. I did not installed the Guest OS. I do really appreciate your great support !
Post Reply