[DRBD-user] Snapshot with DRBD

drbd at bobich.net drbd at bobich.net
Thu Feb 14 12:40:15 CET 2008

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Thu, 14 Feb 2008, Azeez Ahamed wrote:

> I was looking for snapshot feature in DRBD. Did some search on DRBD site 
> and mailing list. I found some information 
> here http://thread.gmane.org/gmane.comp.linux.drbd/6175Here, it tells 
> LVM2 can be used for creating snapshots.

If you are mirror-mounting it as primary-primary, you'll need to use CLVM 
instead of LVM, but yes, essentially that is as good as it gets.

> But, the issue here is "short 
> downtime" because we need to shutdown all the services before taking the 
> snapshot. Is there any approach where we need not have to shutdown 
> services during snapshot?

No such thing exists, for DRBD or any other block device. It is not 
achievable. Snapshots on LVM are the exact same thing as snapshots on 
expensive SANs, and all they can do is give you a snapshot of the current 
state of the block device. All the files that are open and being written 
to will end up being inconsistent. The consistency will be similar to 
power-cycling the machine in the middle of what it's doing. The FS 
journals can keep the file system free of corruption, but that doesn't 
mean the files will be in a consistent state. e.g. your MySQL index and 
data files will end up out of sync and you will need to repair the tables 
before you can use them.

The basic problem is that there is no way to force all applications to 
commit all their writes to a consistent state at the same time so you can 
take a snapshot.

And don't believe SAN vendors who tell you that snapshots are backups, 
either, because of the same issue. With a SAN you have an even bigger 
problem because the files (and potentially the file system itself) will be 
even more inconsistent due to potentially large amounts of data in the 
cache on the client machine that will not have hit the SAN yet.

> Is there any development done in this area? If 
> so, please let me know.

Unfortunately, no. It isn't a DRBD speciffic problem.

What application are you trying to get backups of? There is probably a 
reasonable way to do it without downtime if you have mirrored servers.

Gordan



More information about the drbd-user mailing list