Tag Archives: VG

RHEL 5.5: how to remove a clustered VG?

By peppeunz

Hi all,

I have a 2 node rhel 5.5 cluster (2 server and 1 quorum disk).
I created 2 cluster resources using Luci web console, they are 2 Volume Groups.

I want to remove that cluster and shutdown node 2, but I don’t want to loose data on Volume Groups clustered.

How can I remove that cluster and mount volume Groups (now managed by Luci) without loosing data?

Thanks and regards

From: http://www.unix.com/red-hat/221109-rhel-5-5-how-remove-clustered-vg.html

Script Checking LVM Mirror not Working

By fede_mont

Hi,

I need to know who can I create an script in order to check server mirror in AIX. I got this script

Code:

!/usr/bin/ksh
#
# Check if a VG is mirrored.
#
# lsattr -El -a strictness -a copies
# If copies=2 and scrictness=y, then VG is mirrored
#
# LVs are retrieved via 'lsvg -l |grep -v :|grep -v LPs|awk {'print $1'}
#
# Return codes:
#
# 0 VG is mirrored
# 1 Some LVs are not mirrored
# 2 All LVs in VG are not mirrored
# 3 No VG name(s) supplied
# 4 One or more invalid VG specified
# 5-? Other error found
#
if [ "$#" -eq "0" ] ; then
echo "Please specify one or more volume group names"
exit 3
fi
#
VGs=$@
for VG in $VGs ; do
RCforVG=0
if [ ! -e /dev/${VG} ] ; then
RCforVG=4
continue
fi
LVCount=0
MLVCount=0
for LV in getlvodm -L $VG | awk '{print $1}' ; do
LVCount=expr $LVCount + 1
Strict=lsattr -El $LV -a strictness|awk '{print $2}'
Copies=lsattr -El $LV -a copies|awk '{print $2}'
if [ "$Strict" = "y" -a "$Copies" -eq "2" ] ; then
MLVCount=expr $MLVCount + 1
else
:
fi
if [ "$MLVCount" -eq "0" ] ; then
RCforVG=2
fi
if [ "$MLVCount" -gt "0" -a "$MLVCount" -ne "$LVCount" ] ; then
RCforVG=1
fi
done
echo "Result code for $VG: $RCforVG"
done


This do not work ¿can someone give me a hand on this?

Moderator’s Comments:
edit by bakunin: First of all, please use CODE-tags. It is mentioned in the rules, the FAQ, editor mask for new postings and we really, definitely, positively MEAN IT. Second, please do not use others threads to post your …read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Norwegian police arrest man for Parliament threat

Police in Norway say they have arrested a man after a bomb threat against Parliament put officers on high alert and shut down streets in central Oslo for several hours.

Oslo Deputy Police Chief Roger Andresen on Wednesday declined to name the suspect but said he was a Norwegian in his 20s and had made threats before. The Norwegian daily VG said the suspect had connections to the far-right, anti-Muslim Norwegian Defense League.

Police said the suspect was overheard making “unspecified” threats, including against Parliament, during a cellphone conversation on a bus Tuesday evening.

Andresen said police found a bullet-proof vest and a gas pistol in the apartment where the man was arrested. He gave no further details.

…read more
Source: FULL ARTICLE at Fox World News

Removing a PV from a VG that hasn't been used

By hpimentel

Hi all,

So, I have the following setup:

– Ubuntu 12,04
– 1 6TB physical volume (the one with data) [ext4]
– 1 13TB PV (no data… I think?) [ext4]

Here is the story…

– I created an ext4 on the 13TB PV, added the 13TB to the VG to make a 13TB volume group.
– Everything went fine and then I ran:

Code:

resize2fs /dev/volgroup/volume


And to my surprise.. I couldn’t resize past 16TB ! (crap! should have checked this first!).

So, nothing happened.. Now what I want to do is remove the 13TB PV from the VG and do something else with it… but I get the following error:

Code:

sudo vgreduce -t home_volume_group /dev/sdc1
Test mode: Metadata will NOT be updated.
Physical volume "/dev/sdc1" still in use


How can I safely remove this PV from the VG?

Thanks a bunch!

Harold

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

For Loop in shellscript – Printing Output for every iteration

Code:
for VGLIST in `lsvg -o`
do
CLOSED_OUT=`echo $VGLIST | lsvg -l $VGLIST | awk ‘{print $6 ” ” $7}’ | grep closed`
if [[ $? = 0 ]]; then
echo “Filesystems $CLOSED_OUT in VG that are in Closed status”
else
echo “n Some message”
fi
Above Code is working fine, but
Code:
echo “Filesystems $CLOSED_OUT in VG that are in Closed status”
is being printed for every iteration. I just want to print one line output for each filesystem that is closed in a particular volume group.
Source: The UNIX and Linux Forums