dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.57k stars 1.24k forks source link

How would one install their chroot on an external device? This is not an issue, just a question. #4032

Closed alexanderskyequinn closed 5 years ago

alexanderskyequinn commented 5 years ago
name: bionic
encrypted: no
Entering /mnt/stateful_partition/crouton/chroots/bionic...
crouton: version 1-20190120145639~master:5bf96711
release: xenial
architecture: amd64
xmethod: xorg
targets: gnome-desktop
host: version 11316.165.0 (Official Build) stable-channel peppy 
kernel: Linux localhost 3.8.11 #1 SMP Sun Mar 3 22:44:33 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
freon: yes
Unmounting /mnt/stateful_partition/crouton/chroots/bionic...

So. Since I have only 16gb on my internal storage it would be nice to be able to either A: Put the chroot on an external device, Or B: Put applications (mainly Wine) on an external device. Thanks -Josh

DennisLfromGA commented 5 years ago

@TheMinigun,

You can use crouton's '-p' option to specify the path to your external device, see below -

    -p PREFIX   The root directory in which to install the bin and chroot
                subdirectories and data.
                Default: /usr/local, with /usr/local/chroots linked to
                /mnt/stateful_partition/crouton/chroots.

Make sure the storage (SD card/USB drive) is formatted to ext2/3/4.

When you want to enter your chroot and/or launch your desktop use the '-c' option to specify the path to your '/chroots' directory, see below -

    -c CHROOTS  Directory the chroots are in. Default: /usr/local/chroots

Often the external media is mounted 'noexec' so you may have to prefix your script with 'sh' similar to the example below using the start script in the '/bin' directory -

Hope this helps, -DennisLfromGA

alexanderskyequinn commented 5 years ago

Ok. Thanks. Will reopen if this does not work.

alexanderskyequinn commented 5 years ago

@DennisLfromGA How would I use the -c prefix?

Merith-TK commented 5 years ago

The previous answer is not the best way of doing this. First format the drive in any ext partition. Then change the symlink /usr/local/chroots to point to somewhere on the external drive. And install the chroot.

The previous answer would not work well by storing the binaries on the external drive. This would not work because chromos mounts external drives with the noexec permission. Meaning no matter what you do, you can't execute any program at all

Merith-TK commented 5 years ago

The previous answer is not the best way of doing this. First format the drive in any ext partition. Then change the symlink /usr/local/chroots to point to somewhere on the external drive. And install the chroot. I would also recommend changing the external drive partition name with e2label

The previous answer would not work well by all of the tags that one would have to use.

Considering that most chromebooks only have about 16 to 32 gb of storage and even less usable. You want to put it on a external drive to prevent it crashing/running out of storage correct?

DennisLfromGA commented 5 years ago

@Merith-TK,

I think 'the best way' might be subjective but there are definitely other ways of doing it - like symlinking. I did mention the 'noexec' issue and I also mentioned using an 'sh' prefix to circumvent it. It works, I've used it.

Hope this helps, -DennisLfromGA

alexanderskyequinn commented 5 years ago

Ok. Thanks guys. Will reopen if I need more help