How to defragment files in size less than 100MB only in ext4 filesystem

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a very basic idea:



I would like to defragment files in size less than 100MB only in ext4 filesystem.



Since there is no option for that in the defragmentation tool (e4defrag), any ideas how I could achieve that?



I know only how to find those files:



find / -type f -size -100M


Reason for such action:



I had a system with 99.x% of the fs occupied, I freed the space now, leaving many files fragmented.







share|improve this question






















  • First check to see if de-fragmentation needs doing. ext file systems don't get as fragmented as fat or ntfs. About the only scenario that causes excessive fragmentation slowly appending to a file (and even this is reduced by ext. So if your partition is mostly log files, then it may fragment. To mitigate this, as part of log rotation, zip the older logs. This will, as well as saving space, de-frag the files.
    – ctrl-alt-delor
    Jan 24 at 10:14














up vote
0
down vote

favorite












I have a very basic idea:



I would like to defragment files in size less than 100MB only in ext4 filesystem.



Since there is no option for that in the defragmentation tool (e4defrag), any ideas how I could achieve that?



I know only how to find those files:



find / -type f -size -100M


Reason for such action:



I had a system with 99.x% of the fs occupied, I freed the space now, leaving many files fragmented.







share|improve this question






















  • First check to see if de-fragmentation needs doing. ext file systems don't get as fragmented as fat or ntfs. About the only scenario that causes excessive fragmentation slowly appending to a file (and even this is reduced by ext. So if your partition is mostly log files, then it may fragment. To mitigate this, as part of log rotation, zip the older logs. This will, as well as saving space, de-frag the files.
    – ctrl-alt-delor
    Jan 24 at 10:14












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a very basic idea:



I would like to defragment files in size less than 100MB only in ext4 filesystem.



Since there is no option for that in the defragmentation tool (e4defrag), any ideas how I could achieve that?



I know only how to find those files:



find / -type f -size -100M


Reason for such action:



I had a system with 99.x% of the fs occupied, I freed the space now, leaving many files fragmented.







share|improve this question














I have a very basic idea:



I would like to defragment files in size less than 100MB only in ext4 filesystem.



Since there is no option for that in the defragmentation tool (e4defrag), any ideas how I could achieve that?



I know only how to find those files:



find / -type f -size -100M


Reason for such action:



I had a system with 99.x% of the fs occupied, I freed the space now, leaving many files fragmented.









share|improve this question













share|improve this question




share|improve this question








edited Jan 24 at 11:54









Rui F Ribeiro

35.2k1270113




35.2k1270113










asked Jan 24 at 9:22









Vlastimil

6,4011146119




6,4011146119











  • First check to see if de-fragmentation needs doing. ext file systems don't get as fragmented as fat or ntfs. About the only scenario that causes excessive fragmentation slowly appending to a file (and even this is reduced by ext. So if your partition is mostly log files, then it may fragment. To mitigate this, as part of log rotation, zip the older logs. This will, as well as saving space, de-frag the files.
    – ctrl-alt-delor
    Jan 24 at 10:14
















  • First check to see if de-fragmentation needs doing. ext file systems don't get as fragmented as fat or ntfs. About the only scenario that causes excessive fragmentation slowly appending to a file (and even this is reduced by ext. So if your partition is mostly log files, then it may fragment. To mitigate this, as part of log rotation, zip the older logs. This will, as well as saving space, de-frag the files.
    – ctrl-alt-delor
    Jan 24 at 10:14















First check to see if de-fragmentation needs doing. ext file systems don't get as fragmented as fat or ntfs. About the only scenario that causes excessive fragmentation slowly appending to a file (and even this is reduced by ext. So if your partition is mostly log files, then it may fragment. To mitigate this, as part of log rotation, zip the older logs. This will, as well as saving space, de-frag the files.
– ctrl-alt-delor
Jan 24 at 10:14




First check to see if de-fragmentation needs doing. ext file systems don't get as fragmented as fat or ntfs. About the only scenario that causes excessive fragmentation slowly appending to a file (and even this is reduced by ext. So if your partition is mostly log files, then it may fragment. To mitigate this, as part of log rotation, zip the older logs. This will, as well as saving space, de-frag the files.
– ctrl-alt-delor
Jan 24 at 10:14










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










I was a hair away from a solution:



sudo find / -type f -size -100M -exec e4defrag +





share|improve this answer






















  • So mark your answer as the correct solution.
    – wurtel
    Jan 24 at 9:52






  • 1




    @wurtel As you should know, I can do that after 2 days period passes.
    – Vlastimil
    Jan 24 at 9:53










  • you'll want to exclude at least /proc, /sys, and /dev from that. probably /tmp too.
    – cas
    Jan 25 at 0:47










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f419294%2fhow-to-defragment-files-in-size-less-than-100mb-only-in-ext4-filesystem%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










I was a hair away from a solution:



sudo find / -type f -size -100M -exec e4defrag +





share|improve this answer






















  • So mark your answer as the correct solution.
    – wurtel
    Jan 24 at 9:52






  • 1




    @wurtel As you should know, I can do that after 2 days period passes.
    – Vlastimil
    Jan 24 at 9:53










  • you'll want to exclude at least /proc, /sys, and /dev from that. probably /tmp too.
    – cas
    Jan 25 at 0:47














up vote
1
down vote



accepted










I was a hair away from a solution:



sudo find / -type f -size -100M -exec e4defrag +





share|improve this answer






















  • So mark your answer as the correct solution.
    – wurtel
    Jan 24 at 9:52






  • 1




    @wurtel As you should know, I can do that after 2 days period passes.
    – Vlastimil
    Jan 24 at 9:53










  • you'll want to exclude at least /proc, /sys, and /dev from that. probably /tmp too.
    – cas
    Jan 25 at 0:47












up vote
1
down vote



accepted







up vote
1
down vote



accepted






I was a hair away from a solution:



sudo find / -type f -size -100M -exec e4defrag +





share|improve this answer














I was a hair away from a solution:



sudo find / -type f -size -100M -exec e4defrag +






share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 12 at 9:52

























answered Jan 24 at 9:38









Vlastimil

6,4011146119




6,4011146119











  • So mark your answer as the correct solution.
    – wurtel
    Jan 24 at 9:52






  • 1




    @wurtel As you should know, I can do that after 2 days period passes.
    – Vlastimil
    Jan 24 at 9:53










  • you'll want to exclude at least /proc, /sys, and /dev from that. probably /tmp too.
    – cas
    Jan 25 at 0:47
















  • So mark your answer as the correct solution.
    – wurtel
    Jan 24 at 9:52






  • 1




    @wurtel As you should know, I can do that after 2 days period passes.
    – Vlastimil
    Jan 24 at 9:53










  • you'll want to exclude at least /proc, /sys, and /dev from that. probably /tmp too.
    – cas
    Jan 25 at 0:47















So mark your answer as the correct solution.
– wurtel
Jan 24 at 9:52




So mark your answer as the correct solution.
– wurtel
Jan 24 at 9:52




1




1




@wurtel As you should know, I can do that after 2 days period passes.
– Vlastimil
Jan 24 at 9:53




@wurtel As you should know, I can do that after 2 days period passes.
– Vlastimil
Jan 24 at 9:53












you'll want to exclude at least /proc, /sys, and /dev from that. probably /tmp too.
– cas
Jan 25 at 0:47




you'll want to exclude at least /proc, /sys, and /dev from that. probably /tmp too.
– cas
Jan 25 at 0:47












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f419294%2fhow-to-defragment-files-in-size-less-than-100mb-only-in-ext4-filesystem%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)