bedrocklinux / bedrocklinux-userland

This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
https://bedrocklinux.org
GNU General Public License v2.0
603 stars 64 forks source link

(Feature Request) Moving stratums to non /bedrock path #179

Open Titaniumtown opened 4 years ago

Titaniumtown commented 4 years ago

Can support be implemented to move a stratum to another path that isn't /bedrock?

paradigm commented 4 years ago

Not without a substantial amount of work and additional code complexity.

What is your use case for this?

Titaniumtown commented 4 years ago

I have a raspberry pi running bedrock linux, and it's sd card is really slow, so I was thinking I could move statums to my ssd that I have attached to it.

paradigm commented 4 years ago

That doesn't require moving strata out of /bedrock. In theory you could make other partitions accessible in /bedrock via mounts to get the desired effect.

Currently strata need to be part of the same mount point as /bedrock. One of the higher priority tasks on my plate is a large refactor of the relevant subsystem, and I'm planning on removing this limitation while working on that. I'm hoping to have that done before the end of the year, but I can't make any guarantees.

Titaniumtown commented 4 years ago

Oh ok, I'm looking forward to it then! Keep up the good work!

cptpcrd commented 4 years ago

I have a raspberry pi running bedrock linux, and it's sd card is really slow, so I was thinking I could move statums to my ssd that I have attached to it.

In the case of a Pi, you could move the root partition to the SSD. There are two slightly different ways to do things like this:

  1. On a Pi 2B v1.2 or a Pi 3 (Pi 4 support is in the works), you can use USB mass storage boot to boot directly off an external drive. This lets you remove the SD card completely and put both /boot and / on the external drive. Note that on a Pi 0, 1, or 2, you can achieve the same effect by inserting an SD card that just has bootcode.bin on it. See this page for details.
  2. On any Pi, you can put /boot on the SD card and have it look for / on a separate hard drive. This answer on Raspberry Pi Stack Exchange gives a quick tutorial (note that if you follow the steps it will WIPE your external drive).

Note that you should still be able to get both of these to work under Bedrock, but you probably would have to plug the SD card and SSD into a separate machine to do the setup. Trying to copy files over while Bedrock is running could cause issues (I'm thinking etcfs, crossfs, and /bedrock/strata in particular would behave strangely).

Obviously, this is a very specific solution for your use case. I'm just giving brief details since this is way out of scope for the Bedrock repo, but based on these you can probably Google around/look on RPi Stack Exchange and figure something out.

Titaniumtown commented 4 years ago

Thanks for the info @cptpcrd

I am on raspberry pi 4. I have a 128GB microsd card, so storage isn't the problem, it's speed. The only issue with not booting from usb is that I am using up all my usb 3 ports! I have a single 1TB hdd in an external enclosure, and a 256GB ssd connected via a sata to ssd adapter. I use the 1TB hdd as long term storage for files, and I use my SSD for compiling programs, my ccache, and my swapfile.

So, both of these can't be replaced or wiped to become a root partition. That's why I thought it would be nice to have support to just move one stratum to another folder. For instance, I could move my main statum (arch linux arm) to my ssd, and my x86_64 statums to my hdd, as I don't use the x86_64 stratums that much, only for compiling for x86_64.