1836621 Members
1984 Online
110102 Solutions
New Discussion

LVM?

 
castro_2
Regular Advisor

LVM?

Which is the difference between 1 and 2.

1.
lvcreate -L 100 -n lvol10 /dev/vg00
mount /dev/vg00/lvol10 /tets

2.
lvcreate -L 100 -n lvol10 /dev/vg00
newfs -F vxfs /dev/vg00/rlvol10
mount /dev/vg00/lvol10 /tets

And how can I see if a logical volume is raw evice?
Thanks
9 REPLIES 9
PIYUSH D. PATEL
Honored Contributor

Re: LVM?

Hi,

After you create a logical volume you will have to create a filesystem on it using the newfs command.

Before creating the newfs command the filesystem is raw. After you execute the newfs command it gets cooked ....ready to use!!! After that you mount the filesystem.

HTH,
Piyush
Uday_S_Ankolekar
Honored Contributor

Re: LVM?

If you are using file system to be mounted on a perticluar lvol then you need to use newfs to create new file system, Till then the created lvol is raw.

You can see in your newfs command , you are using 'r'lvol..rawlvol
-USA..
Good Luck..
A. Clay Stephenson
Acclaimed Contributor

Re: LVM?

In your first example, the mount command will fail because there is not yet an existing filesystem.

By definition, EVERY logical volume IS A RAW DEVICE; in fact, every LVOL is TWO raw devices - a character device rlvol10 which does not use the buffer cache and a block device lvol10 which uses the buffer cache.

The LVOL might also have a filesystem on it. Use bdf and swapinfo to see the LVOL's currently in use.

If it ain't broke, I can fix that.
Caesar_3
Esteemed Contributor

Re: LVM?

Hello!

In the first case after create you couldn't
made the mount because it will return error
that no filesystem on the device.

If you use the device as a simple storage
then you have to create filesystem.

Caeasr
Steven E. Protter
Exalted Contributor

Re: LVM?

Its a raw device until you put a filesystem on it.

the newfs command followed by a mount command makes it a regular filesystem.

It doesn't have anything of use on it, but its a raw device.

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
Michael Tully
Honored Contributor

Re: LVM?

All logical volumes are 'raw' until it/they are mounted. (must have the newfs command used)

Raw logical volumes are used by databases, and these could be any type. We use Informix (on some systems) and we have thousands of them, where a tables from the database are assigned to logical volume space. If you have a DBA, he/she could explain further.
Anyone for a Mutiny ?
Sanjiv Sharma_1
Honored Contributor

Re: LVM?

Hi Castro,

1. You have create a 100 MB logical volume which create 2 device files lvol10( block) and rlvol10( character or raw device). Both are raw device till now and are not ready for use.
When you execute the mount command, it will fail.

You can use this device without creating filesystem for some database like Informix. This device can be used for informix chunk.

2. Same as above but here you have created a filesystem and ready to mount and use it.

rlvol10 is a raw device even if you have a filesystem on lvol10.

hth.
Everything is possible
Ollie R
Respected Contributor

Re: LVM?

Hi Castro,

The other replies have answered your first question regarding the difference between the two command sets, so I won't repeat this information.

For "how can I see if a logical volume is a raw device?", try:

$ fstyp /dev/vg00/lvolX

If the volume is raw (i.e. unformatted), you will receive the following output:
unknown_fstyp (no matches)

Hope this helps,

Ollie.
To err is human but to not award points is unforgivable
Suresh Patoria
Super Advisor

Re: LVM?

Hi,

In 1 and 2 step there is one mejor difference is that in 1 step u not written filesystem and in 2 step u written file system

To access any logical u should write the file system

In 1st step without writting file system u try to mount

u wan't be able to accss that logical volume

If u want check the whether the file system written or not logical volume

use the fstyp command