From my understanding defragmenting files is not really needed in Linux, but out of curiosity was googling on this subject and found these commands and was playing around with them. Filefrag tells you how fragmented a file is and e2frag will defragment it.
Just tested it out on an old VM file. I found that I get the Bad magic number error if I try it. Now I'm not really worried about actually doing a defrag, I more or less just wanted to play around with it, but that bad magic number error seems kind of alarming. Is this something I should worry about?
This is a md raid volume, so could it be why I'm getting that error? It's probably expecting there to be a partition, but the FS is formatted directly on the md device.
In similar thought, is there a way to run a fsck live? I imagine I probably should do that now and then but this is a server I can't take offline.
Code:
[root@isengard windows7.del]# filefrag windows7-disk1.vdi
windows7-disk1.vdi: 1143 extents found
[root@isengard windows7.del]#
[root@isengard windows7.del]#
[root@isengard windows7.del]# e2freefrag windows7-disk1.vdi
windows7-disk1.vdi: Bad magic number in super-block while opening filesystem
[root@isengard windows7.del]#
Just tested it out on an old VM file. I found that I get the Bad magic number error if I try it. Now I'm not really worried about actually doing a defrag, I more or less just wanted to play around with it, but that bad magic number error seems kind of alarming. Is this something I should worry about?
This is a md raid volume, so could it be why I'm getting that error? It's probably expecting there to be a partition, but the FS is formatted directly on the md device.
In similar thought, is there a way to run a fsck live? I imagine I probably should do that now and then but this is a server I can't take offline.