Crouton: Can't launch chroot after moving debian to sd card

Created on 10 Dec 2018  ·  5Comments  ·  Source: dnschneid/crouton

sudo edit-chroot -m /media/removable/sdcard debian
sudo sh ~/Downloads/crouton -b -p "/media/removable/sdcard/"
sudo enter-chroot

Please paste the output of the following command here: sudo edit-chroot -all
No chroots found in /mnt/stateful_partition/crouton/chroots

Please describe your issue:

I moved my debian to my sd card with the first command, then tried to sudo enter-chroot but it couldn't find the chroot. So I used the second command hoping to rebuild it, it did create a bin folder under my sdcard, but it still couldn't find chroot.
Before moving debian I tried to install a new chroot and changing the sym link of /usr/local/chroots to /media/removable/sdcard/chroots/chroots with sudo ln -s -f /media/removable/sdcard/chroots/chroots, which resulted in the symlinks in /mnt/stateful_partition/crouton/chroots to change to the sdcard destinations as well, chroots to chroots/chroots, bin to chroots/bin. I didn't realize this before moving debian...

If known, describe the steps to reproduce the issue:

T___T what do I do to get my chroots folder back cause it's not anywhere now,,,

Most helpful comment

You're very welcome, glad it's all ironed out.

(closing this issue since it seems to be resolved)

All 5 comments

@Taylormsz,

Can you show us the output of: ls -l /media/removable/sdcard

I think most likely your entire chroot is now under /media/removable/sdcard/debian/.
If so, since crouton needs both a /chroots/ & /bin/ folder hieracrchy, I would suggest doing the following to move it:

sudo mkdir -p /media/removable/sdcard/chroots/
sudo mv /media/removable/sdcard/debian/ /media/removable/sdcard/chroots/
sudo cp -a /usr/local/bin /media/removable/sdcard/

Hope this helps,
-DennisLfromGA

@DennisLfromGA

Hi Dennis! Thank you so much for the reply!

here's what's in the sdcard directory:
chronos@localhost ~/Downloads/crouton-master $ ls -l /media/removable/sdcard/
total 24
drwxr-xr-x 2 root root 4096 Dec 9 16:39 bin
drwxr-xr-x 21 root root 4096 Oct 2 23:35 debian
drwx------ 2 root root 16384 Dec 9 14:21 lost+found

I think I deleted chroots directory from the sdcard after the attempted installation/deletion of the new chroot because I wanted to clear the card for moving my debian over...
Hence this is what's in the debian folder now:
chronos@localhost ~/Downloads/crouton-master $ ls -l /media/removable/sdcard/debian/
total 76
drwxr-xr-x 2 root root 4096 Nov 11 05:59 bin
drwxr-xr-x 2 root root 4096 Jun 26 05:03 boot
drwxr-xr-x 2 root root 4096 Jun 26 05:03 dev
drwxr-xr-x 75 root root 4096 Dec 9 15:56 etc
drwxr-xr-x 3 root root 4096 Jul 21 18:16 home
drwxr-xr-x 12 root root 4096 Jul 21 18:52 lib
drwxr-xr-x 2 root root 4096 Jul 21 18:12 lib64
drwxr-xr-x 2 root root 4096 Dec 9 15:56 media
drwxr-xr-x 2 root root 4096 Jul 21 18:12 mnt
drwxr-xr-x 3 root root 4096 Sep 21 18:33 opt
drwxr-xr-x 2 root root 4096 Jun 26 05:03 proc
drwx------ 5 root root 4096 Nov 27 13:11 root
drwxr-xr-x 2 root root 4096 Jul 21 18:15 run
drwxr-xr-x 2 root root 4096 Dec 5 20:08 sbin
drwxr-xr-x 2 root root 4096 Jul 21 18:12 srv
drwxr-xr-x 2 root root 4096 Jun 26 05:03 sys
drwxrwxrwt 2 root root 4096 Jun 26 05:03 tmp
drwxr-xr-x 10 root root 4096 Jul 21 18:12 usr
drwxr-xr-x 12 root root 4096 Jul 21 18:12 var

I tried installing a new chroot on another sd card but I kept running into keyring issues, I did wipe the installation cache and download another copy of crouton but I still don't have the keyring folder, all I have is key-debug but I don't know how to fix it...
chronos@localhost ~/Downloads/crouton-master $ ls /usr/share/key
request-key-debug.sh
chronos@localhost ~/Downloads/crouton-master $ ls /usr/share/keyutils/
request-key-debug.sh

If I messed up too bad I am more than willing and happy to start over. I am sorry about the trouble...

T___T

@Taylormsz,

Your external sdcard crouton directories are almost correct. The /bin folder is in the right place but the /chroots folder is missing it seems. To get your debian chroot setup correctly try the following:

sudo mkdir /media/removable/sdcard/chroots 
sudo mv /media/removable/sdcard/debian  /media/removable/sdcard/chroots

If that succeeded you should have the following on the sdcard:

/media/removable/sdcard/bin
/media/removable/sdcard/chroots/debian

Of course, the debian folder will have several sub-folders as you show above.

At this point you may be able to do a crouton update to fix your keyring issues, do that with:

sudo sh ~/Downloads/crouton -n debian -p /media/removable/sdcard -u

Hope this helps,
-DennisLfromGA

@DennisLfromGA

OMG it worked like a charm! Thank you so much!! ^___^

Entered chroot with:
sudo sh /media/removable/sdcard/bin/enter-chroot -n debian

Everything runs smoothly now!! Thank you again!!

You're very welcome, glad it's all ironed out.

(closing this issue since it seems to be resolved)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harryprince picture harryprince  ·  3Comments

jeremyckahn picture jeremyckahn  ·  5Comments

shichuzhu picture shichuzhu  ·  5Comments

anonymouseprogrammer picture anonymouseprogrammer  ·  4Comments

tedm picture tedm  ·  3Comments