1832924 Members
2539 Online
110048 Solutions
New Discussion

linking a raw device

 
SOLVED
Go to solution
jok llamera
Advisor

linking a raw device

hi fellas,

Before I have suceesfully link(symbolic) a RAW device from deferent volume group, I came out with the same output with the size(Mb) when I cammand;
lvdisplay -v /dev/src_vg/src_lv and
lvdisplay -v /dev/lnk_vg/lnk_lv

I am wondering why this time when I created a 2048MB LV and command lvdisplay with the link, it only reflected 32Mb..I have recreated the source LV and the symbolic link but the same thing happen.

Is there someone can advice me..

thanks,
joks



Excelence is not an act but a hobby
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: linking a raw device

jok,

Why do you want to create links to lvs from other volume groups?.I am hearing it for the first time.

Now, if your lnk_vg already has a logical volume that has the same minor number as of the linked logical volume, you may get into problems like what you have now. It will display the size of the logical volume in the lnk_vg that has this minor number.

But I am still confused why you are doing like this.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: linking a raw device

I'm taking a wild guess here but I suspect that you are using Oracle raw devices and you can't extend the lvol in the vg that it is currently in. To avoid this problem, I always use names like 'myfile01.dbf' and then symbolically link that to /dev/vg02/rlvol4, for example.

However, you probably actually need /dev/vg02/rlvol4 but you need to link it to /dev/vg05/rlov1 (for example) for space reasons.

I think this will work:
1) clean up your old junk.
cd /dev/vg02
rm lvol4 rlvol4
2) make new nodes in vg02
mknod rlvol4orig c 64 0x020004
mknod lvol4orig b 64 0x020004
(Your major & minor devices numbers will differ)
3) ln -s /dev/vg05/rlvol1 /dev/vg02/rlvol4
4) chown oracle:oracle /dev/vg05/rlvol1
chmod 660 /dev/vg05/rlvol1

I THINK this will work and keep lvdisplay and vgdisplay happy.

Clay
If it ain't broke, I can fix that.
jok llamera
Advisor

Re: linking a raw device

hi Clay,

Your very experience then, your right Im out of space on one of my vg, but im wondering the purpose of rlvol4orig character dev and lvol4orig block dev that you made co'z your not using it on step 3.

tnx,
joks
Excelence is not an act but a hobby
Sridhar Bhaskarla
Honored Contributor

Re: linking a raw device

I am not sure if your lvdisplay works this way because the minor number of the lvol doesn't belong to the category of the "group" file.

For ex., in lnk_vg has the group minor 0x0b0000
and src_vg has ox0a0000

Let's say src_lv in src_vg is 0x0a0001
when you link /dev/src_vg/src_lv to link_vg/lnk_lv, it still maintains the minor number 0x0a0001 which doesn't fall under the group 0x0b0000

So lvdisplay /dev/lnk_vg/lnk_lv/will show nothing or the size of the lvol in lnk_vg that has the minor number 0x0b0001.

But this works within the volume group.

#ln -s /dev/src_vg/src_lv /dev/src_vg/src_lv1
#ln -s /dev/src_vg/rsrc_lv /dev/src_vg/rsrc_lv1
(you can create any number of links and all will show the correct information)
But this is definitly what you don't want.

However, if you don't mind the lvdisplay output, the solution still works as your oracle links will treat this as a simple linked file and follow it to src_vg.

-Sri


You may be disappointed if you fail, but you are doomed if you don't try