Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't launch chroot after moving debian to sd card #3959

Closed
Taylormsz opened this issue Dec 10, 2018 · 5 comments
Closed

Can't launch chroot after moving debian to sd card #3959

Taylormsz opened this issue Dec 10, 2018 · 5 comments

Comments

@Taylormsz
Copy link

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,,,

@DennisLfromGA
Copy link
Collaborator

@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

@Taylormsz
Copy link
Author

Taylormsz commented Dec 10, 2018

@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

@DennisLfromGA
Copy link
Collaborator

@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

@Taylormsz
Copy link
Author

@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!!

@DennisLfromGA
Copy link
Collaborator

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

(closing this issue since it seems to be resolved)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants