Solved

Red Hat LVM BCV Scripts

Posted on 2009-05-15
8
1,556 Views
Last Modified: 2013-12-16
Does anyone have RH Linux bcv split/sync scripts that work with LVM ?
0
Comment
Question by:douggnau
  • 5
  • 3
8 Comments
 
LVL 30

Expert Comment

by:Kerem ERSOY
Comment Utility
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
 

Author Comment

by:douggnau
Comment Utility
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
 
LVL 30

Expert Comment

by:Kerem ERSOY
Comment Utility
@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
 
LVL 30

Expert Comment

by:Kerem ERSOY
Comment Utility
So these commands are not RedHat specific. They are rather specific to the BCV solution you are using.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:douggnau
Comment Utility
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
 
LVL 30

Expert Comment

by:Kerem ERSOY
Comment Utility
:) 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
 

Author Comment

by:douggnau
Comment Utility
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
 
LVL 30

Accepted Solution

by:
Kerem ERSOY earned 500 total points
Comment Utility
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
AWS Glacier is Amazons cheapest storage option and is their answer to a ‘Cold’ storage service.  Customers primarily use this service for archival purposes and storage of infrastructure backups.  Its unlimited storage potential and low storage cost …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now