I want to test the pivot_root command line, which moves the root file system of the current process to the directory put_old and makes new_root the new root file system. http://man7.org/linux/man-pages/man8/pivot_root.8.htmlBut I always get pivot_root: failed to change root from `.' to `old-root/': Invalid argumentI use fedora as base root, I have a Archlinux in my home folder[root@localhost arch-root]# lsbin  boot  dev  etc  home  lib  lib64  mnt  old-root  opt  proc  root  run  sbin  srv  sys  tmp  usr  var[root@localhost arch-root]# pivot_root . old-root/ pivot_root: failed to change root from `.' to `old-root/': Invalid argumentI also try to call linux function pivot_root(/chroot_test, /chroot_test/old-root);Got same error.Any idea about this ?Update 1:I also try to test pivot_root in Docker.I mount this arch-root in to Docker container. But get the following error: Operation not permittedroot@00d871ce892b:/# cd test_root/root@00d871ce892b:/test_root# lsbin  boot  dev  etc  home  lib  lib64  mnt  old-root  opt  proc  root  run  sbin  srv     sys  test_pivot_root  test_pivot_root.c   tmp  usr  varroot@00d871ce892b:/test_root# pivot_root . tmp/pivot_root: Operation not permittedI have found the solution:Run docker with --privileged=true So we can test pivot_root in the docker container
Linux [admin] How to test pivot_root?
c;linux