Extroot as / (root) filesystem

I am familiar with the extroot and how to setup it as /overlay. But I want to know if it's possible to copy everything from internal flash to USB and then use it as a / root filesystem. I understand that I cannot boot directly from USB but once the router switches to USB it should only read/write data from USB.

I saw an option in LuCI about mounting the USB drive as root filesystem. So how this will work if it is possible at all? Any advantages or disadvantages of doing this other than /overlay? Thanks

Just a clarification: "/root" is not the root directory, but the home directory for the root user. Is you want to move everything to the USB drive, you must move the root directory "/".

1 Like

Yes I know /root is for home user and / is the actual start of the filesystem. If I copy data from / to USB then it will also copy /tmp /var etc but they are mounted on RAM. So do I also need to copy RAM contents?

If you use a utility like tar or rsync you can exclude paths and/or restrict to a single file system.

So how do I copy most of / to USB and also what should I copy and what should I not? According to wiki I can copy one directory as in /overlay:

tar -C /overlay -xvf - . | tar -C /mnt -xf -

But this will only copy the contents of /overlay to /mnt. It will not copy the overlay directory itself. I can also try to copy every directory one by one as:

tar -C /xxx -xvf - . | tar -C /mnt/xxx -xf -

Will this work?

I would Install a full-fledged tar or rsync rather than play complex games. Also, do anything like this in failsafe mode so the file systems aren’t being written.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.