Closed cab-1729 closed 11 months ago
Please post more details about what you are trying to do exactly, the commands used and the error messages received.
Suppose I create an encrypted, persistent device using this script. With the device attached to my current device, which is running arch, how do I chroot into the portable device. I know the encryption can be managed with:
cryptsetup luksOpen device name
mount /dev/mapper/name /mnt/mountpoint
After that how do I chroot into the device? Normal arch-chroot
doesn't work.
It's an orverlay filesystem.
https://wiki.archlinux.org/title/Overlay_filesystem
I will post an example with the commands needed to successfully chroot
The mount command given in the archwiki doesn't work for some reason:
[cab1729@arch ~]$ doas mount -t overlay overlay -o upperdir=/mnt/ssd/persistent_AUICO_m6x/x86_64/upperdir,workdir=/mnt/ssd/persistent_AUICO_m6x/x86_64/workdir /mnt/merged/
mount: /mnt/merged: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
dmesg(1) may have more information after failed mount system call.
The lowerdir is missing. Mount the squashfs image airootfs.sfs located in the first partition. Example, assuming usb device /dev/sdb:
$ sudo mkdir /mnt/p1 /mnt/squashfs
$ sudo mount -o ro /dev/sdb1 /mnt/p1
$ sudo mount -o ro,loop /mnt/p1/arch/x86_64/airootfs.sfs /mnt/squashfs
Mount the overlay filesystem :
$ sudo mount -t overlay overlay -o lowerdir=/mnt/squashfs,upperdir=/mnt/ssd/persistent_AUICO_m6x/x86_64/upperdir,workdir=/mnt/ssd/persistent_AUICO_m6x/x86_64/workdir /mnt/merged
Mount the boot partition:
sudo mount /dev/sdb2 /mnt/merged/boot
Chroot:
$ sudo arch-chroot /mnt/merged
Niiiiiiice. Thanks.
Any idea how to chroot into this from an existing arch setup? Simple arch-chroot doesn't work.