On Sep 18, 2011, at 2:37 PM, Vladislav Bogdanov wrote:

> 17.09.2011 23:11, Vadym Chepkov wrote:
>> 
>> On Sep 17, 2011, at 3:20 PM, Vladislav Bogdanov wrote:
>> 
>>> 17.09.2011 14:18, Vadym Chepkov wrote:
>>>> Hi,
>>>> 
>>>> How does one filter iSCSI disks in lvm.conf? In our configurations
>>>> all iSCSI disks belong to virtual machines, so I don't want host
>>>> server to see LVM on those disks. Just relying on the device names is
>>>> not reliable, especially if the server has hot-swappable disks.
>>> 
>>> You should find some permanent device names for your physical devices
>>> (actually regexps) in /dev/disk/by-*, whitelist them and blacklist
>>> everything else.
>>> 
>>> [...]
>>> 
>>>> 
>>>> I thought to scan only /dev/disk/by-path/ and exclude devices started with 
>>>> "ip-", 
>>>> but this path doesn't exist during system boot, so I afraid I won't be 
>>>> able to load OS from a logical volume.
>>> 
>>> You should remember that you need to blacklist *all* names for given
>>> device if you do not want it to appear as PV. The best way I found,
>>> again, is to disable everything except what I actually need.
>> 
>> 
>> and this is exactly the problem I have.
>> Pull out a hot-swapable disk - put it back. 
>> It will get some unpredictable name. 
> 
> Yes, you will get dynamically allocated "primary" device name (for newer
> distros you'll also get device mapper devices).
> But you'll also have something in /dev/disk/by-*. And you can construct
> some regexp which allows only you permanent disks to pass. F.e.
> "a|/dev/disk/by-id/scsi-.*|" or "a|/dev/disk/by-path/pci-.*-scsi-.*|"
> and then add reject-all rule to the end of that list -  "r/.*/".
> That should be enough.
> 

That should be enough to prevent you from booting your server. 
Again, as I said in the very first post, /dev/disk/ doesn't exist during boot 
time.



>> 
>> I don't do it often and I can edit lvm.conf every time I do that,
>> but I was thinking there could be some more elegant solution for this issue.
>> 
>> 
>>> 
>>> Do you use dracut initramfs to boot? It does some lvm-related things by
>>> itself from initrd. This is usually enough to mount root volume.
>>> 
>> 
>> I am on RHEL5/initrd
> 
> It is lvm-aware.

Thanks

Vadym



> 
> Best,
> Vladislav
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to