I have to mount five of my main directories viz. (/home, /usr, /tmp, /root and /var) for a specific project. I did some googling and found out a set of commands which can be executed to mount a particular directory. The commands were as follows:
#dd if=/dev/zero of=/filesystems/tmp_fs seek=512 count=80000000 bs=1M
#mkfs.ext3 /filesystems/tmp_fs
After mounting, the entry was registered in fstab as below,
/filesystems/tmp_fs /tmp ext3 noexec,nosuid,loop 1 1
And at the last step, the directory was mounted.
I followed the same procedure for mounting all the directories specified above. In the end, I could only mount "/root" and "/tmp" directories without any errors. Rest all the three directories gave some or the other error. After mounting '/home' directory, I am getting the following error "No directory. logging in with HOME=/" and similarly after mounting '/var' directory I got the following error "/var/lib/apt//lists No such file or directories". Mounting of '/usr' directory caused the OS to crash as a result of which we could not even login as root user and also some basic commands like 'vi' and 'sudo su', to name a few were not found in the system. ecause of these issues, the only option left was to format the OS since we could not even revert this step because of the missing commands.
Any help or suggestion here in the right direction would be of great help here.
Thanks for the consideration.