If I made a backup of /usr with:
# cp -r /usr /usrRESERVE1
how can i switch it back after some time:
1# mv usr usrRESERVE2
2# mv usrRESERVE1 usr
second command will not work because mv is inside /usr/bin/mv and it does not exist after first line execution.
//answering to my self...
Solution 1: Using 'mount --bind' as dummy-var
(pointed by comment of user MarkPlotnick):
# mount --bind /usrRESERVE1 /usr #usr points --to--> usrRES1 from now
# mkdir /dummy
# mount --bind / /dummy #contains original root folders
# cd /dummy ; mv usr usrRESERVE2
# mv usrRESERVE1 usr
# cd / ; umount dummy ; umount usr ; rmdir dummy
Solution 2: using single process - moving tool
# package manager install mmv
# mmv /usr /usrRESERVE1 -- /usrRESERVE2 /usr