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:
https://serverfault.com/questions/97845/lvm-mirroring-vs-raid1
https://serverfault.com/questions/126851/linux-lvm-mirror-vs-md-mirror
See this SF question/answer: https://serverfault.com/questions/306419/is-the-fdisk-partition-type-important-when-using-lvm
Excerpt of answer from above question
LVM does not look at the partition table at all - it doesn't even know it actually exist. So you can set whatever "partition type" value you want there and it won't change anything as far as LVM is concerned.
LVM uses regular expressions in its config file to know what block devices to check for physical volumes, see the filter
keyword in lvm.conf(5)
.
Some other tools do look at partition types, the linux kernel itself being the first example:
- partition type 0x05, "Extended", tells the kernel to go look for an Extended Boot Record in the given partition, to find so called "logical partitions"
- partition type 0xfd, "Linux RAID", tells the md driver in the kernel to try to autostart that raid volume, if it finds a suitable superblock in the given partition
Good resource for LVM related questions: http://ds9a.nl/lvm-howto/HOWTO//cvs/lvm-howto/lvm-howto.html
Best Answer
That depends on whether the filesystem can be extended online. Most major Linux filesystems can be extended while they are mounted (btrfs, ext2, ext3, ext4, xfs, zfs) — the main exception is reiserfs. If you want to extend one of these filesystems on an LVM volume, you can extend the volume with
lvextend
, then extend the filesystem to fill the enlarged volume, all without deactivating or unmounting anything.If you're shrinking the volume, there are fewer filesystems that don't require mounting: only btrfs and zfs can be shrunk online. Shrink the filesystem, then call
lvreduce
to bring the logical volume size down to the size of the filesystem.