Skip to main content

Topic: ext4 with journal (Read 2669 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • simonh
  • [*][*][*]
ext4 with journal
I recently bought a 1TB external drive. It was preformatted NTFS, and had 930GB available upon plugging in. As I use Linux, I formatted it to ext4 and it then had 870GB available. I assume the missing 60GB is used for the journal.

Does anyone know if I can reclaim that 60GB when the drive gets full. Or will it happen automatically? Or not at all?

Cheers

ext4 with journal
Reply #1
It will not happen automatically. Your missing space is caused by the journal and the reserved blocks. Have a look at the tune2fs -m switch and adapt the value of your drive if necessary. Theoretically you could even set that to 0, but I am not sure if that's a good idea.
  • Last Edit: 24 October, 2010, 04:36:25 AM by Sebastian Mares

  • hlloyge
  • [*][*][*][*][*]
ext4 with journal
Reply #2
If using it just as storage, why not formatting it as EXT2?

ext4 with journal
Reply #3
Well, I wouldn't... Unless you want to do a full HDD scan in case the drive was not plugged out correctly (which you would also have to do in case you disable the journal (or set it to 0 bytes) for ext3 / ext4).
  • Last Edit: 23 November, 2010, 03:48:06 PM by Sebastian Mares

  • Garf
  • [*][*][*][*][*]
  • Developer (Donating)
ext4 with journal
Reply #4
This is not only due to the journal (about 128M, certainly not several GB) and reserved space (by default 5%, or about 45G), but also due to the bookkeeping data (inodes), which is preallocated for ext4. NTFS does not preallocate it but assigns it on demand by expanding the MFT (which can then fragment, thereby degrading performance). You will also lose that diskspace on NTFS as you start adding more files.

There are other filesystems for Linux that do not preallocate (such as XFS and btrfs), but in general I wouldn't worry about it as this is really just a tradeoff between reserving space upfront or when it's needed.

A small advantage of allocating on demand is that if you would only put a few big files, you'd lose less space, and if you want to store a gazillion tiny files, you can run out of inodes. But again, for normal usage, the defaults are perfectly fine.