0

I have just installed a new 2TB disk, but "df -h" shows only 1.8TB - total size, and 1.7TB of free space. I have not used the disk yet. I realized it after I ran "mke2fs -t ext4".

Here are some output:

fdisk -l /dev/sda

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc579fda1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1      243201  1953512001   83  Linux

and:

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdc2             457G  304G  130G  71% /
devtmpfs              5.9G  296K  5.9G   1% /dev
tmpfs                 5.9G  4.0K  5.9G   1% /dev/shm
/dev/md0              230G   21G  198G  10% /u01
/dev/sda1             1.8T  196M  1.7T   1% /idx
# 

Nothing is there, because I just ext4 formatted it.

find /idx/
/idx/
/idx/lost+found

Mount output:

/dev/sdc2 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,mode=1777)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/md0 on /u01 type ext3 (rw)
/dev/sda1 on /idx type ext4 (rw)

I am running OpenSuse 11.3 x86_64.

x-man
  • 377
  • 2
  • 4
  • 13

2 Answers2

2

Most linux distributions reserve 5% of new partitions for the root user and system services. The idea here is even when you run out of disk space, the root user should still be able to log in and system services should still run… this won’t happen if there is no space on the root partition. This policy may have been appropriate in the 90s when hard disk capacities were relatively low but this is 2010 and one can get a 1TB hard drive for a couple of hundred Ghana Cedis. 5% of that is about 51GB and those system services need only a couple of hundred megabytes.

You can use tune2fs to adjust this

http://odzangba.wordpress.com/2010/02/20/how-to-free-reserved-space-on-ext4-partitions/

ckliborn
  • 2,778
  • 4
  • 25
  • 37
  • @ckliborn I ran that tune2fs and it freed the 100 MB but it still says 200MB. /dev/sda1 1.8T 196M 1.8T 1% /idx – x-man Jan 04 '12 at 21:24
  • 1
    @ckliborn To my knowledge, the reserved blocks don't have any impact on the `df` output, they just stop writes when the space is down that low (when `df` says 95% usage). frankmoss, the 200MB is just filesystem overhead - note that it's *not* the full 200GB that you suspect you're missing. As Zoredache pointed out, drive manufacturers use SI units for their drive specifications, while computers use multiples of 1024; this is your discrepancy between 2.0TB and 1.8TB. – Shane Madden Jan 04 '12 at 22:50
2

For historical reasons, operating systems report disk sizes in binary units but use the notation for decimal units. When your operating system says "1.8TB", it actually means 1.8TiB and since 2TB is equal to 1.82TiB, that's exactly right.

Your drive reports 2.000 trillion bytes. 1.8TiB is 1.979 trillion bytes.

David Schwartz
  • 31,449
  • 2
  • 55
  • 84