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?
deepak_iqConnect With a Mentor Commented:
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.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.