Solved

Red Hat LVM BCV Scripts

Posted on 2009-05-15
8
1,595 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …

839 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