access special devices
A message that is not in the archive (sent off-list or not yet received): [email protected]
In message <[email protected]>, "M
Quoted 7 lines · ichael Vogt
ive a question, i want to use lvm in my san environment, i use a san virtualisation. the point is, my (scsi) disks are not called
/dev/sdX, they are called/dev/svm/svmXXX. [not seen by lvmdiskscan] so i checked the source, and in the file /tools/lib/lvm_dir_cache.c are some definitions calledLVM_DIR_PREFIX. i tried to add my definitions (/dev/svm/svmand svm/svm) but this didnt work. what i need to do, that my disks are aviable for lvm?
Having been down this road today (investigating the ataraid issues I've posted about), you'll probably also need to look at tools/lib/lvm_check_dev.c and tools/lib/lvm_check_partitioned_dev.c and liblvm.h (and perhaps some others). In particular with LVM 1 (eg, 1.0.7) there is an enumerated type, lvm_device_type_t used to identify applicable devices, and a function lvm_get_device_type() which is used as a filter on the lvm_dir_cache() results, based on that enumerated list, and another table, when scanning for physical volumes.
I suspect your virtualisation layer isn't one of the types recognised from matching against /proc/devices, and so it's being ignored.
In the case of ataraid it appears that (in addition to not having the same hacks as for md to prevent aliasing, and hence the accessing-raw-devices issues I've mentioned) LVM considers ataraid to be unpartitioned (a la, md, loopback, etc). In fact this isn't the case, ataraid is a whole-disk device, with partitions (/dev/ataraid/dNpM where N is the raid array, and M is the partition number).
BTW, I'm not sure if you're trying to use LVM 1 or LVM 2. I've been told that LVM 2 has a more configurable system for scanning for physical volumes which might avoid some of the ataraid issues I found; and might perhaps allow you to get it to see your san virtualisation devices without hacking on the code.
For now, I've put aside the idea of using LVM on ataraid. When LVM 2 is released, and I've got some more time, I might give that a go instead.
Ewen
Re: [linux-lvm] (no subject)
In reply to a message not in the archive[Resent: first copy had wrong From: address, and doesn't appear to have
been accepted by the mailing list]
In message <[email protected]>, "M
Quoted 2 lines · ichael Vogt
well ewen, what do you mean with types recognised from matching against =
/proc/devices? it contains the following: [...]
Based on what I found when looking at LVM and ataraid issues:
The function lvm_get_device_type() in tools/lib/lvm_check_partitioned_dev.c (LVM 1.0.7) is used to check that a device being considered for a LVM physical volume is of an appropriate type.
It does this by comparing the device's number (ie, major/minor) against the list in /proc/devices, and ensuring that the driver associated with the major number is one of the ones in its list.
It has the following device names in its list:
-=- cut here -=-
{ "ide", LVM_DEVICE_TYPE_IDE }, /* IDE disk */
{ "sd", LVM_DEVICE_TYPE_SD }, /* SCSI disk */
{ "md", LVM_DEVICE_TYPE_MD }, /* Multiple Disk driver (SoftRAID) */
{ "loop", LVM_DEVICE_TYPE_LOOP }, /* Loop device */
{ "dasd", LVM_DEVICE_TYPE_DASD }, /* DASD disk (IBM S/390, zSeries) */
{ "rd", LVM_DEVICE_TYPE_DAC960 }, /* DAC960 (2.2 kernel name) */
{ "dac960", LVM_DEVICE_TYPE_DAC960 },/* DAC960 (2.4 kernel name) */
{ "nbd", LVM_DEVICE_TYPE_NBD }, /* Network Block Device */
{ "ida", LVM_DEVICE_TYPE_COMPAQ_SMART2 },/* Compaq SMART2 */
{ "cciss", LVM_DEVICE_TYPE_COMPAQ_CISS },/* Compaq CISS array */
{ "ubd", LVM_DEVICE_TYPE_UBD }, /* User-mode virtual block device */
{ "ataraid", LVM_DEVICE_TYPE_ATARAID }, /* ATA Raid */ { "i2o_block", LVM_DEVICE_TYPE_I2O }, /* i2o disk */
{ NULL, LVM_DEVICE_TYPE_INVALID } /* Device not recognized */
-=- cut here -=-
If the device you're trying to use doesn't match one of those types, then LVM will refuse to use it, viz:
Quoted 10 lines
linuxsvm:/usr/src/linux # lvmdiskscan -vd
lvmdiskscan -- reading all disks / partitions (this may take a while...) lvmdiskscan -- filling directory cache...
<1>lvm_dir_cache-- CALLED MICHU
<22>lvm_add_dir_cache-- CALLED with /dev/svmaa=20
<22>lvm_add_dir_cache-- LEAVING with ret: NOT ADDED
<22>lvm_add_dir_cache-- CALLED with /dev/svmab=20
<22>lvm_add_dir_cache-- LEAVING with ret: NOT ADDED
<22>lvm_add_dir_cache-- CALLED with /dev/svmac=20
<22>lvm_add_dir_cache-- LEAVING with ret: NOT ADDED
The "NOT ADDED" there means "didn't recognise /dev/svmac as a type of device that can have LVM on it".
So at very least you'd need to change that table. You'll also need to add to the enumerated type (lvm_device_type_t) in liblvm.h, so that you have a value to put on the right hand side of that table in tools/lib/lvm_check_partitioned_dev.c.
And there may well be some other areas that you need to add to as well.
Since LVM 2 apparently supports control with regular expressions that might be a better choice than trying to hack support into LVM 1.0.7. (although LVM 2 isn't officially released yet AFAIK).
Ewen