How can i create this Logical Volume from an exit Volume Group.


I want to create a new Logical Volume from an exist Volume Group. Volume Group name rootvg. Logical volume name must be Lvdata. Mount point must be /data. You can see disk sizes and names at below.

/dev/mapper/rootvg-Lvdata  961M   18M  895M   2% /data      

How can i create this Logical Volume from an exit Volume Group.

You can see df -h export of Linux server at below.Redhat EL 5.3 working on the server.

[root@appsrv ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
                       15G  4.0G  9.6G  30% /
                       15G  165M   14G   2% /oracle
/dev/sda1              99M   13M   82M  13% /boot
tmpfs                 3.9G     0  3.9G   0% /dev/shm
                       50G  180M   47G   1% /u02disk
                       50G  180M   47G   1% /u03disk
                       50G  180M   47G   1% /u04disk
                       50G  180M   47G   1% /u05disk
                       50G  180M   47G   1% /u06disk
                       50G  180M   47G   1% /u07disk
                       50G  180M   47G   1% /u09disk
                      199G  188M  189G   1% /u01disk
                      247G  188M  234G   1% /u08disk
[root@appsrv ~]#
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What is the free space available in root vg?
Considering sufficient space is available then kindly follow the below steps:

#lvcreate -n Lvdata -L 961M rootvg
#mkfs.ext3 /dev/rootvg/Lvdata
#mkdir /data

Add the following entry in /etc/fstab:
 /dev/rootvg/Lvdata      /data     defaults    ext3       0     0

#mount /dev/rootvg/Lvdata      /data

Now df output should show the /data mount point.

But again,make sure space is available in rootvg before creating this LV.

This can be checked by vgdisplay rootvg and check for free space.

Let me know if you get any errors.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
yozuzeybekAuthor Commented:
Hi deepak,

I get a message when I ran this command "lvcreate -n Lvdata -L 961M rootvg". You can see message at below.

But Finally i create this Logical Volume succesfully. What are you thinking about this message?

[root@appsrv ~]# lvcreate -n Lvdata -L 961M rootvg
  /dev/hdc: open failed: No medium found

  Rounding up size to full physical extent 992.00 MB
  Logical volume "Lvdata" created
[root@appsrv ~]#
This will be in entry in /etc/fstab and most probably looks like an entry for cdrom.

Thus if the media(cdrom) is not found,then you get this error.

You can see what  /dev/hdc is being referred to in your /etc/fstab file.

If not required you can comment it out and then you will not get this error.

But this error has nothing to do with lvcreation and from above output, your lv is successfully created.

Just a small mistake in my previous note above that :

 /dev/rootvg/Lvdata      /data     defaults    ext3       0     0  --> wrong

should be

 /dev/rootvg/Lvdata      /data     ext3    defaults       0     0   -->right

Rest everything is fine.
Kerem ERSOYPresidentCommented:

Will you please post here your:

fdisk -l

Command outputs. From What you've posted here, it seems that you had your Volume Group was not filling all the available space so that you were able to create a  new VG without contracting an existing one.

yozuzeybekAuthor Commented:
Thank you deepak_iq.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.