Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO get rid of lvmetad
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Guenther Brunthaler
Apprentice
Apprentice


Joined: 22 Jul 2006
Posts: 217
Location: Vienna

PostPosted: Fri Feb 06, 2015 1:04 am    Post subject: HOWTO get rid of lvmetad Reply with quote

In LVM2, use of lvmetad is optional and can be disabled in lvm.conf.

Unfortunately, /etc/init.d/lvm does not care about whether this setting is enabled or not and starts lvmetad anyway.

If you, like me, hate having running unnecessary daemons, read on how I got rid of that unnecessary critter:

Just create a file /etc/init.d/lvmetad-fake with the following contents:

Code:

#! /sbin/runscript

depend() {
        provide lvmetad
}

start() {
        :
}

stop() {
        :
}


Then make it executable
Code:

chmod +x /etc/init.d/lvmetad-fake


and add it to the boot runlevel:

Code:

rc-update add lvmetad-fake boot


Then the original /etc/init.d/lvm runlevel script will prefer lvmetad-fake over the original lvmetad, and no daemon will be started as the fake script simply does nothing when "started" or "stopped".

WARNING: You must not do this if your lvm.conf actually enabled lvmetad!

Therefore, make sure it is actually disabled:

Code:

grep use_lvmetad /etc/lvm/lvm.conf


must show that the setting use_lvmetad it is actually set to zero.

It might also not be a good idea to disable lvmetad if you have systemd running.

But then, being a genuine Gentoo user, you are unlikely to be a fan of bug-riddled bloatware like systemd anyway. (This is a strictly personal opinion - no claims are made that this is the absolute truth, as it all depends on one's point of view.)
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1282

PostPosted: Fri Feb 06, 2015 1:36 am    Post subject: Reply with quote

See https://bugs.gentoo.org/show_bug.cgi?id=479950
USE device-mapper-only
Do you want this kind of minimal lvm2?
_________________
fun2gen2
Back to top
View user's profile Send private message
khayyam
Advocate
Advocate


Joined: 07 Jun 2012
Posts: 2980

PostPosted: Fri Feb 06, 2015 3:18 am    Post subject: Reply with quote

Guenther ...

You should be able to do the following and save having fake scripts/services (untested)

/etc/rc.conf
Code:
rc_lvm_provide="lvmetad"

HTH & best ... khay
Back to top
View user's profile Send private message
Guenther Brunthaler
Apprentice
Apprentice


Joined: 22 Jul 2006
Posts: 217
Location: Vienna

PostPosted: Sun Feb 08, 2015 3:49 am    Post subject: Reply with quote

ulenrich wrote:
See https://bugs.gentoo.org/show_bug.cgi?id=479950
USE device-mapper-only
Do you want this kind of minimal lvm2?


Thanks for the hint, but I actually do need the additional LVM.functionality.

I normally use lvm instead of fdisk/gdisk to partition my disks, using logical volumes instead of actual disk partitions.

This has many advantages, for instance live resizing of partitions which are in actual use without prior rebooting. Try to this with real partitions.

But even though I like using lvm that way, I do not need or want lvmetad running all the time just because I use basic LVM2 functionality.

As I see it, lvmetad is only useful in scenarios where the LVM configuration is modified very often, such as when using thin provisioning in combination with short-lived virtual machine instances.

This does not apply to me.
Back to top
View user's profile Send private message
Guenther Brunthaler
Apprentice
Apprentice


Joined: 22 Jul 2006
Posts: 217
Location: Vienna

PostPosted: Sun Feb 08, 2015 4:12 am    Post subject: Reply with quote

khayyam wrote:

You should be able to do the following and save having fake scripts/services (untested)


Thanks a lot!

Following your advice, I modified rc.conf accordingly and removed my lvmetad-fake service - and lvmetad still did not start!

Now I am really happy, because even installing a fake-service that consumes no further resources still bugs me.

Your suggestion has therefore be tested now and has been proven to work perfectly!
Back to top
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 3898
Location: The Peanut Gallery

PostPosted: Sun Jun 07, 2015 1:08 am    Post subject: Reply with quote

Guenther Brunthaler wrote:
Your suggestion has therefore be tested now and has been proven to work perfectly!

Excellent.

And great to see you again, after all this time Guenther. :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum