I have installed a chroot running xenial onto a 32GB USB drive. I want to clone that to a bigger 256GB USB drive. They are both formatted to Ext-4. When I clone it using this in crosh:
sudo edit-chroot -C ~/media/removable/my_new_drive_name xenial
I get "Chroots can only be copied to ext filesystems." I know they are both formatted to Ext-4, am I doing the wrong command? My model is the Samsung Chromebook 3.
Any help is appreciated.
@thunderbunker,
Your syntax includes the tilde character '~' which pins it to start in your $HOME folder that is encrypted (ecryptfs) so maybe that is all that's wrong with the command. Simply remove the tilde from the beginning of the path you specify like this:
sudo edit-chroot -C/media/removable/my_new_drive_name/xenial
However, if you are copying from external media then you'll need to use the -c option to specify where to find your chroots. Use something like this -
sudo edit-chroot -c/media/removable/my_old_drive_name/chroots -C /media/removable/my_new_drive_name/xenial
The routine that the checks the file system is linked here and shown below -
# Don't allow copying to non-ext filesystems (but don't check if in same directory)
if [ -n "$COPY" -a "${COPY#*/}" != "$COPY" ] && \
df -T "`getmountpoint "$COPY"`" | awk '$2~"^ext"{exit 1}'; then
error 2 "Chroots can only be copied to ext filesystems."
fi
The actual copy routine is linked here.
The check uses df -T on the path you gave it after the -C so you could run it manually to see what is returned, here's what mine shows for a mounted USB stick I named '32GB.EXT4' -
chronos@localhost ~ $ df -T /media/removable/32GB.EXT4/
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sdb ext4 31074284 45052 29427696 1% /media/removable/32GB.EXT4
So it recognizes mine as an ext4 file system.
If you first 'cd' into the location you want it copied to and then specify that path, I think the 'check' will be bypassed according to the comment in the check routine. Something like this might work -
cd /media/removable/my_new_drive_name/chroots
sudo edit-chroot -c /media/removable/my_old_drive_name/chroots -C ./ xenial`
One other option is to first backup your chroot to ~/Downloads and then restore it to your new destination.
Hope this helps,
-DennisL
Thank you for your quick reply. However, since I am copying from an external drive I used the second command:
sudo edit-chroot -c /media/removable/Ext4/chroots -C /media/removable/Mapoo xenial
The output was:
Unmounting /media/removable/Ext4/chroots/xenial...
/media/removable/Mapoo already exists
What does this mean?
Thank you.
@thunderbunker,
The output was:
Unmounting /media/removable/Ext4/chroots/xenial... /media/removable/Mapoo already exists
What does this mean?
I'm not sure, it may be simply because you didn't use the '/' character at the end of the DEST directory as specified in the usage -
DEST can be a directory, in which case it must end in a slash.
I'm sorry I didn't include the '/' ending in my examples above but I've since corrected them.
But you also need to give it the full path to the destination chroots directory, something like:
sudo edit-chroot -c /media/removable/Ext4/chroots -C /media/removable/Mapoo/chroots/ xenial
Hope this helps,
-DennisL
@DennisLfromGA
It is copying right now. Thank you for your help!
Shoot, I came back after 20 minutes and this happened:
Unmounting /media/removable/Ext4/chroots/xenial...
Copying /media/removable/Ext4/chroots/xenial to /media/removable/Mapoo/chroots/xenial
cp: cannot access ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/versions/1.11.2/1.11.2-natives-709467439715’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/launcher.jar’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/launcher_profiles.json’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/options.txt’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/realms_persistence.json’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/servers.dat’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/libraries’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/assets’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/server-resource-packs’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/logs’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/resourcepacks’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.minecraft/saves’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.java’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.gnome’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/home/matthew/.steam’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/lib’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/.crouton-targets’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/lib64’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/proc’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/root’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/run’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/sbin’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/sys’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/tmp’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/usr’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/var’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/media’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/mnt’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/srv’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/opt’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/lib32’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/libx32’: No such file or directory
cp: cannot stat ‘/media/removable/Ext4/chroots/xenial/snap’: No such file or directory
As I can see: I download such applications like minecraft and steam.
What happened?
@thunderbunker,
Sorry, I don't know why it started to error out.
Sometimes a space or other special characters have to be escaped '\' out of the command but it doesn't look like that's the case here.
You could reboot and try again or just use the backup / restore routine I mentioned earlier.
That way you'd also have a fresh backup of your chroot - two birds... ;-)
Hope this helps,
-DennisL
It's actually copied a little differently. However, I can't find the command to run the chroot. The command for the old one was
sudo sh '/media/removable/Ext4/bin/startunity'
I've noticed that the bin folder is under chroots/xenial

That command doesn't work. Strange.
The problem is that I cannot back up the chroot because it is 30 GB. My disk space is only 12 GB max.
How can I run it?
Thanks.
Apparently I found the command:
sudo enter-chroot -c /media/removable/Mapoo/chroots xenial
The output was:
Entering /media/removable/Mapoo/chroots/xenial...
chroot: failed to run command 'su': No such file or directory
WARNING: starting chroot system dbus daemon failed with code 127
chroot: failed to run command 'su': No such file or directory
Unmounting /media/removable/Mapoo/chroots/xenial...
What do I do now to run it?
Thanks in advance.
@thunderbunker,
I've noticed that the bin folder is under chroots/xenial
That may be just xenial's /bin folder.
You may have to install / restore the host-bin files using crouton's '-p' option, something like -
sudo sh ~/Downloads/crouton -b -p /media/removable/Mapoo/
Then try one or more of the following -
sudo startunity -c /media/removable/Mapoo/chroots
cd /media/removable/Mapoo/ ; sudo ./bin/startunity -n xenial
Hope this helps,
-DennisL
@DennisLfromGA
It correctly installed the bin folder! However, I still cannot run it. The first command says that startunity: command not found.
Also, the startunity file in the host-bin is still missing so I can't start it using
sudo sh '/media/removable/Mapoo/bin/startunity' like I always do.
How do I get the startunity file back?
Thanks.
@thunderbunker,
It correctly installed the bin folder!
Then startunity should be in /media/removable/Mapoo/bin/
If it isn't then the restoral of the host-bin files didn't work correctly.
Try this, if it's in /usr/local/bin then it should find it -
sudo startunity -c /media/removable/Mapoo/chroots -n xenial
Also, if you have to use sudo sh ... then you might have to remount your external media as read-write using something like -
sudo mount -o remount,exec /media/removable/Mapoo
Hope this helps,
-DennisL
@DennisLfromGA
I tried the command to install the host-bin files. The usual mount-chroot,edit-chroot, or the unmount-chroot were installed. However, the startunity files still is not installed.
`sudo sh ~/Downloads/crouton -b -p /media/removable/Mapoo/
Downloading latest crouton installer...
Installing enter-chroot into the host...
Installing delete-chroot into the host...
Installing edit-chroot into the host...
Installing mount-chroot into the host...
Installing unmount-chroot into the host...
Installing crash_reporter_wrapper into the host...
Done! You can enter the chroot using enter-chroot.`
Startunity in not installed. Strange.
I tried looking for the folder /usr/local/bin but I couldn't find it. I ran sudo startunity -c /media/removable/Mapoo/chroots -n xenial and it gave me sudo: startunity: command not found
I also ran your last command, but no output was given.
What do I do now?
Cheers, Matt
@thunderbunker,
Something's fishy then,we need more info.
Please post the output of the following command:
sudo edit-chroot -c /media/removable/Mapoo/chroots -all
-DennisL
@DennisLfromGA
I ran the command:
name: xenial
encrypted: no
Entering /media/removable/Mapoo/chroots/xenial...
chroot: failed to run command 'usr/local/bin/croutonversion': no such file or directory
Unmounting /media/removable/Mapoo/chroots/xenial...
What does this mean?
Cheers, Matthew
@thunderbunker,
I'd say it means your chroot is not complete, I suspected that when all of your targets/desktops scripts didn't get restored. Perhaps the copy didn't complete successfully. It might be best to delete the chroot(s) under /media/removable/Mapoo/chroots/ and start over.
Hope this helps,
-DennisL
@DennisLfromGA
What would be that command?
Cheers, Matthew
@thunderbunker,
The command would be the aptly named delete-chroot
Please spend some time with the README, it will save a lot of headaches.
Hope this helps,
-DennisL
@DennisLfromGA
I deleted the chroot successfully. Then, I copied it with the same errors as before. I used sudo enter-chroot -c /media/removable/Mapoo/chroots xenial.
This was the output:
Entering /media/removable/Mapoo/chroots/xenial...
-su: 1: id: not found
-su: 12: [: Illegal number:
-su: 1: /etc/profile.d/crouton-pulseaudio-cras.sh: id: not found
-su: 5: [: Illegal number:
-su: 1: /etc/profile.d/crouton-unity-profiled.sh: /usr/local/bin/croutonversion: not found
-su: 9: mesg: not found
-su: 1: id: not found
-su: 12: [: Illegal number:
-su: 1: /etc/profile.d/crouton-pulseaudio-cras.sh: id: not found
-su: 5: [: Illegal number:
-su: 1: /etc/profile.d/crouton-unity-profiled.sh: /usr/local/bin/croutonversion: not found
-su: 9: mesg: not found
-su: 1: id: not found
-su: 12: [: Illegal number:
-su: 1: /etc/profile.d/crouton-pulseaudio-cras.sh: id: not found
-su: 5: [: Illegal number:
-su: 1: /etc/profile.d/crouton-unity-profiled.sh: /usr/local/bin/croutonversion: not found
-su: 9: mesg: not found
Unable to cd to '/home/matthew'
Unmounting /media/removable/Mapoo/chroots/xenial...
(Also, how do you use markdown so that the code is neat and are in lines? Thanks.)
So then, I tried to install the bin files using:
sudo sh ~/Downloads/crouton -b -p /media/removable/Mapoo/
It said crouton wasn't found. That was because I was running a different account on the Chromebook. So I downloaded crouton on the other downloads folder. I installed the bin files and startunity downloaded, yippee!
Now, I try the sudo sh '/media/removable/Mapoo/bin/startunity' it should work. It doesn't.
It gives me Entering /media/removable/Mapoo/chroots/xenial...
-su: 1: id: not found
-su: 12: [: Illegal number:
-su: 1: /etc/profile.d/crouton-pulseaudio-cras.sh: id: not found
-su: 5: [: Illegal number:
-su: 1: /etc/profile.d/crouton-unity-profiled.sh: /usr/local/bin/croutonversion: not found
-su: 9: mesg: not found
-su: 1: id: not found
-su: 12: [: Illegal number:
-su: 1: /etc/profile.d/crouton-pulseaudio-cras.sh: id: not found
-su: 5: [: Illegal number:
-su: 1: /etc/profile.d/crouton-unity-profiled.sh: /usr/local/bin/croutonversion: not found
-su: 9: mesg: not found
-su: 1: id: not found
-su: 12: [: Illegal number:
-su: 1: /etc/profile.d/crouton-pulseaudio-cras.sh: id: not found
-su: 5: [: Illegal number:
-su: 1: /etc/profile.d/crouton-unity-profiled.sh: /usr/local/bin/croutonversion: not found
-su: 9: mesg: not found
Unable to cd to '/home/matthew'
Unmounting /media/removable/Mapoo/chroots/xenial... again.
What do I do now? I thought I had it.
Cheers, Matt.
Most helpful comment
@DennisLfromGA
It is copying right now. Thank you for your help!