[linux-lvm] So LVM mirroring is synchronous or asynchronous....?

Justin Lee justinlee5455 at gmail.com
Thu Nov 14 09:15:14 UTC 2013


Hello,

I'm confused, the more I google, the more conflicting information I get

*** In this discussion
<http://serverfault.com/questions/76417/lazy-disk-backup-for-a-ramdisk-on-linux>
says its asynchronous:

">    I want something like a write cache that drains only when the
>    system isn't busy.
>
>    For a particular build I'm doing often, I would like to keep build
>    output in a ramdisk that eventually gets written out to disk. It
>    would be nice if the ramdisk was synced out to disk when the
>    system wasn't busy.

you might be able to get away with using an LVM mirror to complete this process.

1. Make the ramdisk a member of a volume group with a physical drive.
2. Mirror the ramdisk to your hard drive. Note that LVM mirrors are
direction-specific, i.e. data flows from one PV to another
unidirectionally.
3. Mount the LVM volume somewhere as a unified filesystem.

Data are written to the LVM-based ramdisk. Unlike a RAID-1 where the
writes are synchronous and parallel (both drives write out at once),
an LVM mirror is asynchronous and sequential (the primary drive
receives the write, then LVM pushes the write to the mirror)."

*** this link <http://osdir.com/ml/linux-lvm/2009-07/msg00092.html>
says its synchronous:

">    Hi,
>    I have a few questions concerning LVM mirror implementation, and I
>    couldn't find any suitable design doc
>    I need to setup a dual site ( a few miles between the 2 sites, around 1 ms
>    RTD) mirror based cluster system.

You need asynchronous mirroring (remote replication module).

>    - *what is the default behaviour of the mirroring, writing in parallel to
>    both mirror legs or serialized ?

It writes in parallel.

>    - for write requests, is the ack returned to the application
>    when the 2 legs are updated or only when the first is updated ?

When two are updated. (you need 'remote replication' module for the
latter behaviour) I couldn't find suitable doc about this, and in fact
that's the behaviour I'm expecting (acking only when the 2 legs are up
to date) . "

Any idea??

Justin




More information about the linux-lvm mailing list