I want to test if physical errors of the disk, of it that is not possible, file system errors of the disk. The disk is a typical USB external drive. The disk (not by partition-level, but the whole disk itself) is encrypted using VeraCrypt. The partition I stored the files is using Btrfs. What is the way?
Here are the things I have tried on my own:
First, the web search result said badblocks
but other result said that it is an obsolete tool now. And when I ran it, it asked for read-only something, and that made me think that it may destruct existing files, so I cancelled it.
Then, I tried to use the "Check filesystem" context menu on the volume of the VeraCrypt. But it showed an "fsck" window saying "If you wish to check the consistency of a BTRFS filesystem or repair a damaged filesystem, see btrfs(8) subcommand 'check'" and exited.
I opened a Terminal and tried to execute btrfs check
but "sudo btrfs check (the device name)" failed with "no valid btrfs found on /dev/sdd" (probably because the whole disk is encrypted") and "sudo btrfs check (the decrypted directory)" failed with "not a regular file or block device".
PS: Thanks to the accepted answer, I got the correct device name. I am adding the following for future people who encounter the same problem. The comment I used was sudo btrfs --force --check-data-csum -p /dev/mapper/veracrypt1
. I added --check-data-csum
, because without it, it only checked the disk for the metadata checksum, not the actual files, so I had to run the test again (doing all the previous checks again). -p
seems to be a nice option because it displays how many items have been checked so far.