Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I read that when mirroring a logical volume a log of some sort is used to keep the files in sync. You can either set it so this log is in a separate physical volume or in memory. I also read that if the log is in memory, the system has to resync the volumes.

Is there a performance hit for using the log in memory? For example, does it take much longer to boot the machine? Is the data at risk while the resync is happening?

I'm working with Ubuntu 10.04 in this case. I believe it's lvm2. The clearest documentation I've found is the CentOS document here. I was also looking at this description.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Can you add the links you are referring to? Because just mirroring does not need a log. A log (on the same or extra device) is usually involved when you use a journaling filesystem - if you use mirroring or not on the layer below (i.e. the blocklayer).

Update: Ok, with the links things are clearer now. The LVM mirroring seems to be quite different from the linux md (RAID 1) mirroring.

To quote from the lvcreate man page:

Specifying the optional argument "--corelog" will create a mirror with an in-memory log verses a disk-based (persistent) log. While this removes the need for an extra log device and may be slightly faster, it requires that the entire mirror be resynchronized upon each instantiation (e.g. a reboot).

Thus, with a memory based log you get a significant performance hit at startup and a performance hit, when the log physical volume is on the same hardware disk.

Googling around, mirroring using Linux mdadm seems to be the better approach ATM. (You can use the md device as physical device for some lvm setup.)

First, it does not need an extra log (and does not do an expensinve resync at every startup).

Second, lvm mirrors does not seem to support parallel reading, i.e. md mirrors should have better read performance:

http://serverfault.com/questions/97845/lvm-mirroring-vs-raid1

http://serverfault.com/questions/126851/linux-lvm-mirror-vs-md-mirror

share|improve this answer
    
I've added links above. I plan to use ext4 but I thought I had to set that up after I mirrored the volumes. –  Jay Sheridan Jan 24 '11 at 13:14
    
@Jay Sheridan: updated answer –  maxschlepzig Jan 24 '11 at 20:24
    
Even mirroring needs a log (in some form) to handle sudden failures (where one of the devices has written the data and not the other). See this answer for a few pointers to how mdadm does it; I don't know what LVM uses. –  Gilles Jan 24 '11 at 21:13
    
Good links. They have some good info on what an lvm mirror is typically used for. I'll look into how to use mdadm. –  Jay Sheridan Jan 24 '11 at 23:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.