Operating System - HP-UX
1837957 Members
3561 Online
110124 Solutions
New Discussion

Re: logical volume file was lost. can I release PE it occupied?

 
wangzhida
Occasional Advisor

logical volume file was lost. can I release PE it occupied?

hi, dears:

I created lv with improper names today. here is the command that I used:

#lvcreate -l 128 -n r4g_51 vg_rdb05
#lvcreate -l 128 -n r4g_52 vg_rdb05
#lvcreate -l 128 -n r4g_53 vg_rdb05
#lvcreate -l 128 -n r4g_54 vg_rdb05
#lvcreate -l 128 -n r4g_55 vg_rdb05

you see, I start the filename with letter 'r'。this made confusion later when I add the lv to oracle as a raw device.

alter tablespace DATA_RPT add datafile '/dev/vg_rdb05/r4g_51' size 4095m reuse
*
ERROR at line 1:
ORA-01119: error in creating database file '/dev/vg_rdb05/r4g_51'
ORA-27044: unable to write the header block of file
HP-UX Error: 27: File too large
Additional information: 3

two errors I made, firstly I use block device file instead of character device file; and secondly I gived a larger file size than it is.

after I realized mistake, I found the file r4g_51 disappeared, but rr4g_51 left. in such situation, I can't use lvremove /dev/vg_rdb05/r4g_51 to remove the definition, because the file has gone.

after then I check vg with vgdisplay, there's no obvious error messages.

--- Volume groups ---
VG Name /dev/vg_rdb05
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 105
Open LV 99
Max PV 32
Cur PV 26
Act PV 26
Max PE per PV 1016
VGDA 52
PE Size (Mbytes) 16
Total PE 22568
Alloc PE 20224
Free PE 2344
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

the only thing I noticed is the difference between the value of Cur LV and Open LV.

please, who can tell me how to recover the lost lv?
7 REPLIES 7
Senthil Kumar .A_1
Honored Contributor

Re: logical volume file was lost. can I release PE it occupied?

Hi,

You can recreate the lost block device file by using command "mknod"..

do the following..

cd /dev/vg_rdb05
ll

note (now you will get the long listing of the files)

now note down the minor number of the raw device file whose block device file is lost. Lets say in your example the minor number for "rr4g_51" is 0x040006.

then with this data u create the block device file.

mknod /dev/vg_rdb05/r4g_51 b 64 0x040006

after restoring the block device file, you are free to remove the lv or, You can use the LV as u like, because it might be intact still. But would suggest you to rename(there is a define procedure, i will link if i find some data) it or remove and create it for avoiding confusion.

Regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
Senthil Kumar .A_1
Honored Contributor

Re: logical volume file was lost. can I release PE it occupied?

Sivakumar TS
Honored Contributor

Re: logical volume file was lost. can I release PE it occupied?


Hi,

If you can afford to do vgexport,

you may do a vgexport of this vg_rdb05 and do a vgimport ( without using a map file ) this will import all lvols to the VG and the names of the imported lvols would be lvol1,lvol2,lvol3 and so on.

Now you may either use this lvol as such or you may rename the lvols and you desire.

Regards,

Siva.
Nothing is Impossible !
Devender Khatana
Honored Contributor

Re: logical volume file was lost. can I release PE it occupied?

Hi,

Ido not think using r at the first letter of the name of a LVOL is the problem. Anyways the device file can be recreated using the mknod command. Mention the block and the minor number as appearing in the raw device file of that lvol.

#mknod /dev/vg_rdb05/r4g_51 b 64 0x0000?

Where the 0x00000? is the minor number same as for /dev/vg_rdb05/rr4g_51.

HTH,
Devender
Impossible itself mentions "I m possible"
Senthil Kumar .A_1
Honored Contributor

Re: logical volume file was lost. can I release PE it occupied?

Hi Siva,

one thought though, there are 105 lv's, if we do a vgexport and vgimport, it would rename the already existing other LV's right, then , it would complicate the renaming the lv's in fstab for the other LV's aswell.

Would it not be safe only to meddle with the LV's with issue.

regards,
Senthil Kumar .A
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
AshishJain_USA
Frequent Advisor

Re: logical volume file was lost. can I release PE it occupied?

Hi

You can recreate the device file using the mknod command. Mention the block and the minor number as appearing in the raw device file of that lvol.

Once you have recreated it, you may then use its character file (raw device) for your database. Or else, you may use lvremove/lvextend to either remove the lV or increase its size for your specific needs.

The difference you see in the Cur LV and Open LV is because of the 6 new LVs created by you which are not a part of the database as of now.

rgds...Ashish
wangzhida
Occasional Advisor

Re: logical volume file was lost. can I release PE it occupied?

Thank you very much every body! I've solved the problem by following Senthil's suggestion. I've had a wonderful experience here! Thank you!

sincerely yours,

Andy