From: Milan Broz <mbroz@redhat.com>
To: octane indice <octane@alinto.com>
Cc: dm-crypt <dm-crypt@saout.de>
Subject: Re: [dm-crypt] What happen if hard drive has a read error?
Date: Thu, 07 Oct 2010 23:29:02 +0200 [thread overview]
Message-ID: <4CAE3B9E.3060604@redhat.com> (raw)
In-Reply-To: <1286482810.4cae2b7ae099c@www.inmano.com>
On 10/07/2010 10:20 PM, octane indice wrote:
> It's just a theorical question. I encrypted some data with dm-crypt on an
> hard drive.
> But what happens if the hard drive has an error? Not a kind of a big error
> which cause the hard drive hangs, but just a small error that make the
> system doesn't read the bytes all right?
>
> Obviously, dm-crypt won't decrypt the data. But what happens next?
Basically the same like if you have IO error on plain disk - the IO operation
returns IO error. Upper layer decides what to do next.
If it is in LUKS keyslot or header, you will not be able to access data at all.
If it is somewhere on data area, you lost just these bad sectors. Every sector
is encrypted separately (e.g. using cbc with per-sector IV).
But note that errors on encrypted disks (in general) causes more visible
problems.
> -dm-crypt will panic() the kernel
Nope. But underlying hw driver can lockup the system - but not dmcrypt itself.
> -Only a block won't be decrypted, so it means that at best, only a file is
> corrupted, and at worst all of the filesystem is trashed, depending the
> location of the error?
yes
> -Or everything beyond the point of the read error will be trash?
> -Or it depends of the crypto layer choosen as CBC, or else?
no, see above. CBC is used inside 512 byte sector
(e.g. CBC block size is 16 bytes), sectors are encrypted independently,
with different IV.
> That's just a theorical question, thank you
No, it is not theoretical question:-) HW fails are still quite common...
Even with modern SSD drives.
Milan
next prev parent reply other threads:[~2010-10-07 21:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-07 20:20 [dm-crypt] What happen if hard drive has a read error? octane indice
2010-10-07 21:29 ` Milan Broz [this message]
2010-10-07 23:16 ` Arno Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CAE3B9E.3060604@redhat.com \
--to=mbroz@redhat.com \
--cc=dm-crypt@saout.de \
--cc=octane@alinto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.