Score:1

How do you Defrag an XFS file system

ar flag

My old workstation, has /var /usr and /home mounted on an xfs file system, and it seems to spend most of its time grinding away, and getting slower and slower, much like windows used to 20 years ago, when it was heavily fragmented.

So how do I check the fragmentation status of XFS disks, and how do I fix it when I identify it.

I assume there is some magic, which prevents the old FAT type mess, but clearly something is going on, and it isn't a full disk.

As an aside my root partition is ext4, which I read somewhere can't get fragmented or fixes itself if it does. How do I check that too, and encourage it if needs be.

sibaz avatar
ar flag
I've found xfs_fsr which seems to do something, but if someone could explain whats going on, and why it works on a mounted disk etc, I'd appreciate it. Still no clue about ext4 equivalence though
jm flag
The description and notes in the [man](https://linux.die.net/man/8/xfs_fsr) page are farily explicit. What don't you understand on the process? It explicitly does not work on files mapped in memory so why shouldn't it work on a mounted file system? [e4defrag](https://man7.org/linux/man-pages/man8/e4defrag.8.html) is available for ext4 file systems.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.