Operating System - HP-UX
1752761 Members
5135 Online
108789 Solutions
New Discussion юеВ

Re: Create Logical volume

 
Shehan
Super Advisor

Create Logical volume

Hi All

I am planning to create several lvol(lvol1, lvol2,lvol3) in my new volume group(VG05). Please guide me to create those logical volumes in CLI mode.

Thanks
Niru
6 REPLIES 6
Torsten.
Acclaimed Contributor

Re: Create Logical volume

Basic usage is here:

http://docs.hp.com/en/B2355-60105/lvcreate.1M.html

Do you want to mirror the LVOLs and if, how many disks are in that VG?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Hasan  Atasoy
Honored Contributor

Re: Create Logical volume

hi niru ;

the basic create command is

lvcreate -n lvname1 -L sizeinMB vg05


without striping or mirrorring.


Hasan
Doug O'Leary
Honored Contributor

Re: Create Logical volume

Hey;

Basic usage information can be found at http://www.olearycomputers.com/ll/hplvcreate.html

The way I normally do this is to create a data file:

#VG LV SIZE MP
######################
vg05 lvol1 2048 /oracle
vg05 lvol2 1024 /oracle/fs1
vg05 lvol3 512 /oracle/fs2
vg05 lvol4 8196 /oracle/fs3
vg05 lvol5 8196 /oracle/fs4

Then, you read through the data file:

grep -v ^# ${file | while read vg lv size
do
echo lvcreate -L ${size} -n ${lv} ${vg}
[[ ${size} -gt 2048 ]] && args="-o largefiles" || args=""
echo newfs -F vxfs ${args} /dev/${vg}/r${lv}
[[ ! -d ${mp} ]] && mkdir -p -m 755 ${mp}
[[ ${size} -gt 2048 ]] && args=",largefiles" || args=""
echo "${lv} ${mp} vxfs delaylog${args} 0 2" >> /etc/fstab
echo mount ${mp}
done

If that looks right, remove the echos.

Doug O'Leary

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Torsten.
Acclaimed Contributor

Re: Create Logical volume

Nice script Doug, but for somebody who asked how to use lvcreate this script may be overkill
;-)
Or not?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Doug O'Leary
Honored Contributor

Re: Create Logical volume

lol! Probably. I refer you to my personal quote:

"A good script will make an admin's day... A bad one will ruin it."

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Torsten.
Acclaimed Contributor

Re: Create Logical volume

totally agree with you :-)

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!