Defragmenting on Linux
Posted: 30 Nov 2015, 18:53
Yes I know: You don't have to defrag Linux. Mostly mechanisms are built in to take care of it so it will never be absolutely necessary. That does not mean that Linux does not get slightly fragmented though.
It is possible to defrag Linux with Exr2 Ext3 and Ext4 systems though.
To check your filesystems you can do a:
You may not have to unmount the partition for this so you could try it directly in your terminal.
To repair filesystems you need to unmount the partition so our Rescue System comes in handy.
Fire up Systemrescuecd and do a If the answer is /dev/sda1 then you can check your fragmentation with:
It will probably be clean and come up with no fragmentation.
But if this reports fragmentation you can repair it with:
After that your read write process might be faster.
Again: this works for Ext2 3 and 4 and should not be used on anything other than traditional HDD's - never on SSD.
This is for fine tuning pros - you never actually need to do this I was just bored: so I though I'd write down a tip
It is possible to defrag Linux with Exr2 Ext3 and Ext4 systems though.
To check your filesystems you can do a:
Code: Select all
df -T
You may not have to unmount the partition for this so you could try it directly in your terminal.
Code: Select all
e4defrag /home/viking
To repair filesystems you need to unmount the partition so our Rescue System comes in handy.
Fire up Systemrescuecd and do a
Code: Select all
fdisk -l
Code: Select all
e2fsck -fn /dev/sda1
It will probably be clean and come up with no fragmentation.
But if this reports fragmentation you can repair it with:
Code: Select all
e2fsck -p /dev/sda1
After that your read write process might be faster.
Again: this works for Ext2 3 and 4 and should not be used on anything other than traditional HDD's - never on SSD.
This is for fine tuning pros - you never actually need to do this I was just bored: so I though I'd write down a tip