Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Can NTFS partitions be defragged within Linux? Does fsck work for this? (Here and there I've seen a recommendation to use fsck -t ntfs --kerneldefrag /dev/XXX. Would this work?)

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

there is no such tool for linux.
you have to boot windows for that.

share|improve this answer
    
Thanks. That's what I was afraid of. –  BeSlayed May 29 '11 at 16:54
1  
Where does the recommendation about using fsck come from, I wonder. –  BeSlayed May 29 '11 at 16:55
2  
@BeSlayed an idiot or a jokester? –  psusi May 30 '11 at 15:12
    
The answer is at least imprecise. True, there is probably no such tool that does this at low level, but defragmentation can be performed at higher level to a mounted filesystem (probably any). –  rozcietrzewiacz Aug 5 '11 at 11:47
    
Mighty google says Ultra Defrag is being ported: b.andre.pagesperso-orange.fr/advanced-ntfs-3g.html –  con-f-use Feb 3 '13 at 10:37
add comment

There is a universal tool that can do defragmentation on linux called shake. You can download the source, or for Ubuntu users there's a PPA (the shake package in the official repository is unrelated).

I've just tested it on an NTFS filesystem mounted using ntfs-3g and it seemed to work without problems (no errors, the verbose output looks typical). So probably is filesystem-independent... Almost, since it can make use of extended attributes. To work without making use of those, you should use the -X option. Try using

shake --old=0 -v -X /some/directory/

From my experience, it has to be run as root.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.