So.. if there is a bad block on the HDD, what can survive better?

  1. not using FDE (full disc encryption)

  2. using FDE - since the whole disk has "1 partition" - the encrypted one, isn't it more likely to loose all data if there is a HDD error, ex.: bad block?


No, I mean yes, I mean... a little bit of both.

If a block is bad, the data of that block is gone. Whether the block contained encrypted data or not, is not relevant at that point. It doesn't make a difference.

Of course there are special cases. If your encryption has a metadata header, such as LUKS does, and the bad block happens to be one that holds your encryption key, then that single bad block can render the entire disk unreadable and the entire data lost. If the machine is still running and has the container open, don't reboot without writing down the key first... (e.g. dmsetup table --showkeys).

But the same can happen to you in an unencrypted scenario. If critical filesystem metadata goes bad, your files are probably gone. And rescue tools like PhotoRec that try to make sense of remaining clear text data may not be able to yield satisfactory results (depending on whether you stored files in a known format, fragmentation and other things).

In the end no matter what you do, you always need backups. After all, a HDD may just as well die completely rather than have just a bad block here and there.

|improve this answer|||||

The short answer is: using full disk encryption or not should not have any impact on the risk of losing data due to a storage error.

Here's why: the encryption methods normally used for full disk encryption don't use traditional block chaining (as this would be completely impractical from a performance point of view), but rather other methods for preventing same-plaintext blocks from showing up as same-ciphertext blocks on disk. I believe that a commonly used method is to encrypt blocks of data using a block index as the IV; it's known, so it doesn't need to be stored anywhere, but it is also different from one block to the next, so the same plaintext will result in vastly different ciphertexts when stored in different locations on the disk.

This, however, is all transparent to the file system. The file system code will write some data somewhere and it gets passed through the encryption methods before being committed to physical storage. All the file system knows is that it is writing data to somewhere. At some later point, it will read data back, and the blocks are passed through the decryption methods before being passed on to the file system code.

The most data you will lose from a single incorrectly read (or unreadable) block of physical storage under a scheme like this is however much the encryption algorithm's amplification properties will expand the read error into.

At that point, it comes down to the relative prevalence of outright I/O errors versus silent corruption (where data read back is not what was originally intended to be written, which can happen for any number of reasons), and the data block sizes involved. Reported I/O errors are no different with or without FDE, and silent corruption will instead of corrupting only a part of the block likely corrupt an entire block of data.

The major exception to this is that which is brought up by frostschutz, namely (and mainly) encryption-related metadata. If that is damaged or unreadable, you are going to have problems accessing your data. But the same could be said without encryption; with or without full disk encryption, if vital portions of the drive cannot be accessed, then you won't be able to access your data. It could be argued that the consequences when one is using FDE are more severe, though.

If you care about the data, with or without full disk encryption you'll have a solid backup regime. If you are really concerned about the data, you'll have online redundancy (e.g. RAID mirroring, or striping with redundancy), at which point the whole issue is moot: either the disk returns valid data, or the error is corrected before the OS sees the data. If you don't care about the data, then go ahead and work without backups; but data loss (barring outright software bugs in the FDE code) would still have happened with or without encryption.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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