I'm having some trouble changing the owner of a Linux LVM logical volume on my Debian wheezy system. I added the following udev rule to both the initramfs and the real root file system:
SUBSYSTEM=="block",
ENV{DM_UUID}=="LVM-yYuoI8k05GWxZnz9BeEIwPUGGeojzF3dZZmXTYRqC051Tllj76OHdDlzYhKZUu7u",
OWNER="nikratio"
If I disable and re-enable this logical volume with lvchange, it gets created with the correct owner.
However, when I boot the computer, the device always ends up being owned
by root:disk
instead.
On the other hand, if I look at the permissions right before initramfs executes the real init, the owner is actually correct (i.e., nikratio).
So, at some point between execution of the real init and completed startup, something overwrites the owner of by device, but both before and afterward the rule gets applied correctly.
Does anyone have an idea what's happening here? How can I get this to work?