But cpio existed when I first used Unix in 1982/3
With pax, the `-k` option will not overwrite existing files. Also not using `-p o` or `-p e` will not preserve rights. I don't know why you would extract and preserve rights to extract binaries in a chroot, usually you would want to control the permissions instead.
I got in and out of it a few times to make sure what I was going to do, then I launched it again (but I didn't add any arguments).
Not only didn't it complain, it defaulted to my root disk, and I ended up destroying my partition table.
Luckily the system was still running and I was able to backup everything before I shut the system down.
https://docs.voidlinux.org/installation/guides/chroot.html#t...
bwrap --bind $HOME/void_chroot/ / --ro-bind /etc/resolv.conf /etc/resolv.conf --rw-bind /home/ /home/ --proc /proc --dev /dev /bin/sh
Instead of xchroot, use bwrap.
I wish I knew this before taking a backup and reformatting.
Always test your backups I guess..
I'd still extract to a local folder as nonroot, though, so still the right conclusion.
Don't take this the wrong way. Nice write up. :)
......
Sudo ... why would you sudo a command that you don't understand?
RTFM ... all of the behaviour you experienced is well documented. There are no surprises.
POSIX and UNIX utils are flexible and powerful. This is why we love them. Don't blame the hammer.
Sandbox anything you extract and review it. Extract in a test environment. Extract without sudo and copy the files and permissions you need.
tar -tv is simply tests the archive and outputs the paths. You ignored what it told you - that it would overwrite ./ :)
#### Never ever do this! $ sudo tar -C / -xvfp xbps-static-latest.x86_64-musl.tar.xz
Insanity.
Cheers :)