5 ms·
Users can defragment files (copying files to a new location) automatically by running something like pyfragtools: http://ubuntuforums.org/showthread.php?t=1695
by yoasif_ 14y ago
Users can defragment files (copying files to a new location) automatically by running something like pyfragtools:
http://ubuntuforums.org/showthread.php?t=169551 http://ubuntuforums.org/showthread.php?t=169551
Other filesystems like ZFS and btrfs utilize copy-on-write to virtually eliminate file fragmentation -- files are copied whenever edits are made to the file.
- wch 14y agoMy understanding is that COW filesystems have really bad fragmentation if you're changing portions of large files -- for example, with virtual machine disk images.
- wch 14y agoActually, I just discovered that on btrfs, you can disable COW on a volume, or even on individual files. To do it on a per-file basis, you have to compile a small program available here: http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg14877.html http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg1... This makes btrfs suitable for virtual machine images.
- drostie 14y agoMaybe ZFS/btrfs users don't care, but I would be really hesitant before using a filesystem which does not respect the Unix `shred` tool. Like real paper-shredders, I don't use them very much but when I do use them I really hope that they work.
- icebraining 14y agoWhy doesn't shred work on ZFS/Btrfs?
- barrkel 14y agoZFS is copy-on-write with snapshot support. If you have files you may need to shred, put them on a different file system; ZFS is oriented towards making it hard to lose data.
- drostie 14y agoThey just said copy-on-write. I'm not entirely sure about the exact interplay between shred and btrfs, but shred nominally just writes random data to the file that was already there -- if you copy-on-write that, then you are just copying random data to a different part of the filesystem, not overwriting what's already there. You could solve this by automatically shredding deleted stuff in the background, but it would probably kill SSDs and other storage devices which you don't want to write to too often.
- dap 14y agoI don't know how shred works, but based on what you said, it assumes knowledge of how the underlying filesystem works. If there's fault to be had (and there probably isn't), it's not ZFS's. You really consider being able to shred individual files a critical filesystem feature? Over, say, not having to configure static partition sizes, having snapshots, or being completely immune by design to large classes of data corruption (including all those that require an fsck-like tool to repair)?
- mitchty 14y agoIts not just zfs/btrfs, ext3/4 has the same cow behavior when data=journal (not default but to note) And if you're on an ssd its likely doing wear leveling in a similar fashion. Really the better way to do this than overwriting files in place is to have encrypted files and keys and just reencrypt with a random key you don't retain, or some other method I suppose. But the ability to rewrite to the same spot in the filesystem, for a copy on write filesystem, is rather ludicrous. Hesitate all you want, I prefer cow fs's for most tasks.
- tedunangst 14y agoBad news: in theory, utilities like that haven't ever worked since bad block remapping was added ages ago. And it's absolutely useless on an SSD.