Here are the instructions for this simulation:
During the process of mounting and unmounting in Linux, which physical devices are mounted.
You are logged in as a superuser. Type
mount -t ext2 /dev/fd0 /mnt
to mount the fd0 (floppy disk) filesystem onto the /mnt directory.1
1You are using /mnt as the mount-point for your floppy disk. Type mount to verify that you have mounted /dev/fd0 on /mnt.
1 Notice that /dev/fd0 is now mounted on /mnt type ext2 (rw). You can unmount /mnt using the umount command. But first, let’s look at what occurs if you attempt to unmount a directory that is active. To test this, change to the /mnt directory.
Try to unmount the directory by typing
umount /mnt
.
You received a "device is busy" message. Type /usr/sbin/fuser -v -m /mnt to learn exactly why you received this message.
You can see that you (root) are currently accessing the /mnt directory. This is why the c indicator is listed beneath the ACCESS entry. Now that you have tested this, use your floppy disk to back up the files in your /etc directory. First, change to the /etc directory.
Type cp * /mnt to copy all files in the /etc directory to the floppy disk.
Note that you have copied only the files in the /etc directory. This is why you received messages that cp is omitting directories. Type ls –l /mnt to list all the files on the floppy disk mount point (/mnt).
Remember that you are in the /etc directory. Use the umount command to unmount the /mnt directory.
Consider what would occur if you were to mount a filesystem at a mount-point that is actually a populated directory. Contrary to what you might think, the files are not erased. However, the files and filesystem that exist in the already-populated directory will be covered up by the files and filesystem on the device mounted on it. To test this, you will create a subdirectory of your home directory named mntpt. You will then create two files in the /home/user1/mntpt directory, and then mount the floppy system over the mntpt directory. First, change to the /home/user1
directory.
Create a subdirectory named mntpt.
Change to the mntpt subdirectory.
Use the touch command to create an empty file named xfile.
Use the touch command again to create a second empty file named yfile.
Use the touch command to create a third empty file named zfile.
Type ls –l to list the contents of the /mntpt directory.
You must get out of the /home/user1/mntpt directory, or you will not be able to mount it. It is common to run into problems in this regard, especially if you want to mount a directory that you are accessing in another shell. Change to the /root directory so you can mount /dev/fd0 onto the
/home/user1/mntpt
directory.
Type mount -t ext2 /dev/fd0 /home/user1/mntpt to mount /dev/fd0 onto the /home/user1/mntpt directory.
Type ls -l /home/user1/mntpt to list the contents of the mntpt directory.
You can now see the contents of the floppy disk, rather than the files named xfile, yfile, and zfile. This is because you used the mntpt directory as a mount point for your floppy disk. Now, type
umount /home/user1/mntpt
to unmount the /home/user1/mntpt directory.
Type ls -l /home/user1/mntpt to list the directory again.
Notice that you see the three files you created earlier, rather than the files contained within the /etc directory. This is because you are no longer mounting