From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eli Malul" Subject: FW: the mirror log is NOT kept on disk Date: Mon, 21 Mar 2011 15:10:12 +0200 Message-ID: Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4581467728260145647==" Return-path: Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: dm-devel@redhat.com List-Id: dm-devel.ids This is a multi-part message in MIME format. --===============4581467728260145647== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CBE7C9.50087275" This is a multi-part message in MIME format. ------_=_NextPart_001_01CBE7C9.50087275 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I just saw that clean_bits is being saved to the disk and is used to update sync_bits after crash/reboot (although the default behavior is to reset all the bits hence, resync is done for each resume). =20 But I still do not understand how should I create a mapped device with dmsetup tool which wouldl survive crash/reboot. =20 Can anyone help? =20 From: Eli Malul=20 Sent: Sunday, March 20, 2011 6:19 PM To: 'dm-devel@redhat.com' Subject: the mirror log is NOT kept on disk =20 Hi, =20 I tried a small test where I suspended and resumed a mirrored device without IO going on. My expectation was that the mirror set will not get re-synced but unfortunately it did. =20 According the documentation the mirror log is kept on disk when creating a mirror logical device with 'disk' log type as an input parameter. I looked at the code and I didn't see where the sync_bits are being written to the disk or read from the disk but only the number of regions is being saved. =20 How should a mirror device survive reboots/crashes without syncing the entire mirror set? =20 BTW - another problem is that after reboot the created logical device disappears, is there an easy way to keep it persistent or should I create at each boot? =20 ------_=_NextPart_001_01CBE7C9.50087275 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I just saw that clean_bits is being saved to the = disk and is used to update sync_bits after crash/reboot (although the = default behavior is to reset all the bits hence, resync is done for each = resume).

 

But I still do not understand how should I = create a mapped device with dmsetup tool which wouldl survive = crash/reboot.

 

Can anyone help?

 

From:= = Eli Malul
Sent: Sunday, March 20, 2011 6:19 PM
To: = 'dm-devel@redhat.com'
Subject: the mirror log is NOT kept on = disk

 

Hi,=

 

I tried a = small test where I suspended and resumed a mirrored device without IO = going on.

My = expectation was that the mirror set will not get re-synced but = unfortunately it did.

 

According the = documentation the mirror log is kept on disk when creating a mirror = logical device with 'disk' log type as an input = parameter.

I looked at = the code and I didn't see where the sync_bits are being written to the = disk or read from the disk but only the number of regions is being = saved.

 

How should a = mirror device survive reboots/crashes without syncing the entire mirror = set?

 

BTW – = another problem is that after reboot the created logical device = disappears, is there an easy way to keep it persistent or should I = create at each boot?

 

------_=_NextPart_001_01CBE7C9.50087275-- --===============4581467728260145647== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============4581467728260145647==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Milan Broz Subject: Re: FW: the mirror log is NOT kept on disk Date: Mon, 21 Mar 2011 14:26:40 +0100 Message-ID: <4D875210.7010501@redhat.com> References: Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: device-mapper development List-Id: dm-devel.ids On 03/21/2011 02:10 PM, Eli Malul wrote: > But I still do not understand how should I create a mapped device > with dmsetup tool which wouldl survive crash/reboot. You cannot do that without implementing persistent metadata handling yourself. Use LVM here. dmsetup is simple wrapper to DM-ioctl, low level utility. LVM is based on top of that and solves all the problems with persistent metadata you just found. Milan