Virtualbox dynamically-allocated disk *.vdi keeps growing
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
When using Linux in Virtualbox and dynamically-allocated disk, it keeps growing even though almost half of space is free:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 94G 12G 78G 13% /
This disk takes >24G on disk and keeps growing, filesystem ext4.
linux filesystems ext4
add a comment |Â
up vote
1
down vote
favorite
When using Linux in Virtualbox and dynamically-allocated disk, it keeps growing even though almost half of space is free:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 94G 12G 78G 13% /
This disk takes >24G on disk and keeps growing, filesystem ext4.
linux filesystems ext4
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
When using Linux in Virtualbox and dynamically-allocated disk, it keeps growing even though almost half of space is free:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 94G 12G 78G 13% /
This disk takes >24G on disk and keeps growing, filesystem ext4.
linux filesystems ext4
When using Linux in Virtualbox and dynamically-allocated disk, it keeps growing even though almost half of space is free:
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 94G 12G 78G 13% /
This disk takes >24G on disk and keeps growing, filesystem ext4.
linux filesystems ext4
asked Nov 28 '17 at 8:00
kirill-a
2,0351820
2,0351820
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
In order to discard unused blocks on filesystem there is a command fstrim
, part of util-linux
package.
But to use it on Virtualbox, it is needed to enable discard option on your virtual disk by stopping you VM and running the following command:
VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --discard on
where "SATA" and 0 are parameters of your disk controller, can be checked in VB settings for your specific VM.
Then boot your machine and run
# fstrim /
To automate this process, add this command to cron, once in a week is usually enough.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
In order to discard unused blocks on filesystem there is a command fstrim
, part of util-linux
package.
But to use it on Virtualbox, it is needed to enable discard option on your virtual disk by stopping you VM and running the following command:
VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --discard on
where "SATA" and 0 are parameters of your disk controller, can be checked in VB settings for your specific VM.
Then boot your machine and run
# fstrim /
To automate this process, add this command to cron, once in a week is usually enough.
add a comment |Â
up vote
2
down vote
accepted
In order to discard unused blocks on filesystem there is a command fstrim
, part of util-linux
package.
But to use it on Virtualbox, it is needed to enable discard option on your virtual disk by stopping you VM and running the following command:
VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --discard on
where "SATA" and 0 are parameters of your disk controller, can be checked in VB settings for your specific VM.
Then boot your machine and run
# fstrim /
To automate this process, add this command to cron, once in a week is usually enough.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
In order to discard unused blocks on filesystem there is a command fstrim
, part of util-linux
package.
But to use it on Virtualbox, it is needed to enable discard option on your virtual disk by stopping you VM and running the following command:
VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --discard on
where "SATA" and 0 are parameters of your disk controller, can be checked in VB settings for your specific VM.
Then boot your machine and run
# fstrim /
To automate this process, add this command to cron, once in a week is usually enough.
In order to discard unused blocks on filesystem there is a command fstrim
, part of util-linux
package.
But to use it on Virtualbox, it is needed to enable discard option on your virtual disk by stopping you VM and running the following command:
VBoxManage storageattach <VM name> --storagectl "SATA" --port 0 --discard on
where "SATA" and 0 are parameters of your disk controller, can be checked in VB settings for your specific VM.
Then boot your machine and run
# fstrim /
To automate this process, add this command to cron, once in a week is usually enough.
answered Nov 28 '17 at 8:00
kirill-a
2,0351820
2,0351820
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407437%2fvirtualbox-dynamically-allocated-disk-vdi-keeps-growing%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password