How can I rename /proc
to something else forcefully?
mv /proc /0
gives
mv: cannot move ‘/proc’ to ‘/0’: Device or resource busy
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityYou cannot rename a directory on which a filesystem is currently mounted.
(Why not? I expect it would mess up a lot of kernel data structures that keep track of mounted filesystems.)
Linux lets you change the directory that a filesystem is mounted on, however. You can do this:
mkdir /0
mount --move /proc /0
After this, the proc filesystem will be mounted on /0
, and /proc
won't be a mount point anymore.
Don't do this on a production system, of course. It won't completely break your system, however, it'll just make some programs work badly or not at all (for example, say goodbye to ps
). Keep a root shell open, and run mount --move /0 /proc
to get the proc filesystem back where applications look for it.
/proc
is simply going to break things. Quite a few user space utilities, like ps(1) for example, expect/proc
to be/proc
. What you're trying to do is like trying to take a sedan and replace its steering wheel with a football and its dashboard with a cup of coffee before asking why on earth do the readings look funny.