Operating System - HP-UX
1833696 Members
3210 Online
110062 Solutions
New Discussion

lvsplit error code 1 (URGENT!)

 
Ola_5
New Member

lvsplit error code 1 (URGENT!)

Can't seem to find a list of error codes. When running lvsplit in backupscript I get error code 1, but when I run lvsplit manually everything works fine!
It stopped working after firmeare upgrading FC10 disk array controllers and disk firmware.
10 REPLIES 10
Paula J Frazer-Campbell
Honored Contributor

Re: lvsplit error code 1 (URGENT!)

Hi

If it works manually and does not work from a script then there is an environmental variable problem.

In your script put the full path name to all commands, i.e.

/usr/sbin/lvsplit

and not lvolsplit.

Also ensure that path is correct in your script.

It would also be helpful if you could post your script.


HTH

Paula

If you can spell SysAdmin then you is one - anon
Bill McNAMARA_1
Honored Contributor

Re: lvsplit error code 1 (URGENT!)

you should see something in the syslog.log and/or dmesg, but in either case, you should have _some_ output other than a return code.. are you redirecting your errors?

lvsplit blah lvol 2>/tmp/err

Later,
Bill
It works for me (tm)
Paula J Frazer-Campbell
Honored Contributor

Re: lvsplit error code 1 (URGENT!)

Hi Again

I run an FC10 on an N class 11.00 and this script works OK.


date >> ~/var/adm/n0cronlog
################################
# Flush memory
################################
sync
sync
################################
echo "Splitting disks"
lvsplit -s _copy /dev/avro/avro
################################
echo "FSCK on split disk"
################################
fsck /dev/avro/avro_copy
################################
echo "Making mount dir"
################################
mkdir /avrobackup
################################
echo "Mounting split disk to /avrobackup"
################################
mount /dev/avro/avro_copy /avrobackup
################################
echo "RM on /avroTWO dir"
################################
rm /avroTWO/COPYCOMPLETE
rm -R /avroTWO/*
################################
echo "CD to /avrobackup"
################################
cd /avrobackup
################################
echo "CD to /avrobackup and copy to avroTWO"
################################
find .|cpio -pudvm /avroTWO
################################
# Move clear of the mount disk
################################
cd /avro
################################
echo "Unmounting the split disk"
################################
umount /dev/avro/avro_copy
################################
echo "Removing the mount dir"
################################
rmdir /avrobackup
################################
echo "Merging the disk back online"
################################
lvmerge /dev/avro/avro_copy /dev/avro/avro
################################
echo "Avrocopy to avroTWO complete"
###############################
date >> ~/var/adm/n0cronlog
mailx -s "Mirror backup log" paula@avro.co.uk

HTH

Paula
If you can spell SysAdmin then you is one - anon
Ola_5
New Member

Re: lvsplit error code 1 (URGENT!)

Thank's for alla the answers, but the thing is : backupscript worked before firmwareupgrading.
No error messages at all in syslog or dmesg. Environment variables are correct...
Paula J Frazer-Campbell
Honored Contributor

Re: lvsplit error code 1 (URGENT!)

Hi

Can you post your script?

Can you also post your command line that works ?


Paula
If you can spell SysAdmin then you is one - anon
Ola_5
New Member

Re: lvsplit error code 1 (URGENT!)

The problem is not related to the backupscript. I have run the command manually, exactly as in my script, and the attachement is output from the command, and some checks I made.
Carlos Fernandez Riera
Honored Contributor

Re: lvsplit error code 1 (URGENT!)

The file shows that one disk to not belog to this volume group :


Physical volume "/dev/dsk/c9t0d0" does not belong to volume group ....

So, as long /etc/lvmpvg and LVM commands are showing it as configured for this volume group, maybe you must run a vgcfgrestore for that disk.

I think that disk have its LVM headers not updated, due to a hardware or software issue.

Before do vgcfgrestore you can try this:

To see VGID:



vgexport -s -m /tmp/vgap -p /dev/vgxx

or:

VGID is recorded in each disk:

dd if=/dev/rdsk/cxtxtx bs=1024 skip=8 count=9 | dd bs=8 skip=2 count=1 | od -x | head -1 .



running dd for all disks of vg should show the same

See:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x19c7cf38d6bdd5118ff10090279cd0f9,00.html

Check also the lastest patch for LVM.

Regrads.
unsupported
Ola_5
New Member

Re: lvsplit error code 1 (URGENT!)

Problem solved!
We have FC10 with fibre disks, and some of the primary disks went offline for a short moment when reprogramming firmware, so the alternative link became primary path, and due to that, the order i /etc/lvmpvg did'nt correspond to output from vgdisplay -v conserning primary/alternative link.
Solved problem temporarely by changing order in /etc/lvmpvg, but soon I will change back the primary links to correct disks.
Carlos Fernandez Riera
Honored Contributor

Re: lvsplit error code 1 (URGENT!)

I realize you are a newcomer...

Please see also: http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x022718276953d61190040090279cd0f9,00.html


Enjoy the forum.
unsupported
Bill Hassell
Honored Contributor

Re: lvsplit error code 1 (URGENT!)

Hints on script writing:

Always start *every* script with the courtesy loader string:

#!/usr/bin/sh

That way, the system will always use the same shell to run the script. Without this directive in line 1, the current shell will try to run it.

When a script fails, whether run manually or by cron, run the script with the trace option as in:

sh -x MSycriptName options...

And just for reliability, place an explicit $PATH after the first line:

PATH=/sbin:/usr/sbin:/usr/bin:/usr/lbin

That way, any problems (or security issues) with the current $PATH are eliminated. This statement in the script will not affect your current environment and often fixes problems with cron and other batch jobs.


Bill Hassell, sysadmin