Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Red Hat LVM BCV Scripts

Posted on 2009-05-15
8
Medium Priority
?
1,680 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
ID: 24394613
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
ID: 24394876
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
ID: 24395311
@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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24395358
So these commands are not RedHat specific. They are rather specific to the BCV solution you are using.
0
 

Author Comment

by:douggnau
ID: 24395649
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
ID: 24396959
:) 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
ID: 24397758
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 1500 total points
ID: 24407735
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

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Concerto Cloud Services, a provider of fully managed private, public and hybrid cloud solutions, announced today it was named to the 20 Coolest Cloud Infrastructure Vendors Of The 2017 Cloud  (http://www.concertocloud.com/about/in-the-news/2017/02/0…
A look at what happened in the Verizon cloud breach.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

916 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