Ext 4 Hard drive 80% rule and Defrag

  • Do internal Ext 4 hard disk drives need to be defragmented or would keeping the drive under 80% full be enough?

    Ubuntu Linux has

    Code
    sudo e4defrag -c /path/to/myfiles

    HTPC: LE 8.2.5 / intel i3-7100 / Gigabyte H270M-D3H / GTX1050 / STX Essence

    • Official Post

    EXT4 basically takes care of itself. Defragmentation is only a problem when lots of small and medium sized files are splattered all over a drive. Whenever you put large files (like videos) onto a HDD for storage, the amount of defragmentation is negligible.

    Here is a YT video explaining how you can check (and defrag if necessary) a HDD:

    External Content www.youtube.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

  • Thanks for that

    I've got a fair bit of music as well as video, so I'll keep all the bigger video files on the HDD & the smaller music files on the SSD


    HTPC: LE 8.2.5 / intel i3-7100 / Gigabyte H270M-D3H / GTX1050 / STX Essence

  • EXT4 basically takes care of itself. Defragmentation is only a problem when lots of small and medium sized files are splattered all over a drive. Whenever you put large files (like videos) onto a HDD for storage, the amount of defragmentation is negligible.

    Here is a YT video explaining how you can check (and defrag if necessary) a HDD:

    External Content www.youtube.com
    Content embedded from external sources will not be displayed without your consent.
    Through the activation of external content, you agree that personal data may be transferred to third party platforms. We have provided more information on this in our privacy policy.

    That's actually not true. When you have a storage HDD and you put some big files in there, then the big files can easily get fragmented. I recently moved my entire movie collection to a new 2T drive. When I placed 2GiB file on the empty drive, the file already had bunch of chunks. After running manually e4defrag, the file had 1 chunk. Now, when you place multiple big files, they all will get fragmented and the more files you add, the more fragments you get with each newly copied file. 20-30 fragments for a 2 GiB file isn't a big thing, but if you don't defrag the HDD, and you start to remove some files and add new ones, they easily get 1K-10K fragments, and then it becomes a problem. So when I was moving the movie collection, I copied 300G, then 10 passed of e4defrag, then I copied another 300G, and another 10 passed of e4defrag, and so on. Whenever I copy some movies to the drive (or delete them), I run one or two passed of e4defrag to keep the fragmentation level at minimum. I've once had a situation where files on my drive were in really bad shape 10-100K chunks for 1GiB files, but that was before I knew how things work. So basically defrag the drive once in a while.