Link to home
Start Free TrialLog in
Avatar of douggnau
douggnau

asked on

Red Hat LVM BCV Scripts

Does anyone have RH Linux bcv split/sync scripts that work with LVM ?
Avatar of Kerem ERSOY
Kerem ERSOY

Hi,

In fact there's no spscific scripts for that. This type of operation is in fact:
- Splitting a volume from a mirrored RAID volume
- Backing it up
- Then joining it in logical volume.

LVM wil handle it in that:
To split a physical volume form LVM issue the command:
mdadm /dev/md0 --fail /dev/sdc2 --remove /dev/sdc2

You can then backup the volume using a backup solution or even with volume backup software.
Then you can rejoin the volume into LVM:
mdadm /dev/md0 --add /dev/sdc2

What is your plan about it ? Does your backup software allow for snapshotting ?

Cheers,
K.
Avatar of douggnau

ASKER

Snapshots are about the worst way to do backups with (thou it may be the quickest). A snapshot just puts pointers on the disk (instead of data) and when the backup is running, it references those pointers and hit the production disk to get the actual data. This causes way to many performance issues. Second of all, we do not do RAIDing on a system level. We accomplish that on the back end with a storage array. I just need a sample script with the LVM commands that will check the check the VG, split the BCV, vgchange the bcv, vgimport the vg and mount the vg.
@douggnau:
> Second of all, we do not do RAIDing on a system level. We accomplish that on the back end with a  
> storage array. I just need a sample script with the LVM commands that will check the check the VG, split > the BCV,

Since the LVM here is not involved in the volume RAID process RedHAT LVM is just thinking your BCV as a physical volume. Furthermore the term LVM here is not the same as you have under HP/UX. So you have already answered your question. You don't do these operations on the Linux LVM level. You can only do that on extra programs that comes with BCV solution. Every BCV solution has a different command interface to do these. Like vx.. prefixec Veritas commands etc.

Cheers,
K.
So these commands are not RedHat specific. They are rather specific to the BCV solution you are using.
If you are moving teh BCV to another system you will have to scan for the lun, ensure the vg is not active, import the vg and activate the vg. Those are all Red Hat comands. I just wanted to make sure that I had everything covered and all the comands were going to work the first time out.
:) Though they are all Linux commands as you might have noticed they are the default commands to manage a LVM volume whether you add a common disk or your VG. Linux sees this drive as an ordinary physical storage. So Linux has no idea that you're using a BCV storage thus whether you have splitting it or syncing. These are all transparent to Linux (as a matter of fact to any OS). If you want this functionality You'll need binaries suppoerted on your current version to perform these low level operations from your vendor. Linux has no idea that your volumes have such a capability!!!
Let's speak about Linux LVM commands. When you split the bcv from one system and want to mount it to another Linux server, you would do the following (correct me if I am wrong):
1. bcv split comand to split the bcv from the mounted lun (done on the original system)
1. lun_scan.sh - scans in new luns without having to reboot (like a pvscan, done on the alternate system).
2. vgchange -an <vgname> (this is for ensuring that the imported vg you will be importing is not mounted)
3. vgimport <vgname> (if you have a volume group created with that bcv)
4. vgchange -ay <vgname> (this is to activate the volume group>
5. mount -a (this will mount all volumes if it is in the fstab)

Then, when you want to return the LUN back to the original system, you would do the following:
1. umount the file systems that are associated with that VG/LUN
2. vgchange -an <vgname> (this is to deactivate the volume group)
3. vgexport <vgname>
4. sync the bcv(s) to the original LUN(s)

If, I am wrong, please indicate where I may be wrong at.
ASKER CERTIFIED SOLUTION
Avatar of Kerem ERSOY
Kerem ERSOY

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial