You are not logged in.

#1 2019-03-07 07:12:20

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

[SOLVED]removing lvm2

Hi everyone!
I was looking around my system, that I discovered lvm2.
I searched for it and I found many interesting things about it,
However, I don't use and I don't want later.
I just see it tooks 20s of my startup process in systemd-analyze blame,
I've fixed this by masking its services, but can I remove it completely?
some of applications and tools I use like my deepin desktop and gvfs depends on udisks and libblockdev which depends on lvm2,
that I created this topic for that.

$ pm -Rc lvm2
checking dependencies...
:: evince optionally requires gvfs: bookmark support and session saving
:: ffmpegthumbnailer optionally requires gvfs: support for gio uris
:: inkscape optionally requires gvfs: import clip art
warning: dependency cycle detected:
warning: deepin-session-ui will be removed after its deepin-daemon dependency
warning: dependency cycle detected:
warning: deepin-control-center will be removed after its deepin-daemon dependency
warning: dependency cycle detected:
warning: startdde will be removed after its deepin-daemon dependency

Packages (13) brasero-3.12.2-2  deepin-control-center-4.9.2.1-2  deepin-daemon-3.22.0-1
              deepin-dock-4.8.9-2  deepin-draw-1.0.0-2  deepin-launcher-4.6.4-2
              deepin-session-ui-4.8.9-1  gnome-disk-utility-3.30.2-1  gvfs-1.38.1+8+ge4eec2bc-1
              libblockdev-2.20-1  startdde-3.11.0-2  udisks2-2.8.1-1  lvm2-2.02.183-2

Total Removed Size:  195.78 MiB

:: Do you want to remove these packages? [Y/n] 

(I know packages are not upgraded and outdated, I plan to upgrade them tomorrow)

is there any safe way to remove lvm2 without hurting the packages listed here?

Last edited by mmdamin (2019-03-08 17:01:48)

Offline

#2 2019-03-07 12:40:26

Gigamo
Member
Registered: 2008-01-19
Posts: 394

Re: [SOLVED]removing lvm2

If you are absolutely sure that you're not using it, you can mask the lvm2 service(s).

Offline

#3 2019-03-07 13:57:22

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

Gigamo wrote:

If you are absolutely sure that you're not using it, you can mask the lvm2 service(s).

I said in the post that I've masked them, And I'm asking for uninstalling them. Looks impossible.

Offline

#4 2019-03-07 14:20:12

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,615

Re: [SOLVED]removing lvm2

Seems libblockdev will have to be rebuilt "--without-lvm"

Offline

#5 2019-03-07 14:28:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: [SOLVED]removing lvm2

I removed lvm2 and several other members of the base group long ago for similar reasons to yours: I don't use all of that stuff.  There is a discussion (that I don't really follow) on the mailinglists about substantially reducing the 'base' group to what is really fundamental to a working system as it currently includes all sorts of niche stuff.

However, in this case, you have packages installed that depend on lvm2.  Normally, having it installed is pretty harmless as it just sits on disk - this is why I was first surpised about the need to mask the service: even before I removed lvm2, it was never running.  So not only do you have a package that depends on the lvm2 package, but you have a service running that requires that the lvm2 service is running.

Perhaps rebuilding tools as Seth suggests will help, but you might be going down quite a rabit hole there.  If you want to simplify your system, work from the top down: do you need libblockdev?  If so, why?  What depends on libblockdev and do you need that?  Work your way up the dependency tree and clean up from the top down.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2019-03-07 14:29:23

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [SOLVED]removing lvm2

I think it might be possible to uninstall lvm by ignoring dependencies, but I never tried it. libblockdev hard depends on lvm2, but the lvm2 code seems to be in a dynamically loaded module. The same is true for udisks2. You might have to change their configuration to not load the lvm plugins/modules.

/etc/libblockdev/conf.d/00-default.cfg
/etc/udisks2/udisks2.conf


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#7 2019-03-07 14:37:59

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED]removing lvm2

lvm2-monitor was changed to be started by sysinit.target with https://git.archlinux.org/svntogit/pack … c6bc534aab

Offline

#8 2019-03-07 16:45:53

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

