You are not logged in.
Quick cheatsheet:
sudo -i
mkdir -p /mnt/chroot # call it what you like :)
mount /dev/sdXZ /mnt/chroot
for i in /proc /sys /dev /dev/pts; do mount --bind $i /mnt/chroot$i; done
#start root shell in chrooted partition
chroot /mnt/chroot /bin/bash
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
OK, I was able to chroot into my Unstable partition. However, when I attempted to apt update, the repos used were from the applicable apt configuration files on my BL-Hydrogen partition, not on my BL-Unstable partition.
I don't know if it matters, but when I attempted to
cp /etc/resolv.conf $TARGET/etc/
I received the following error message:
cp: not writing through dangling symlink '/media/sda3/etc/resolv.conf'
sda3 is the partition containing BL-Unstable.
Apologies if I've hijacked for hijacking duckie's thread. :8
Last edited by KrunchTime (2017-07-12 03:10:47)
Offline
I assume the sudo su is the chroot part.
Edit: My assumption was correct.
No and nope, respectively.
`sudo su` just attains a (non-login) root shell, the chrooting is done by... the `chroot` command
when I attempted to apt update, the repos used were from the applicable apt configuration files on my BL-Hydrogen partition, not on my BL-Unstable partition
You must have done it wrong then.
Try again from the very top and this time please be sure to post the actual terminal output rather than a vague description and please include your terminal inputs in the post so that we can see if you have made a mistake anywhere.
The "cheetsheet" given by damo in this post will get the job done, there is no need to copy resolv.conf anywhere
Offline
Quick cheatsheet:
sudo -i mkdir -p /mnt/chroot # call it what you like :) mount /dev/sdXZ /mnt/chroot for i in /proc /sys /dev /dev/pts; do mount --bind $i /mnt/chroot$i; done #start root shell in chrooted partition chroot /mnt/chroot /bin/bash
To complete damo's cheatsheet...
When you're finished, CTRL-D to exit chroot, then:
umount -R /mnt
exit
Edited per HoaS's response below.
Last edited by KrunchTime (2017-07-14 06:17:25)
Offline
for i in /proc /sys /dev /dev/pts; do umount -l /mnt/chroot$i; done umount -l /dev/sdXZ exit
I don't think you can control the device nodes from the chroot so `exit` would have to be called first
Simpler version:
exit
umount -R /mnt
exit
Or just call `reboot` after exiting the chroot — systemd will make sure everything is umounted correctly before shutting down
Last edited by Head_on_a_Stick (2017-07-14 06:07:04)
Offline
I don't think you can control the device nodes from the chroot so `exit` would have to be called first
When you're finished, CTRL-D to exit chroot,
Last edited by KrunchTime (2017-07-14 06:05:01)
Offline
^ D'oh! Sorry! :8
Anyway, `umount -R /mnt` is all that is needed.
There is no need to also attempt `umount` on /dev/sdXY afterwards; generally speaking the command should be used on the mount point rather than the device.
Last edited by Head_on_a_Stick (2017-07-14 06:08:49)
Offline
^ D'oh! Sorry! :8
Not a problem.
Anyway, `umount -R /mnt` is all that is needed.
There is no need to also attempt `umount` on /dev/sdXY afterwards; generally speaking the command should be used on the mount point rather than the device.
Thank you. I'll change my response.
Last edited by KrunchTime (2017-07-14 06:15:24)
Offline