Mirroring in LVM
I have got a book "RHEL 5 Administration Unleashed By Tammy Fox".
The author describes "Taking a Snapshot of a Logical Volume". I was once asked in an interview: "How do we do mirroring of an Logical Volume?", and I was not sure of it. Is Mirroring of an LV is the same thing as Taking a Snapshot of it? If not, then, how to? |
Normally "mirroring" would refer to setting up a RAID 1 either through software or hardware, normally with interview questions I'd ask for a clarification as to whether they mean raid mirror or some kind of time based snapshot. If it's a time-based snapshot to a different/remote volume you could look at DIRVISH as an option.
|
Quote:
|
Quote:
|
I created a Logical Volume "/dev/myVolGrp00/scripts" and wrote some files in the mount point "/scripts" and created another snapshot LV "/dev/myVolGrp00/scripts-snapshot" for it and added some more files but I see nothing in the snapshot "":
Code:
[root@localhost ~]# lvdisplay Code:
[root@localhost ~]# mke2fs -t ext4 /dev/myVolGrp00/scripts-snapshot Code:
Note: I created the snapshot in this way: Code:
[root@localhost ~]# lvcreate --size 4M -s --name scripts-snapshot /dev/myVolGrp00/scripts |
I see the same files in the snapshot now:
Code:
[root@localhost ~]# ls -l /snap-scripts/ |
Hi.
Mirroring and snapshots are two different features. With LVM, one can set up mirrors: Code:
-m, --mirrors Mirrors For the snapshot: Quote:
I use snapshots indirectly by telling rsnapshot to use snapshots for data on LVM volumes. It creates the snapshot for the duration of the backup, then removes it. Best wishes ... makyo |
Quote:
Makyo: Thanks for the command option! Rated you for your contribution to the post and for adding interesting stuffs as well. Have a nice time! |
All times are GMT -5. The time now is 09:13 PM. |