You are not logged in.

#1 2018-12-19 14:39:21

slv
Member
Registered: 2017-01-17
Posts: 37

Reclaiming space

Hello

I have VM with Bunsen on VirtualBOX. After some time I realized that my VM is big (I downloaded some files ...) and at the moment:
/dev/sda4       266G   28G  225G  11% /home
filesystem is ext4

I deleted files and at the moment its able to reclaim space from this partition.
But question is how to do that?

Regards
Slawek

Last edited by slv (2018-12-19 18:47:02)

Offline

#2 2018-12-19 18:18:58

damo
....moderator....
Registered: 2015-08-20
Posts: 4,922

Re: Reclaiming space


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#3 2018-12-19 18:35:23

slv
Member
Registered: 2017-01-17
Posts: 37

Re: Reclaiming space

nope ... I need to shrink this partition wink

Offline

#4 2018-12-19 20:04:21

damo
....moderator....
Registered: 2015-08-20
Posts: 4,922

Re: Reclaiming space

slv wrote:

nope ... I need to shrink this partition wink

Virtualbox wrote:

Note 2: You can not shrink a guest drive with VirtualBox due to the inherent danger of loosing data or making the guest non-bootable.

In that case you could back up any data you want, then create a VM of the size you need, and reinstall the guest OS.

There is also How To Reduce The Size Of VirtualBox VMs , as one example search result.

Last edited by damo (2018-12-19 20:08:11)


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#5 2018-12-21 06:36:18

ohnonot
...again
Registered: 2015-09-29
Posts: 3,767
Website

Re: Reclaiming space

doesn't virtualbox default to resizing the vm file dynamically?
have you checked if your vm files actually really do take up all that space on your host? because i think not.

Offline

#6 2019-01-24 14:46:42

THX1138
Member
Registered: 2019-01-14
Posts: 191

Re: Reclaiming space

Once you set the media type as fixed you cannot revert it to dynamic, however, if you begin by setting it to dynamic you can opt later to make it a fixed drive. If you look in the vbox under "global tools" then look at the entry for virtual media manager, you will see this is true, as there are only settings for resize if the disk is dynamic.

I doubt that gparted will work under vbox, I may give it a go hahahahah, if it does I will let you know

Oh I found this but it's from 2011
wonder if still relevant

Last edited by THX1138 (2019-01-24 15:02:41)


The telephone is an antiquity - you never know who is calling, there is no image, it is an outmoded product which constantly disrupts work (Ralf Hutter (Kraftwerk)) ps: my wife knows how much I dislike being disrupted at Work - Ralf Hutter hit the nail on the head there

Offline

#7 2019-01-24 17:03:29

Bearded_Blunder
Dodging A Bullet
From: Seat: seat0; vc7
Registered: 2015-09-29
Posts: 730

Re: Reclaiming space

damo wrote:

In that case you could back up any data you want, then create a VM of the size you need, and reinstall the guest OS.

In essence rather than exact detail:
Create a new (dynamic) vhd,  and add to the machine.
Partition as you'd like the new layout but with a separate partition for /home using gparted
backup /etc/apt/sources.list & /etc/apt/sources.list.d/bunsen.list + any other sources to somewhere under ~/
dpkg --get-selections >> software.list
copy all content /home to the new drive's /home (cp or rsync with the right options)
remove oversize vhd from machine
minimal netinstall of debian, manual partitioning.. just use it to pick mount points,
you already partitioned earlier using gparted, don't let (new) /home be formatted.
restore sources lists
use dpkg -set-selections to get software back


If all isn't well, start over another way, you've not damaged anything, just revert to using the oversize drive.
If all's good.. delete oversize virtual drive.


Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me

Offline

Board footer

Powered by FluxBB