I am trying to do a factory reset mechanism as a command. For that I am following these steps:
- Copy the default rootfs files to /tmp
- Kill all the currently running processes
- Mount tmp as root file system
- Copy the contents from tmpfs to previous rootfs partition
Now, the problem is I am unable to mount the tmpfs as rootfs.
I tried using
pivot_root with no success.