Cannot delete chroot directory

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot delete chroot directory

Simon Doppler
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

[root@tollana dopsi]# LANG=en rm -rf /home/dopsi/multilib
rm: cannot remove '/home/dopsi/multilib': Operation not permitted
[root@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: [hidden email]
PGP: 5C3A 7347 AE06 D520 68A6 D292 9A08 963D B82F 5A19

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cannot delete chroot directory

arch general mailing list-2
Nov 8 2017, Simon Doppler has written:
...
> This is my terminal output when I try to delete the directory
>
> [root@tollana dopsi]# LANG=en rm -rf /home/dopsi/multilib
> rm: cannot remove '/home/dopsi/multilib': Operation not permitted
> [root@tollana dopsi]# lsattr | grep multilib
> ------------------- ./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)
Reply | Threaded
Open this post in threaded view
|

Re: Cannot delete chroot directory

arch general mailing list-2
In reply to this post by Simon Doppler
On 08.11.2017 09:47, Simon Doppler wrote:
> 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


signature.asc (875 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Cannot delete chroot directory

Simon Doppler
In reply to this post by arch general mailing list-2
Le mercredi, 8 novembre 2017, 10.02:00 h CET Jeanette C. via arch-general a
écrit :

> Nov 8 2017, Simon Doppler has written:
> ...
>
> > This is my terminal output when I try to delete the directory
> >
> > [root@tollana dopsi]# LANG=en rm -rf /home/dopsi/multilib
> > rm: cannot remove '/home/dopsi/multilib': Operation not permitted
> > [root@tollana dopsi]# lsattr | grep multilib
> > ------------------- ./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)
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: [hidden email]
PGP: 5C3A 7347 AE06 D520 68A6 D292 9A08 963D B82F 5A19

signature.asc (499 bytes) Download Attachment