1833695 Members
3478 Online
110062 Solutions
New Discussion

lvsplit

 
Angelo Collazo
Advisor

lvsplit

When executing the following:
#
# SPLIT mirror's for vg01
#
for i in $(ls /dev/vg01/*)
do
lvsplit $i >> /dbms/tmp/backupmirror.msg
done

I get this error:
"lvsplit: Logical volume "/dev/vg01/rdbms" is not a block special file."
Question:
1-) Why?
2-) What's the solution

TIA,
Angelo
14 REPLIES 14
Pete Randall
Outstanding Contributor

Re: lvsplit

Angelo,

It looks like it's a raw device file. Post an "ll /dev/vg01" so we can see what the corresponding cooked file might be.


Pete


Pete
Steven E. Protter
Exalted Contributor

Re: lvsplit

lvsplit is done on logical volumes that are mirrored and part of volume groups.

lvsplit /dev/vg01/lvol1

The split off mirror needs to be part of vg01 or the original volume group and won't write to a /tmp file.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor

Re: lvsplit

Hi Angelo:

You want to skip the raw devices so :

for i in $(ls in /dev/vg01/[!r]*)

...

Regards!

...JRF...
Paul Sperry
Honored Contributor

Re: lvsplit

Does ioscan show raw and "cooked" device files?

ioscan -fun -C disk

disk 0 10/0/14/0.0.0 sdisk CLAIMED DEVICE TEAC CD-532E-B
/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0


If not reboot or use /sbin/insf
to install special (device) files
Enrico P.
Honored Contributor

Re: lvsplit

Hi,
you need to use block device with the lvsplit command.
Try

for i in $(vgdisplay -v /dev/vg01 |grep /dev/vg00/|awk '{print $3}')

Enrico.

Angelo Collazo
Advisor

Re: lvsplit

Here is the option I will use on my noon backup scrip. This was suggested by James Ferguson(You want to skip the raw devices so : ). This should take care of my issue.

Solution: for i in $(ls in /dev/vg01/[!r]*)
James R. Ferguson
Acclaimed Contributor

Re: lvsplit

Hi Angelo:

Sorry, there is a typographical error in my last post. This correct that error *and* skips the volume group's 'group' file and all *raw* devices:

#!/usr/bin/sh
for i in $(ls /dev/vg02/[!r]*)
do
[ $(basename ${i}) = group ] && continue
echo $i
done
exit 0

Regards!

...JRF...
Angelo Collazo
Advisor

Re: lvsplit

Corecction to my prior posting. Is this corre ct guys?

#
# SPLIT mirror's for vg01
#
######## 7_22_2003 for i in $(ls /dev/vg01/*)
for i in $(ls in /dev/vg01/[!r]*)
do
[ $(basename ${i}) = group ] && continue
echo $i
lvsplit $i >> /dbms/tmp/backupmirror.msg
done
Angelo Collazo
Advisor

Re: lvsplit

Here is more info as requested:
# ll /dev/vg01
total 0
brw-r----- 1 root sys 64 0x010001 Apr 29 00:54 dbms
crw-rw-rw- 1 root sys 64 0x010000 Sep 10 2002 group
crw-r----- 1 root sys 64 0x010001 Sep 10 2002 rdbms
Pete Randall
Outstanding Contributor

Re: lvsplit

Angelo,

I believe that's got it! Looks good to me.


Pete


Pete
James R. Ferguson
Acclaimed Contributor

Re: lvsplit

Hi (again) Angelo

Yes, but per my second post:

...
for i in $(ls in /dev/vg01/[!r]*)

...should be:

for i in $(ls /dev/vg01/[!r]*)

...that is, drop the word "in"!!!

Regards!

...JRF...
Angelo Collazo
Advisor

Re: lvsplit

10 4 on that James. 4 more minutes and the cron will start, Then I'll do my points.

Thanks guys,

Angelo Collazo
Advisor

Re: lvsplit

Final Solution work:
#
# SPLIT mirror's for vg01
#
######## 7_22_2003 for i in $(ls /dev/vg01/*)
for i in $(ls /dev/vg01/[!r]*)
do
[ $(basename ${i}) = group ] && continue
echo $i >> /dbms/tmp/backupmirror.msg
lvsplit $i >> /dbms/tmp/backupmirror.msg
done

Once again, Thanks for all the replys.
Angelo,
Angelo Collazo
Advisor

Re: lvsplit

Final Solution worked:
#
# SPLIT mirror's for vg01
#
######## 7_22_2003 for i in $(ls /dev/vg01/*)
for i in $(ls /dev/vg01/[!r]*)
do
[ $(basename ${i}) = group ] && continue
echo $i >> /dbms/tmp/backupmirror.msg
lvsplit $i >> /dbms/tmp/backupmirror.msg
done

Once again, Thanks for all the replys.
Angelo,