How to change the LVM logical volume owner in RHEL 5.3
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We change the ownership of the above block devices to sybase and after a node reboot the ownership of the devices goes back to root. Are there any options in LVM to permanently change the ownership of the logical volumes?
I was thinking of putting a shell script in rc.local which will change the ownership of the Sybase devices during a node reboot. Is there a better way to achieve this?
Just edit them to suit your situation, and put them in a file under /etc/udev/rules.d/
then reload and rerun. I can't remember how to do that off the top of my head for RHEL
The kludge is having to execute chgrp, the device at this point will be /dev/dm-X where X is an incrementing number, but we also want the permissions to be correct for the /dev/mapper/vg-lv node
How to change the LVM logical volume owner in RHEL 5.3
Thanks Phil. Actually, I don't directly use the dm-* devices, but create the Sybase logical volumes on top of it. So, should I still use KERNEL!="dm-*" OR should I specify a different kernel module name. Please let me know.
Thanks
Quote:
Originally Posted by phil.d.g
I found this quite tricky, and the solution is a kludge, but works.
Here is a set of udev rules that I came up with to do exactly what you want, but for another reason.
Just edit them to suit your situation, and put them in a file under /etc/udev/rules.d/
then reload and rerun. I can't remember how to do that off the top of my head for RHEL
The kludge is having to execute chgrp, the device at this point will be /dev/dm-X where X is an incrementing number, but we also want the permissions to be correct for the /dev/mapper/vg-lv node
For every node in /dev/mapper/ there is a corresponding node that takes the form /dev/dm-X, they both point to the same block device.
dm-mod is the kernel module that gives the device mapper functionality so you want to keep the kernel module the same.
When the udev rule is triggered it's due to the creation of /dev/dm-X, at this time the node has already been created in /dev/mapper so aswell as applying the correct ownership and permissions to /dev/dm-X we also need to do it the node in /dev/mapper.
When I have some energy I intend to do look into it more and have a rule triggered on the creation of the /dev/mapper/ node, but one day at a time
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.