[linux-lvm] Does LVM work with NBD?

ASHISH GUPTA ashish_gupta at infy.com
Wed Mar 20 04:34:01 UTC 2002


Hi All,
 
1) I'm using NBD and LVM . I have mounted the remote device 
using NBD(version 2.4.27). When I do pvcreate on mounted disk,it is successful.
 
#pvcreate /dev/nb0
pvcreate -- physical volume "/dev/nb0" successfully created
 
But when we try out other commands such as pvdisplay, vgcreate etc. it gives the
following error. 
 
 #pvdisplay /dev/nb0
pvdisplay -- ERROR "pv_read(): pv_create_name_from_kdev_t" no VALID physical volume "/d
ev/nb0"
 
# ./vgcreate /dev/nb0
vgcreate -- please enter physical volume name(s)
 
pvcreate uses the information from /proc/partitions. 
It  works although the /proc/partitions is not updated with the remote device information.
However the other LVM commands like "vgcreate", "pvdisplay" look for remote device
information in /proc/partition and as the entry is not there in dir_cache, it fails.
 
To make it run, I have added a entry for nb0 in the file lvm_dir_cache.c in _noprocdir.
/* devices *not* showing up in /proc/partitions must be scanned anyway */
static char *_noprocdir[] = {
        LVM_DIR_PREFIX "loop",
        LVM_DIR_PREFIX "nb0",
        NULL
};
 
After doing,I am able to do pvcreate, vgcreate and so.Is it right way to do this?
 
2)As per some mail in lvm-linux archieve, if I make an entry for nbd device in _devdir[] in file lvm_dir_cache.c
 and just modify this following check by replacing _cache_size with '1'.Still pvcreate fails.And it gives the following error.
 
if(!_cache_size)
                        _scan_devs( TRUE);
                else
                        _scan_devs( FALSE);
        }
 
 
# pvcreate /dev/nb0
"/dev/nb0 has a partition table"
 
 
3) Is there any patch available to make NBD working with LVM?
 
 
 
Regards,
Ashish
 
 
 
 
 
 
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20020320/920fc14b/attachment.htm>


More information about the linux-lvm mailing list