[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] Data integrity in nbd / using a LUKS-encrypted device



On Wed, May 17, 2017 at 10:25:51PM +0100, Wojciech Jablonski wrote:
> Dear nbd,
> Here's a question of mine I would be thankful to receive your answer to.
> 
> To what extent is data integrity ensured when using nbd? When writing data to a
> remote device, is data corruption possible in following scenarios:
> 1) power supply fails on client machine
> 2) network connection is lost/interrupted
> 3) above scenarios plus writing to a LUKS-encrypted device - is it possible/
> likely that the LUKS header could get damaged, or corruption will be limited to
> the file being written only.
> Thank you for any comments and have a good day.

If you have the fua and flush options enabled in the server, and a
not-ancient client which supports those options[1], this should be the
same thing as someone unplugging a USB device while it's being written
to.

That is, filesystems will occasionally send commands to the storage
layer saying "make sure these things have hit permanent storage, and
tell me when that's happened", before moving on to write other data, to
ensure data consistency at all times. The two above options allow NBD to
provide such guarantees to the client, too.

For more information, see "man 5 nbd-server".

[1] I don't recall which kernel version it was first implemented in, but
the spec at least is seven years old, so...

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12



Reply to: