1834470 Members
2828 Online
110067 Solutions
New Discussion

Logical Volume

 
Jeffrey F. Goldsmith
Super Advisor

Logical Volume

I have a question about Logical Volumes. Is there a way to see how a LV was created? I have 6 LV's on my server and when I look at them with SAM I see that they are part of vg01 and it is unused. How can I mount this LV to see if there is anything in it?

Thanks for the help
12 REPLIES 12
Devender Khatana
Honored Contributor

Re: Logical Volume

Hi,

First find out the current state of the VG by vgdisplay command. Do "vgdisplay -v /dev/vg00"
It will give you a detailed information about the VG , LVOLs in that VG & the Physical Volumes on which that VG exists.

A more detailed information about the LVOL's can be found by "lvdisplay -v /dev/vg01/lvol*" command. A LVOL always do not contain a file system & can be used as raw or swap device as well. If it has file system & that is mounted it will be listed in "bdf" output. Swaps will be listed in "swapinfo -atm" otherwise if the VG is in use with raw file systems you need to know from your applications.

HTH,
Devender
Impossible itself mentions "I m possible"
Jeffrey F. Goldsmith
Super Advisor

Re: Logical Volume

I checked the vg01 with vgdisplay and saw the lv's in question. Here is what one of them looks like:

LV Name /dev/vg01/fy99
LV Status available/syncd
LV Size (Mbytes) 100
Current LE 25
Allocated PE 25
Used PV 1


When I did an lvdisplay this is the information it gave me:

root: / ==> lvdisplay -v /dev/vg01/fy99
--- Logical volumes ---
LV Name /dev/vg01/fy99
VG Name /dev/vg01
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 100
Current LE 25
Allocated PE 25
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c4t0d0 25 25


How do I mount this so I can see if it has the information I need?

Joseph Loo
Honored Contributor

Re: Logical Volume

hi jeffrey,

think u really need someone with basic (or enough) knowledge of LVM to help u. in fact, i think u need someone who knows HP-UX, but never mind.

for logical volume, use lvdisplay command to view the status of each volume group:

# lvdisplay /dev/vgXX/lvol##
e.g. lvdisplay /dev/vg01/fy99

for volume group, use vgdisplay (-v option for more detail) command to view the logical volumes in that group:

# vgdisplay -v /dev/vgXX
e.g. vgdisplay -v /dev/vg00

to mount the logical volume (or file system):

# mount /dev/vgXX/lvol##
e.g. # mount /dev/vg00/lvol4 /home

if there is any residing mount point (which is commented off) and created in /etc/fstab , u may mount onto that, provided the directory is still there, else create one.

e.g. # mount /dev/vg01/fy99 /staging


just in case, u happen to be taking over from someone, a very good guide from docs.hp.com:

http://www.docs.hp.com/en/5990-8172/index.html

also, visit each man page for the commands.


regards.
(p.s. please remember to assign points.)
what you do not see does not mean you should not believe
Devender Khatana
Honored Contributor

Re: Logical Volume

Hi,

If the file system is there on the LVOL it can be mounted. Use fstyp to determine which file system is contained there in.

#fstype /dev/vg01/fy99

Output should be vxfs or hfs.
Then create a directory to mount it

#mkdir /fy99

Now mount it mentioning file system type & mount point.

#mount -F vxfs or HFS (output from fstyp) /dev/vg01/fy99 /fy99

HTH,
Devender
Impossible itself mentions "I m possible"
Jeffrey F. Goldsmith
Super Advisor

Re: Logical Volume

Background information: I have an L2000 server with HP-UX 11.0 installed. When I tried the fstype command it didn't work so I did a "root: / findf fstype" and didn't find it on my server. I tried both commands and here is the results from both:

root: / ==> mount -F vxfs /dev/vg01/fy99 /apps/ifas/admin/fy99
mount - not a valid vxfs file system


root: / ==> mount -F HFS /dev/vg01/fy99 /apps/ifas/admin/fy99
mount: HFS : Invalid argument
usage: mount [-l][-v|-p]
mount [-F FStype][-eQ] -a
mount [-F FStype][-eQrV][-o specific_options]
{ special | directory }
mount [-F FStype][-eQrV][-o specific_options]
special directory


