Sample Header Ad - 728x90

Updating root filesystem remotely in-place

4 votes
1 answer
3358 views
Let's say one has only remote access (SSH) to an embedded Linux device and the goal is to upgrade the OS to a new version. The device has only one partition, but there's easily more than 50% unused space and the device has about 256 MB of RAM to work with. How would one go about doing that? I'm thinking the solution would probably involve tempfs and pivot_root. Here's my vague idea for how to do this: 1. upload new rootfs structure to a directory on the device 2. mount a tempfs in RAM and copy over required system resources to keep the system running while the rootfs is being worked on 3. change root to the tempfs using pivot_root or chroot or both, not quite sure 4. copy the rootfs structure from the uploaded directory to replace the old 5. reboot to the new version of the OS Now, I'm thinking this sounds too simple to actually work. Can you please poke holes in my plan and tell me what I missed or better yet give me pointers to how to do it right? Does anybody have experience in doing something like this?
Asked by Janne Oksanen (141 rep)
Feb 5, 2018, 02:37 PM
Last activity: May 1, 2025, 03:03 AM