2

I am trying to do a factory reset mechanism as a command. For that I am following these steps:

  1. Copy the default rootfs files to /tmp
  2. Kill all the currently running processes
  3. Mount tmp as root file system
  4. Copy the contents from tmpfs to previous rootfs partition
  5. reboot

Now, the problem is I am unable to mount the tmpfs as rootfs. I tried using switch_root and pivot_root with no success.

1
  • it's very difficult to know what's stopping you without seeing what happens e.g. error messages. I can tell you that pivot_root has a man page, and other people have used it successfully for quite similar use cases, so I think there should be a way to do what you want unix.stackexchange.com/questions/306406/…
    – sourcejedi
    Aug 17, 2017 at 13:30

0

You must log in to answer this question.

Browse other questions tagged .