[Solved] volume boot has only 4mb disk space remaining error

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
hthi
Posts: 236
Joined: 2015-05-09 15:43
Has thanked: 5 times

[Solved] volume boot has only 4mb disk space remaining error

#1 Post by hthi »

debian 12
Running an update returned:
the volume boot has only 4mb disk space remaining
zstd: error 70 : Write error : cannot write block : No space left on device
E: mkinitramfs failure zstd -q -9 -T0 70
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Suggestions? Can you run an autoremove command on the boot volume? Thanks.
Last edited by hthi on 2025-01-15 15:38, edited 1 time in total.

CwF
Global Moderator
Global Moderator
Posts: 3204
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 67 times
Been thanked: 282 times

Re: [Software] volume boot has only 4mb disk space remaining error

#2 Post by CwF »

hthi wrote: 2025-01-14 18:36Suggestions?
Usually there are too many old kernels installed. Remove old kernels you are not using.
Mottainai

hthi
Posts: 236
Joined: 2015-05-09 15:43
Has thanked: 5 times

Re: [Software] volume boot has only 4mb disk space remaining error

#3 Post by hthi »

sudo apt autoremove worked.

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 1244
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 125 times
Been thanked: 220 times

Re: [Solved] volume boot has only 4mb disk space remaining error

#4 Post by wizard10000 »

Another thing that might help - by default Linux reserves 5% of a filesystem for the root account. This worked pretty well when drives were a lot smaller but 5% of a 500GB drive is 25GB :)

Fortunately this reserved space can be adjusted or eliminated with tune2fs - these days I reserve 1% on my root partition (which is still 5GB) and 0% on other partitions.

Hope this helps -
we see things not as they are, but as we are.
-- anais nin

DebianFox
Posts: 199
Joined: 2024-05-05 14:11
Has thanked: 25 times
Been thanked: 15 times

Re: [Solved] volume boot has only 4mb disk space remaining error

#5 Post by DebianFox »

@wizard10000 how is it possible to check how much has Linux reserved for a particular partition? Is there some command that can be used?

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 1244
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 125 times
Been thanked: 220 times

Re: [Solved] volume boot has only 4mb disk space remaining error

#6 Post by wizard10000 »

DebianFox wrote: 2025-01-16 05:15how is it possible to check how much has Linux reserved for a particular partition? Is there some command that can be used?
From tune2fs' man page -

Code: Select all

       -m reserved-blocks-percentage
              Set the percentage of the file system which may only be allocated
              by privileged processes.   Reserving some number of  file  system
              blocks for use by privileged processes is done to avoid file sys‐
              tem  fragmentation,  and  to  allow  system daemons, such as sys‐
              logd(8), to continue to function correctly  after  non-privileged
              processes  are  prevented  from writing to the file system.  Nor‐
              mally, the default percentage of reserved blocks is 5%.
Anyway, here's how to find out the exact size -

Code: Select all

wizard@laptop 05:22:37 $ sudo tune2fs -l /dev/nvme0n1p2 | grep "Reserved block count\|Block size"
Reserved block count:     1249036
Block size:               4096
wizard@laptop 05:23:11 $ 
Of course you'd replace /dev/nvme0n1p2 with the partition you want to check. Then multiply block count by block size and you get a reserved size in bytes. On my machine that ends up being 5116051456 bytes, or about 5GB but as mentioned my 500GB drive is set at 1%.

Hope this helps -
we see things not as they are, but as we are.
-- anais nin

DebianFox
Posts: 199
Joined: 2024-05-05 14:11
Has thanked: 25 times
Been thanked: 15 times

Re: [Solved] volume boot has only 4mb disk space remaining error

#7 Post by DebianFox »

Thanks @wizard10000. A few follow up questions.

1) Based on the sample values given above, it appears that 4.76 GB has been reserved on the partition for root. i.e. (1249036 * 4096) / (1024 * 1024 *1024). Is my understanding correct?
2) Is this 1% or 5% or whatever the user has decided done on a per partition basis or for root partition only? So if the disk is divided into say root (/), /home, /swap and /boot partition, then for each partition 1% or 5% or some value is reserved for root partition?
3) I went through the Linux File System Hierarchy documentation. It does not specify the value of 5% or 1% or some other value to be reserved for root account on a partition or disk level. Is this value based on distro? Does Debian have some corresponding documentation that refers to this?

User avatar
wizard10000
Global Moderator
Global Moderator
Posts: 1244
Joined: 2019-04-16 23:15
Location: southeastern us
Has thanked: 125 times
Been thanked: 220 times

Re: [Solved] volume boot has only 4mb disk space remaining error

#8 Post by wizard10000 »

1) Yep - you got it :)

2) It's per filesystem so all partitions default to 5% reserved space.

3) FHS doesn't address reserved disk space; AFAIK 5% is the default and I don't think it varies by distribution but a maintainer could always modify source code. No idea whether any other distribution does that, though. I did search for Debian documentation but didn't find anything other than tune2fs' man page.

edit: I mentioned it above but this is configurable even on a running filesystem - the way I did it on my root partition was

Code: Select all

sudo tune2fs -m 1 /dev/nvme0n1p2
where -m sets the percentage of reserved space so -m 1 would set the reservation at 1% of the filesystem and decimals are supported so if someone had a really big drive wanted to do -m 0.5 that'd also work.

This would make a pretty easy how-to that folks might like so I'ma go write one :)
we see things not as they are, but as we are.
-- anais nin

Post Reply