From mboxrd@z Thu Jan 1 00:00:00 1970 References: From: Zdenek Kabelac Message-ID: Date: Mon, 28 Jan 2019 11:01:57 +0100 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [linux-lvm] Option devices/dir different from /dev does not work Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: LVM general discussion and development , Andrei Borzenkov Dne 26. 01. 19 v 22:14 Andrei Borzenkov napsal(a): > I attempt to put device nodes for volumes in sub-directory of /dev to > avoid accidental conflict between device name and volume group and > general /dev pollution. VxVM always did it, using /dev/vx as base > directory, so I would use something like /dev/lvm. That is a very HARD task you want to achieve - I'd probably better advice you to avoid doing this. First - please start out with reasoning. 1. Normally it really DOES NOT matter where device node is - it's in /dev and you can create as my subdirs there - it will not help anything - as any app can still find the node be there. 2. You CANNOT change where /dev/dm-XXX node will appear - it's made by kernel just one any DM device is created. Udev ONLY controls it's symlink. 3. With LVM - we advice users to use /dev/vg/lv links - although you will find out there are way more of them in your /dev pointing to final /dev/dm node - so you SHOULD be using these symlinks for passing devices to VxVM. 4. If all your work is because you want to avoid LVM commands to access device you've created and passed to your VMs - you have number of way easier solutions - personally I'd recommend to use FILTERS (in lvm.conf). Just 'accept' devices which are possible PVs for your hosting machine (be it /dev/sd* or whatever else you have) and reject any other device from scanning - this will greatly improve performance, avoids various scanning troubles and also makes your VMs completely separated. In the upstream (unstable git HEAD) we have something named 'scan_lvs' in lvm.conf - where you can globally disable scanning of any activated LV (DM device with LVM- UUID prefix) - but it's also not a perfect solution in case you would need to use same actived devices locally and some others not. Regards Zdenek