Scripts to create VG, LV, FS

Scripts to create VG, LV, FS

Post by Spot » Fri, 04 Jul 2003 15:57:48



Hi,
Does anyone have scripts to create mkvg, mklv, crfs line commands from
existing LVM information?  For example, using the parsed output of lsvg,
lslv and lsfs, I would like to cron this script daily so in the event of a
disk failure, I can quickly recreate my vgs and filesystems for a restore.

mkvg -s 32 -y somevg hdisk2 hdisk3
mklv -y somelv somevg 32 hdisk2
crfs -v jfs -a nbpi=16384 -a bf=true -a ag=64 -m '/somefs' -d 'somelv' -A
yes -a check=true

If anyone has something like this in place, I would be most greatful if you
would reply.
Thanks!

 
 
 

Scripts to create VG, LV, FS

Post by Steve Greatbank » Fri, 04 Jul 2003 18:02:41


Have a look in the Tivoli Storage manager redbook (SG24-6844-01) for a natty
little way of doing this.
Page 243, in the version I have. Basically you have a savevg image that has
everything excluded at the file level
so it leaves you with a template savevg file which you can restorevg,
putting back the VG, LVs and all filesystems in one go. Very neat...
www.redbooks.ibm.com in case you didn't know, and a search for disaster
turns it up as the first hit.
Their script has a few little problems, but is an excellent starting point
for your own solution.

Hope that helps


Quote:> Hi,
> Does anyone have scripts to create mkvg, mklv, crfs line commands from
> existing LVM information?  For example, using the parsed output of lsvg,
> lslv and lsfs, I would like to cron this script daily so in the event of a
> disk failure, I can quickly recreate my vgs and filesystems for a restore.

> mkvg -s 32 -y somevg hdisk2 hdisk3
> mklv -y somelv somevg 32 hdisk2
> crfs -v jfs -a nbpi=16384 -a bf=true -a ag=64 -m '/somefs' -d 'somelv' -A
> yes -a check=true

> If anyone has something like this in place, I would be most greatful if
you
> would reply.
> Thanks!


 
 
 

Scripts to create VG, LV, FS

Post by Steve Nottingh » Fri, 04 Jul 2003 21:13:56



> Hi,
> Does anyone have scripts to create mkvg, mklv, crfs line commands from
> existing LVM information?  For example, using the parsed output of lsvg,
> lslv and lsfs, I would like to cron this script daily so in the event of a
> disk failure, I can quickly recreate my vgs and filesystems for a restore.

> mkvg -s 32 -y somevg hdisk2 hdisk3
> mklv -y somelv somevg 32 hdisk2
> crfs -v jfs -a nbpi=16384 -a bf=true -a ag=64 -m '/somefs' -d 'somelv' -A
> yes -a check=true

> If anyone has something like this in place, I would be most greatful if you
> would reply.
> Thanks!

Why don't you do a savevg instead ? This will preserve all the
information that you require, plus the data.

If you are that worried about losing a disk, why not mirror your
volume groups.

Steve