Red Hat LVM BCV Scripts

Does anyone have RH Linux bcv split/sync scripts that work with LVM ?
douggnauAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Kerem ERSOYConnect With a Mentor PresidentCommented:
In fact before anything you need to issue vgexport  <vgname> so that names are recorded to your volume.

> 1. bcv split comand to split the bcv from the mounted lun (done on the original system)
This has nothing to do with LVM commands. It should be supplied by the Vendor.

> 1. lun_scan.sh - scans in new luns without having to reboot (like a pvscan, done on the alternate
> system).
This is also dependent of the HBA hardware you're using and should be supplied by the driver provider.

> 2. vgchange -an <vgname> (this is for ensuring that the imported vg you will be importing is not
> mounted)
This is a LVM command. issued like that :
vgchange -a -y <vgname>

> 3. vgimport <vgname> (if you have a volume group created with that bcv)
Same as above:
vgimport /dev/<volume_name> /dev/<diskname>   (such as sda2, hda2 ... )
> 4. vgchange -ay <vgname> (this is to activate the volume group>
Same as above:
vgchange -ay vgname

> 5. mount -a (this will mount all volumes if it is in the fstab)
Obviously linux command.

> 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
umount /dev/<vgname>
> 2. vgchange -an <vgname> (this is to deactivate the volume group)
vgchange -an <vgname>

> 3. vgexport <vgname>
vgexport <vgname>

> 4. sync the bcv(s) to the original LUN(s)
To be provided by BC volume provider.

Congratulations here's our script :). As you see you still need some parts from the BC v SAN provider and some from the HBA provider. Apart from them LVM comands are just commands with no or only one parameter. If you put them back to back in a script then it will be a script. There are no so much of ready made scripts in that it would be HW vendor dependent and there's not much to automate.

I have never seen such scripts for not only  linux but also AIX or HP-UX.
0
 
Kerem ERSOYPresidentCommented:
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.
0
 
douggnauAuthor Commented:
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.
0
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

 
Kerem ERSOYPresidentCommented:
@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.
0
 
Kerem ERSOYPresidentCommented:
So these commands are not RedHat specific. They are rather specific to the BCV solution you are using.
0
 
douggnauAuthor Commented:
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.
0
 
Kerem ERSOYPresidentCommented:
:) 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!!!
0
 
douggnauAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.