0

I have a 4 TB drive and I am missing some space.

It has one partition of 7814035086 sectors:

$ sudo gdisk -l /dev/sdc
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 7814037168 sectors, 3.6 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): AD8CFC18-1D06-5631-8127-13DCC57E1921
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      7814037134   3.6 TiB     8300  Linux filesystem

That partition is encrypted:

$ sudo cryptsetup status /dev/dm-0
/dev/dm-0 is active and is in use.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 512 bits
  device:  /dev/sdc1
  offset:  4096 sectors
  size:    7814030991 sectors
  mode:    read/write

It has a size of only 7814030991 caused by the offset. That's ok (only 4096 sectors difference). But now let's check size of the filesystem:

$ df
[...]
/dev/dm-0           3845576524  3844314380   1245760  100% /media/bak-5

The encrypted device has a size of "7814030991 sectors * 512 byte / 1024 = 3907015495 1K-Blocks". However, the filesystem has a size of only 3845576524 1K-Blocks. That's a difference of 58,59 GiB.

I know that ext4 reserves 5% for root by default, but I already disabled that:

$ sudo tune2fs -l /dev/dm-0 | grep Reserved
Reserved block count:     0
Reserved GDT blocks:      791
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)

How can I use that "missing" 58 GiB?

PS: It's a rarely used backup drive so don't worry about disabling the 5% reserved area :)

0

It is less than 2% of the total space, and it is used by filesystem metadata, such as block allocation bitmaps and inode tables. You can get a little space back out of the inode tables by reformatting ( which will of course, destroy all data currently there ) the volume and using the -T largefile or -T largefile4 options to mke2fs. This will reduce the maximum number of files that can be stored on the volume and get some of that 2% back.

  • Another option is to use a different filesystem, though I don't know what the overhead for the common ones are off the top of my head. – derobert Nov 7 '18 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.