Can you tell me what I did wrong?

Thanks.
Jeffrey F. Goldsmith
Super Advisor

Re: Logical Volume

Joe,

Your information, insulting as it was, didnâ t help me at all. As you can see in my first response I do know how to check the LVâ s. And yes, I did try to do a mount as you suggested and here is the results.

root: / ==> mount /dev/vg01/fy99 /fy99
/dev/vg01/fy99: unrecognized file system
root: / ==>

The reason I am here asking for help is because everything else I tried didn't w
DCE
Honored Contributor

Re: Logical Volume

After you have verified the logical volumes are not being used for swap or raw data writes by an application, you COULD use SAM to try to mount the lvols to a temporary ount point. It will tell you if tere is a file system on it, and ask it tyou want to retain it. Be sure to read to questions SAM asks carefully........

Dave
Devender Khatana
Honored Contributor

Re: Logical Volume

Hi,

I apologize for the mistake.

It is fstyp & not fstype.
& is there in both /usr/sbin & sbin.

Regards,
Devender
Impossible itself mentions "I m possible"
Jeffrey F. Goldsmith
Super Advisor

Re: Logical Volume

Devender,

I am not sure who created this LV but there is something wrong with it. Here is the information from the fstyp command:

root: / ==> fstyp /dev/vg01/fy99
unknown_fstyp (no matches)
root: / ==>


After talking with my manager I found that this LV was an LV on an older D380 server which had HP-UX 10.2 and was moved over with several other LV when that server was being turned off.

Any iedas as to what I can do to get this LV mounted or get it to a state where I can check to see what kind of files it has?
Pete Randall
Outstanding Contributor

Re: Logical Volume

Jeffrey,

The fact that fstyp returns unknown indicates to me that there never was a file system created on it. In other words, it was a raw logical volume, typically used for a database. Without knowing a lot about what the database may have been, you won't be able to check this LV. You'll just have to assume that whatever was there is no longer valid and go ahead and re-use the space as your needs now require.


Pete

Pete
Jeffrey F. Goldsmith
Super Advisor

Re: Logical Volume

Pete,

When I go to /dev/vg01 and do an "ll fy*" all 6 of the LV are listed:

root: /dev/vg01 ==> ll fy*
brw-r----- 1 root sys 64 0x01000c May 9 2000 fy94
brw-r----- 1 root sys 64 0x01000d May 9 2000 fy95
brw-r----- 1 root sys 64 0x01000e May 9 2000 fy96
brw-r----- 1 root sys 64 0x01000f May 9 2000 fy97
brw-r----- 1 root sys 64 0x010010 May 9 2000 fy98
brw-r----- 1 root sys 64 0x010011 May 9 2000 fy99
root: /dev/vg01 ==>


When I do an "ll" I see the rfy94 - rfy99 files too:

crw-r----- 1 root sys 64 0x01000c May 9 2000 rfy94
crw-r----- 1 root sys 64 0x01000d May 9 2000 rfy95
crw-r----- 1 root sys 64 0x01000e May 9 2000 rfy96
crw-r----- 1 root sys 64 0x01000f May 9 2000 rfy97
crw-r----- 1 root sys 64 0x010010 May 9 2000 rfy98
crw-r----- 1 root sys 64 0x010011 May 9 2000 rfy99


It is my understanding that the LV's had been created in May 2000 but now they do not work. These LV's contain end of year information that my company wants to keep. This is the only reason I am trying to save them.
Devender Khatana
Honored Contributor

Re: Logical Volume

Jeffrey,

I aggree with Pete that your lvol seems to be used by a database as raw devices. In this event the contents will be of no use if you have not all of your database running which can actually access contents in some meaningful form.

You can start using this as new file system after creating one on this. The above mentioned procedure is enough for that. Just add two more things

#newfs -F vxfs -o largefiles /dev/vg01/fy99

Put an entry in /etc/fstab for auto mount of the file system at system reboots.

HTH,
Devender
Impossible itself mentions "I m possible"