6 ms·
How's zdb different from fsck? Nobody cares whether the tool is called fsck, scrub or zdb. You just need to have a tool which can recover from corruption. And f
by wereHamster 14y ago
How's zdb different from fsck? Nobody cares whether the tool is called fsck, scrub or zdb. You just need to have a tool which can recover from corruption. And for very long the ZFS developers didn't think the end-users needed it. Maybe zdb was there all the time. But it wasn't advertised or documented. People were told their filesystem is FUBAR when it wasn't.
- glabifrons 14y ago"How's zdb different from fsck?" That's answered very well in the article connected to this other currently active HN discussion: https://news.ycombinator.com/item?id=5460988 https://news.ycombinator.com/item?id=5460988 In short, fsck simply checks to see that the metadata makes sense, and that all inodes belong to files, and that all files belong to directories, and if it finds any that don't, it attaches them to a file with a number for a name in lost+found. It's pretty crude compared to a filesystem debugger. If you want to compare apples-to-apples, you'd be better off asking how zdb compares to debugfs (for ext2/3/4) as both are filesystem debuggers. You could also ask "How's zfs scrub different from fsck?" and the answer to that would be: zfs scrub checks every bit of data and metadata against saved checksums to ensure integrity of everything on-disk. In comparison, fsck cannot detect data corruption at all, and can only detect metadata corruption when an inode points to an illegal disk region (for example). Even that comparison shows fsck is crude when compared to scrub. The tool to recover from corruption is a rollback: usage: clear [-nF] <pool> [device]