You are not logged in.

#1 2016-07-12 12:00:20

juna
Member
Registered: 2012-04-02
Posts: 21

"Operation not permitted" when updating lvm2

Dear all,

today I got the following error message while updating (reproduced by reinstalling the package):

$ sudo pacman -S lvm2
warning: lvm2-2.02.160-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) lvm2-2.02.160-1

Total Installed Size:  5.27 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                                                                      [######################################################################] 100%
(1/1) checking package integrity                                                                                    [######################################################################] 100%
(1/1) loading package files                                                                                         [######################################################################] 100%
(1/1) checking for file conflicts                                                                                   [######################################################################] 100%
(1/1) checking available disk space                                                                                 [######################################################################] 100%
:: Processing package changes...
error: cannot remove /usr/lib/libdevmapper-event-lvm2thin.so (Operation not permitted)
(1/1) reinstalling lvm2                                                                                             [######################################################################] 100%
warning: warning given when extracting /usr/lib/libdevmapper-event-lvm2thin.so (Could not remove symlink /usr/lib/libdevmapper-event-lvm2thin.so)
:: Running post-transaction hooks...
(1/1) Updating manpage index...

/usr/lib/libdevmapper-event-lvm2thin.so is indeed a symlink like so

$ ls -l /usr/lib/libdevmapper-event-lvm2thin.so  
lrwxrwxrwx 1 root root 44 Jun 26 21:33 /usr/lib/libdevmapper-event-lvm2thin.so -> device-mapper/libdevmapper-event-lvm2thin.so

/usr/lib is write-able for root

$ ls -ld /usr/lib
drwxr-xr-x 202 root root 151552 Jul 12 13:48 /usr/lib

The file the symlink points to is not, but that shouldn't matter, right?

$ ls -l /usr/lib/device-mapper/libdevmapper-event-lvm2thin.so
-r-xr-xr-x 1 root root 18880 Jul  6 20:48 /usr/lib/device-mapper/libdevmapper-event-lvm2thin.so

The following strace output did not tell me much but might be insightful for someone else

$ sudo strace -f pacman --noconfirm -S lvm2 2>&1| grep /usr/lib/libdevmapper-event-lvm2thin.so
lstat("/usr/lib/libdevmapper-event-lvm2thin.so", {st_mode=S_IFLNK|0777, st_size=44, ...}) = 0
access("/usr/lib/libdevmapper-event-lvm2thin.so", W_OK) = 0
lstat("/usr/lib/libdevmapper-event-lvm2thin.so", {st_mode=S_IFLNK|0777, st_size=44, ...}) = 0
unlink("/usr/lib/libdevmapper-event-lvm2thin.so") = -1 EPERM (Operation not permitted)
write(2, "cannot remove /usr/lib/libdevmap"..., 80cannot remove /usr/lib/libdevmapper-event-lvm2thin.so (Operation not permitted)
lstat("/usr/lib/libdevmapper-event-lvm2thin.so", {st_mode=S_IFLNK|0777, st_size=44, ...}) = 0
lstat("/usr/lib/libdevmapper-event-lvm2thin.so", {st_mode=S_IFLNK|0777, st_size=44, ...}) = 0
unlink("/usr/lib/libdevmapper-event-lvm2thin.so") = -1 EPERM (Operation not permitted)
write(2, "warning given when extracting /u"..., 137warning given when extracting /usr/lib/libdevmapper-event-lvm2thin.so (Could not remove symlink /usr/lib/libdevmapper-event-lvm2thin.so)
[pid 11976] stat("/usr/lib/libdevmapper-event-lvm2thin.so", {st_mode=S_IFREG|0555, st_size=18880, ...}) = 0
[pid 11976] open("/usr/lib/libdevmapper-event-lvm2thin.so", O_RDONLY) = 4

Any hints on what's going wrong here or how to investigate further are appreciated.

Offline

#2 2016-07-12 12:20:39

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: "Operation not permitted" when updating lvm2

What's the output of 'lsattr /usr/lib/device-mapper/libdevmapper-event-lvm2thin.so'?


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2016-07-12 13:00:26

juna
Member
Registered: 2012-04-02
Posts: 21

Re: "Operation not permitted" when updating lvm2

R00KIE wrote:

What's the output of 'lsattr /usr/lib/device-mapper/libdevmapper-event-lvm2thin.so'?

$ lsattr /usr/lib/device-mapper/libdevmapper-event-lvm2thin.so
--------------e---- /usr/lib/device-mapper/libdevmapper-event-lvm2thin.so

Offline

#4 2016-07-12 15:15:32

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: "Operation not permitted" when updating lvm2

No immutable attribute, that leaves me out of ideas.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2016-07-13 09:42:18

juna
Member
Registered: 2012-04-02
Posts: 21

Re: "Operation not permitted" when updating lvm2

R00KIE wrote:

No immutable attribute, that leaves me out of ideas.

Thanks for the hint anyway.

So this seems to not be a pacman problem because I also cannot remove the symlink by hand:

$ sudo rm /usr/lib/libdevmapper-event-lvm2thin.so  
rm: cannot remove '/usr/lib/libdevmapper-event-lvm2thin.so': Operation not permitted

Offline

#6 2016-07-13 11:10:22

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: "Operation not permitted" when updating lvm2

What filesystem are you using? I would try to boot from the install media and (force) fsck all the filesystems, just to make sure everything is ok.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2016-07-13 12:43:22

juna
Member
Registered: 2012-04-02
Posts: 21

Re: "Operation not permitted" when updating lvm2

I'm using ext4. Did a forced fsck, which found nothing.

Offline

Board footer

Powered by FluxBB