Discussion:
Cannot delete chroot directory
(too old to reply)
Simon Doppler
2017-11-08 08:47:58 UTC
Permalink
Raw Message
Hi all,

I wanted to create a new build chroot directory with mkarchroot yesterday, and
mistakenly created it in the wrong place. I then interrupted the process but
after it had already created some files but was not finished. (I wanted to
created in ~/chroot/multlib, but wrote ~/multilib).

When I tried to delete the directory (with rm -rf) but I could only delete all
the files it contained. It did not work either after a reboot.

This is my terminal output when I try to delete the directory

[***@tollana dopsi]# LANG=en rm -rf /home/dopsi/multilib
rm: cannot remove '/home/dopsi/multilib': Operation not permitted
[***@tollana dopsi]# lsattr | grep multilib
------------------- ./multilib

I noticed in [1] (the lock function is defined in [2]) that the directory is
locked using flock, but that lock should not survive a reboot (or am I mistaken
?).

Thanks for your help

[1] https://git.archlinux.org/devtools.git/tree/mkarchroot.in#n66
[2] https://git.archlinux.org/devtools.git/tree/lib/common.sh#n75
--
Simon Doppler
E: ***@dopsi.ch
PGP: 5C3A 7347 AE06 D520 68A6 D292 9A08 963D B82F 5A19
Jeanette C. via arch-general
2017-11-08 09:02:00 UTC
Permalink
Raw Message
Nov 8 2017, Simon Doppler has written:
...
Post by Simon Doppler
This is my terminal output when I try to delete the directory
rm: cannot remove '/home/dopsi/multilib': Operation not permitted
------------------- ./multilib
Hey hey Simon,
have you looked at the access rights:
ls -ld multilib
Perhaps, by some freak accident, there is no w attribute. It's the only
thing that springs to mind.

HTH and best wishes,

Jeanette
...

--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c

Skip on the drinks Head to the floor
Makin' my way Past the show
My body's taken over And I want some more <3
(Britney Spears)
Simon Doppler
2017-11-08 10:25:36 UTC
Permalink
Raw Message
Le mercredi, 8 novembre 2017, 10.02:00 h CET Jeanette C. via arch-general a
Post by Jeanette C. via arch-general
...
Post by Simon Doppler
This is my terminal output when I try to delete the directory
rm: cannot remove '/home/dopsi/multilib': Operation not permitted
------------------- ./multilib
Hey hey Simon,
ls -ld multilib
Perhaps, by some freak accident, there is no w attribute. It's the only
thing that springs to mind.
HTH and best wishes,
Jeanette
...
--------
* website: http://juliencoder.de - for summer is a state of sound
* SoundCloud: https://soundcloud.com/jeanette_c
Skip on the drinks Head to the floor
Makin' my way Past the show
My body's taken over And I want some more <3
(Britney Spears)
Hi Jeannette,

I just got an off-list anwer from Florian Pritz that mkarchroot does create a
btrfs subvolume (when the chroot would be in btrfs), which is the case for me.

I used

# btrfs subvolume delete <directory>

to delete the directory.

Thanks both for your help
--
Simon Doppler
E: ***@dopsi.ch
PGP: 5C3A 7347 AE06 D520 68A6 D292 9A08 963D B82F 5A19
Florian Pritz via arch-general
2017-11-08 09:02:01 UTC
Permalink
Raw Message
Post by Simon Doppler
When I tried to delete the directory (with rm -rf) but I could only delete all
the files it contained. It did not work either after a reboot.
If you run btrfs, this is a btrfs subvolume which you need to remove
with `btrfs subvolume delete`.

Florian
Loading...