Trilby wrote:

I removed lvm2 and several other members of the base group long ago for similar reasons to yours: I don't use all of that stuff.  There is a discussion (that I don't really follow) on the mailinglists about substantially reducing the 'base' group to what is really fundamental to a working system as it currently includes all sorts of niche stuff.

However, in this case, you have packages installed that depend on lvm2.  Normally, having it installed is pretty harmless as it just sits on disk - this is why I was first surpised about the need to mask the service: even before I removed lvm2, it was never running.  So not only do you have a package that depends on the lvm2 package, but you have a service running that requires that the lvm2 service is running.

Perhaps rebuilding tools as Seth suggests will help, but you might be going down quite a rabit hole there.  If you want to simplify your system, work from the top down: do you need libblockdev?  If so, why?  What depends on libblockdev and do you need that?  Work your way up the dependency tree and clean up from the top down.

You can see output of my pacman that listed packages who depends on lvm, my desktop environment and gnome-disks are listed in it, and I want keep them installed.

Offline

#9 2019-03-07 16:47:00

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

progandy wrote:

I think it might be possible to uninstall lvm by ignoring dependencies, but I never tried it. libblockdev hard depends on lvm2, but the lvm2 code seems to be in a dynamically loaded module. The same is true for udisks2. You might have to change their configuration to not load the lvm plugins/modules.

/etc/libblockdev/conf.d/00-default.cfg
/etc/udisks2/udisks2.conf

possible with 'pacman -Rd', but is it safe?

Offline

#10 2019-03-07 17:00:01

progandy
Member
Registered: 2012-05-17
Posts: 5,321

Re: [SOLVED]removing lvm2

I think it should work, but I can't give you a definitive answer, since I did not try it, and actively use LUKS/LVM2.

Last edited by progandy (2019-03-07 17:01:31)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#11 2019-03-07 17:03:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: [SOLVED]removing lvm2

mmdamin wrote:

... and I want keep them installed.

Then keep their dependencies installed.  You can forcibly remove it as noted, but it will come back with the next upgrade unless you block in in your pacman.conf, and still it may give problems.

If you really just want to prevent it from slowing down boot times, you may want to see the active threads on what looks like a bug or config issue with the recent lvm2 package that is resulting in these symptoms.

Last edited by Trilby (2019-03-07 17:04:36)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2019-03-07 17:03:46

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,615

Re: [SOLVED]removing lvm2

Block the plugins, see what happens. If no further problems emerge (some client might semi-hard-depend on some plugins) it should be safe enough.

Offline

#13 2019-03-07 17:11:03

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

Trilby wrote:
mmdamin wrote:

... and I want keep them installed.

Then keep their dependencies installed.  You can forcibly remove it as noted, but it will come back with the next upgrade unless you block in in your pacman.conf, and still it may give problems.

If you really just want to prevent it from slowing down boot times, you may want to see the active threads on what looks like a bug or config issue with the recent lvm2 package that is resulting in these symptoms.

as you said, may I should leaving them installed. I've masked their service and my boot time decreased from 40s to 20s, that was great.

Offline

#14 2019-03-07 17:11:41

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

seth wrote:

Block the plugins, see what happens. If no further problems emerge (some client might semi-hard-depend on some plugins) it should be safe enough.

How? which plugins? I didn't undrestand what you've said.

Offline

#15 2019-03-07 17:15:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: [SOLVED]removing lvm2

mmdamin wrote:

my boot time decreased from 40s to 20s, that was great.

A 20 second delay is exactly what is described in the currently active issue with kernel 5.0 and lvm2 - so perhaps you'd be best just tracking that issue rather than trying to work around it.

(edit: perhaps I was conflating the two issues in my mind - but a notable and troubling delay is certainly reported)

Last edited by Trilby (2019-03-07 17:17:17)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#16 2019-03-07 17:21:44

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

Trilby wrote:
mmdamin wrote:

my boot time decreased from 40s to 20s, that was great.

A 20 second delay is exactly what is described in the currently active issue with kernel 5.0 and lvm2 - so perhaps you'd be best just tracking that issue rather than trying to work around it.

