0

I re-formatted a 8TB HDD with ext4 (was NTFS before) and tried to restore my DVD & Movie collection. After almost 95% of the job was done a message popped up 'no more free diskspace on /dev/sdc1'. The file-manager says only 579 MB available. The disk-usage-analyser reports 400.7 GB available. df says:

eule@bangkok-01:~$ df /dev/sdc1
Filesystem      1K-blocks       Used Available Use% Mounted on
/dev/sdc1      7751366384 7360083416    565308 100% /mnt/data_04

I'm using Ubuntu 17.10. What can be the reason for the discrepancy?

1
  • There are some possibilities: Reserved space for system, number of files (inodes used). As df says Use 100%, the disk (up to the usual 95% allowed) is really used. I don'tknow how your disk-usage-analyzer works, but maybe it justs adds up the size of files, which may be incomplete.
    – ridgy
    Jan 2, 2018 at 15:36

1 Answer 1

1

By default, Linux reserves 5% of the space for root. The reason is that root should be able to log in, and have space to fix issues even when the disk is full.

This can be changed with tune2fs.

Unmount your disk, and run

sudo tune2fs -m 0 /dev/sdc1

This will set the amount of reserved blocks to 0%, which is totally fine for a non-system disk.

From the manpage of tune2fs:

-m reserved-blocks-percentage

          Set the percentage of the filesystem which may only be allocated
          by  privileged  processes.   Reserving some number of filesystem
          blocks for use by privileged processes is done to avoid filesys-
          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 filesystem.  Nor-
          mally, the default percentage of reserved blocks is 5%.

In addition, some space will be used for journal. This should not be changed.

2
  • It works! I assumed something like this, but expected it rather on a system-disk - as you said.
    – Hein Bloed
    Jan 2, 2018 at 15:46
  • As the man page says, the default is 5% reserved. This is not important on non-system disks, and 5% is anyway excessive with very large disks. It can be changed when you make the filesystem, or afterwards :)
    – vidarlo
    Jan 2, 2018 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .