Skip to contentSkip to conversation

Changing owner of lv device with udev

linux-lvm Nikolaus Rath 2 participants 4 messages Dec 19, 2012 – Dec 28, 2012

lore
Share & tools
lore
#0 lore raw

Hello,

I'm having some trouble changing the owner of a logical device. I added the following udev rule to both my initramfs and the real root:

SUBSYSTEM=="block", ENV{DM_UUID}=="LVM-yYuoI8k05GWxZnz9BeEIwPUGGeojzF3dZZmXTYRqC051Tllj76OHdDlzYhKZUu7u", OWNER="1000"

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 permissions are actually correct.

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.

I first blamed this on udev
(http://article.gmane.org/gmane.comp.sysutils.systemd.devel/7605), but I was told that the problem might be with the special way that LVM uses udev rules.

Does anyone have an idea what's happening here? How can I get this to work?

Thanks,
-Nikolaus

#1 lore raw
Quoted 2 lines · Nikolaus Rath

I'm having some trouble changing the owner of a logical device. I added the following udev rule to both my initramfs and the real root:

Tell people which distribution you're using and which version, and which udev rule file you're editing.

Alasdair

#2 lore raw
Quoted 5 lines · Alasdair G Kergon
Quoted 2 lines · Nikolaus Rath

I'm having some trouble changing the owner of a logical device. I added the following udev rule to both my initramfs and the real root:

Tell people which distribution you're using and which version, and which udev rule file you're editing.

I'm using Debian wheezy and added the rule to /etc/udev/rules.d/99-udev-custom.rules.
I made sure this is copied into the initrd by adding a hook in /etc/initramfs/hooks/.

Sorry for the omission. I thought it wouldn't matter because the rule seemed to be parsed and used by udev perfectly both in the initrd and after system boot.

Best,
Niko

#3 lore raw
Quoted 6 lines · Nikolaus Rath
Quoted 5 lines · Alasdair G Kergon
Quoted 2 lines · Nikolaus Rath

I'm having some trouble changing the owner of a logical device. I added the following udev rule to both my initramfs and the real root:

Tell people which distribution you're using and which version, and which udev rule file you're editing.

Quoted 8 lines

I'm using Debian wheezy and added the rule to /etc/udev/rules.d/99-udev-custom.rules.
I made sure this is copied into the initrd by adding a hook in /etc/initramfs/hooks/.

Sorry for the omission. I thought it wouldn't matter because the rule seemed to be parsed and used by udev perfectly both in the initrd and after system boot.

No one any idea?

Best,

-Nikolaus

Signature · 3 lines
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C