(edit: perhaps I was conflating the two issues in my mind - but a notable and troubling delay is certainly reported)

$ uname -a
Linux mlz 4.20.10-arch1-1-ARCH #1 SMP PREEMPT Fri Feb 15 17:49:06 UTC 2019 x86_64 GNU/Linux
$ systemd-analyze
Startup finished in 10.168s (firmware) + 167ms (loader) + 8.586s (kernel) + 13.025s (userspace) = 31.948s 
graphical.target reached after 10.735s in userspace

note that I said this without 10.168s of firmware,
last time I measured boot time, I didn't use systemd-boot and it didn't measure loading time of firmware.

Offline

#17 2019-03-07 17:57:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,615

Re: [SOLVED]removing lvm2

mmdamin wrote:
seth wrote:

Block the plugins, see what happens. If no further problems emerge (some client might semi-hard-depend on some plugins) it should be safe enough.

How? which plugins? I didn't undrestand what you've said.

You even quoted the relevant post by progandy

Offline

#18 2019-03-07 19:05:31

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

seth wrote:
mmdamin wrote:
seth wrote:

Block the plugins, see what happens. If no further problems emerge (some client might semi-hard-depend on some plugins) it should be safe enough.

How? which plugins? I didn't undrestand what you've said.

You even quoted the relevant post by progandy

Sorry, I didn't take care what you've qouted and what actually progandy said.
I commented lvm om libblockdev.conf but there's nothing in udisks2.conf:

[udisks2]
modules=*
modules_load_preference=ondemand

[defaults]
encryption=luks1

also, pacman -Rd lvm2 doesn't ignore dependencies and still i get error for depending libblockdev on lvm2.

Offline

#19 2019-03-07 20:42:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,615

Re: [SOLVED]removing lvm2

The top of that file should read

[udisks2]
# Comma separated list of modules to load.
# Use asterisk to load all the modules.

on archlinux and also see "pacman -Rh" to understand the options.

Offline

#20 2019-03-07 21:01:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [SOLVED]removing lvm2

seth wrote:

Seems libblockdev will have to be rebuilt "--without-lvm"

I modified the PKGBUILD with the line seth mentioned and removed the deps of both xfsprogs and lvm2 and haven't noticed any ill effects.

Offline

#21 2019-03-08 01:33:39

mmdamin
Member
From: Iran
Registered: 2019-02-19
Posts: 205
Website

Re: [SOLVED]removing lvm2

seth wrote:

The top of that file should read

[udisks2]
# Comma separated list of modules to load.
# Use asterisk to load all the modules.

on archlinux and also see "pacman -Rh" to understand the options.

If I write -R then press Tab on my zsh, I can see list of possible options, there was -Rd option followed by 'skip dependency check'.
I'll found list of modules then put their names there instead of *.

Offline

#22 2019-03-08 01:35:47

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED]removing lvm2

  -d, --nodeps         skip dependency version checks (-dd to skip all checks)

Offline

#23 2019-03-08 12:17:11

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,377

Re: [SOLVED]removing lvm2

[udisks2]
# Comma separated list of modules to load.
# Use asterisk to load all the modules.
modules=*

There doesn't seem to be an option to exclude one module (lvm2) .
man udisks2.conf / udisksd / udisks don't show options to find out which modules are used by udisks2 .
Any idea how to find them ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#24 2019-03-08 13:49:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,615

Re: [SOLVED]removing lvm2

https://github.com/storaged-project/udi … ger.c#L340

pacman -Ql udisks2 | sed '/modules.*so/!d; s/^.*_\([^\.]*\)\.so/\1/g'

Offline

#25 2019-03-08 14:00:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,510
Website

Re: [SOLVED]removing lvm2

OT, but a simpler sed:

pacman -Ql udisks2 | sed -n 's/.*_\(.*\)\.so$/\1/p'

With the -n flag you don't need to delete lots of lines, just print the ones you want.  There is no need for the global 'g' flag as the pattern can't possibly be matched more than once on a line.  The start of line anchor is redundant when the pattern starts with a greedy wildcard '.*' and there is no need to exclude literal dots from the module name - there are no modules with dots in the name, but if there ever were, we'd probably want to see those too.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB