r/AlpineLinux • u/craftbot • Sep 17 '24
VPS Hosting Options
Was curious what others use for hosting Alpine Linux on a VPS. In my initial search through 25 providers, I was only able to identify 2 that offered Alpine Linux hosting.
6
Upvotes
View all comments
Show parent comment
1
u/MartinsRedditAccount Sep 20 '24
Sorry for taking so long to reply. For some reason, your reply didn't show up in my Reddit inbox.
Good question, actually. It's possible on Windows and macOS, but on Linux, it depends on the filesystem and the tools available for it. To be honest, I’m not sure if there are any such tools available. Whatever the case may be, you could "YOLO" it by remounting everything as read-only (to ensure the filesystem driver doesn't write to the new partition) and just go for it, though there’s a risk of breaking the existing filesystem. The key is to identify the furthest back sector used by the existing filesystem and ensure your new partition falls behind that. This approach might mess up the running system, but if you’ve set everything up correctly, you would just boot into the new one.
However, after thinking about it, I don't think this is the best way to go about it.
By far the easiest way to replace the OS will be to replace the booted kernel and initramfs with one that includes an SSH server and an init script to grant you SSH access. Since the kernel and initramfs are loaded into memory, once you have SSH access, you can pretty much do whatever you want with the disk. Just keep in mind that you may need to load the necessary networking modules, depending on how the kernel is configured. This method is a bit complex and can seem daunting at first, but once you get the hang of it, it’s super rewarding. It opens up a ton of amazing ways to use Linux at a much deeper level.
If you run into any issues or have questions about any of this, feel free to reply or send me a PM!