I have a VM running on Win10 host (poor me) with Xubuntu 16.04 as guest. After installing a bunch of stuff the free space on the VM's dedicated HDD (10GB) shrunk pretty fast. I need to also install Qt which needless to say requires more than I can offer with the current HDD attached to the VM. Now there are multiple options how to proceed here (cloning the HDD, expanding it and then re-attaching it using Clonezilla; resizing the HDD using VirtualBox's tools (I have it as fixed size so it should work more or less) etc.). A couple of years ago I was facing a very similar problem with a bunch of very large projects that I had to work on in a Linux VM and back than I created a new HDD, partitioned it (a single logical partition with ext4 as FS), mounted it (edited
/etc/fstab of course) and used it without any issues.
Here's the thing - I decided to dedicate the new HDD with its parition to
/opt as a mounting point. However
/opt is already taken by the first HDD when the initial installation of Xubuntu went through. I did that and needless to say the VirtualBox guest additions disappeared (the only thing that was in the previous
/opt. Reinstalling these was not a problem at all so everything works fine now.
However this raised a question in my tiny brain namely when you adjust the mounting points (as in my case
/opt from HDD 1 to
/opt from HDD 2) what happens to the contents that were there?