NixOS: No space left on /nix/store during nixos-rebuild or nixops deploy
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
When doing upgrades (especially large ones) on NixOS with a relatively small root partition, I sometimes run out of space after a bunch of new packages are installed in /nix/store
. Eg:
error: preallocating file of 716320 bytes: No space left on device
My usual approach has been to run
nix-collect-garbage
or even
nix-collect-garbage -d
which frees up space by deleting not only the old generations but also the new packages I'm installing.
The next download attempt will download the new packages all over again, and -- if enough space was freed -- may succeed.
Is there a way to delete only the older derivations?
package-management disk-usage nixos
add a comment |Â
up vote
1
down vote
favorite
When doing upgrades (especially large ones) on NixOS with a relatively small root partition, I sometimes run out of space after a bunch of new packages are installed in /nix/store
. Eg:
error: preallocating file of 716320 bytes: No space left on device
My usual approach has been to run
nix-collect-garbage
or even
nix-collect-garbage -d
which frees up space by deleting not only the old generations but also the new packages I'm installing.
The next download attempt will download the new packages all over again, and -- if enough space was freed -- may succeed.
Is there a way to delete only the older derivations?
package-management disk-usage nixos
3
How about cleaning before starting the update?
â MariusMatutiae
Mar 24 at 12:09
@MariusMatutiae Deleting old generations (particularly the last one booted from) is a little risky, and of course still doesn't guarantee that enough space will be freed to avoid downloading repeatedly. Sometimes you have to GC, do a partial update, GC again, and then finally finish the update. It can be pretty annoying without a way to tell whether enough space is available.
â aij
Mar 26 at 14:44
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
When doing upgrades (especially large ones) on NixOS with a relatively small root partition, I sometimes run out of space after a bunch of new packages are installed in /nix/store
. Eg:
error: preallocating file of 716320 bytes: No space left on device
My usual approach has been to run
nix-collect-garbage
or even
nix-collect-garbage -d
which frees up space by deleting not only the old generations but also the new packages I'm installing.
The next download attempt will download the new packages all over again, and -- if enough space was freed -- may succeed.
Is there a way to delete only the older derivations?
package-management disk-usage nixos
When doing upgrades (especially large ones) on NixOS with a relatively small root partition, I sometimes run out of space after a bunch of new packages are installed in /nix/store
. Eg:
error: preallocating file of 716320 bytes: No space left on device
My usual approach has been to run
nix-collect-garbage
or even
nix-collect-garbage -d
which frees up space by deleting not only the old generations but also the new packages I'm installing.
The next download attempt will download the new packages all over again, and -- if enough space was freed -- may succeed.
Is there a way to delete only the older derivations?
package-management disk-usage nixos
asked Mar 24 at 11:53
aij
1062
1062
3
How about cleaning before starting the update?
â MariusMatutiae
Mar 24 at 12:09
@MariusMatutiae Deleting old generations (particularly the last one booted from) is a little risky, and of course still doesn't guarantee that enough space will be freed to avoid downloading repeatedly. Sometimes you have to GC, do a partial update, GC again, and then finally finish the update. It can be pretty annoying without a way to tell whether enough space is available.
â aij
Mar 26 at 14:44
add a comment |Â
3
How about cleaning before starting the update?
â MariusMatutiae
Mar 24 at 12:09
@MariusMatutiae Deleting old generations (particularly the last one booted from) is a little risky, and of course still doesn't guarantee that enough space will be freed to avoid downloading repeatedly. Sometimes you have to GC, do a partial update, GC again, and then finally finish the update. It can be pretty annoying without a way to tell whether enough space is available.
â aij
Mar 26 at 14:44
3
3
How about cleaning before starting the update?
â MariusMatutiae
Mar 24 at 12:09
How about cleaning before starting the update?
â MariusMatutiae
Mar 24 at 12:09
@MariusMatutiae Deleting old generations (particularly the last one booted from) is a little risky, and of course still doesn't guarantee that enough space will be freed to avoid downloading repeatedly. Sometimes you have to GC, do a partial update, GC again, and then finally finish the update. It can be pretty annoying without a way to tell whether enough space is available.
â aij
Mar 26 at 14:44
@MariusMatutiae Deleting old generations (particularly the last one booted from) is a little risky, and of course still doesn't guarantee that enough space will be freed to avoid downloading repeatedly. Sometimes you have to GC, do a partial update, GC again, and then finally finish the update. It can be pretty annoying without a way to tell whether enough space is available.
â aij
Mar 26 at 14:44
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
I think you have 2 possible solutions here. Firstly rather than delete all old generations you can instead specify those for deletion. See the manual entry for the nix-env --delete-generations
operation. Secondly the nix-store --optimise
operation (ref) may be useful for you also.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I think you have 2 possible solutions here. Firstly rather than delete all old generations you can instead specify those for deletion. See the manual entry for the nix-env --delete-generations
operation. Secondly the nix-store --optimise
operation (ref) may be useful for you also.
add a comment |Â
up vote
0
down vote
I think you have 2 possible solutions here. Firstly rather than delete all old generations you can instead specify those for deletion. See the manual entry for the nix-env --delete-generations
operation. Secondly the nix-store --optimise
operation (ref) may be useful for you also.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I think you have 2 possible solutions here. Firstly rather than delete all old generations you can instead specify those for deletion. See the manual entry for the nix-env --delete-generations
operation. Secondly the nix-store --optimise
operation (ref) may be useful for you also.
I think you have 2 possible solutions here. Firstly rather than delete all old generations you can instead specify those for deletion. See the manual entry for the nix-env --delete-generations
operation. Secondly the nix-store --optimise
operation (ref) may be useful for you also.
answered Mar 27 at 12:04
brocking
1484
1484
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%2f433255%2fnixos-no-space-left-on-nix-store-during-nixos-rebuild-or-nixops-deploy%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
3
How about cleaning before starting the update?
â MariusMatutiae
Mar 24 at 12:09
@MariusMatutiae Deleting old generations (particularly the last one booted from) is a little risky, and of course still doesn't guarantee that enough space will be freed to avoid downloading repeatedly. Sometimes you have to GC, do a partial update, GC again, and then finally finish the update. It can be pretty annoying without a way to tell whether enough space is available.
â aij
Mar 26 at 14:44