Physical Devices  «Prev 

The fuser command

In the Solaris operating system, mount and unmount operations are used to attach and detach file systems from the system's directory hierarchy. Here's how to perform these operations:

Mounting a File System:

  1. Create a mount point directory where the file system will be attached. For example, you can create a mount point directory named /mnt/data:
    # mkdir /mnt/data
    
  2. Use the mount command to attach the file system to the mount point directory. For example, to attach a file system located on the device /dev/dsk/c0t0d0s7 to the /mnt/data directory, use the following command:
    # mount /dev/dsk/c0t0d0s7 /mnt/data
    
  3. Verify that the file system has been mounted by running the df command to display information about mounted file systems:
    # df -h /mnt/data
    

Unmounting a File System:

  1. Use the umount command to detach the file system from its mount point. For example, to detach the file system mounted at /mnt/data, use the following command:
    # umount /mnt/data
    
  2. Verify that the file system has been unmounted by running the df command again:
    # df -h /mnt/data
    

    If the file system is no longer listed in the output of the df command, it has been successfully unmounted.
Note that unmounting a file system that is currently in use by a running process can cause data loss or other issues. Before unmounting a file system, ensure that no processes or users are currently accessing it.

Mounting and unmounting using Solaris

After the simulation has finished loading, click the Start Simulation button to begin your exploration of mounting and unmounting using Solaris.

Answer File 1
1) Initial Prompt
Answer File 2
2) volcheck -v /dev/diskette0
Answer File 3
3) /dev/diskette0 has media
Answer File 4
4) cd /floppy/floppy0
Answer File 5
5) eject: /floppy: device is busy
Answer File 6
6) /usr/sbin/fuser -u /floppy/floppy0
Answer File 7
7) ls -l /floppy/floppy0
Answer File 8
8) eject /floppy
Answer File 9
9) /floppy/floppy0: 13211c(root)
  1. You are logged in as a superuser and have inserted the floppy disk into the drive. Type volcheck -v /dev/diskette0 to verify that the floppy device is mounted.
  2. Verify floppy disk mounted
  3. volcheck -v /dev/diskette0
  4. The command you have entered is incorrect. Please check the instructions and try again.
  1. You can unmount the floppy using the |||(S7)eject|||(S0) command. But first, let's look at what occurs if you attempt to eject a floppy when a directory is active. To test this, change to the /floppy0 directory. Remember that floppy0 is the root directory of the floppy disk. It is located in the /floppy directory.
  2. Attempt to eject floppy
  3. cd /floppy/floppy0
  4. Type cd /floppy/floppy0 to change to the /floppy0 directory
  1. Now, try to eject the floppy by typing eject /floppy.
  2. Eject floppy,
  3. eject /floppy
  4. The command you have entered is incorrect. Please check the instructions and try again.
  1. You received a "device is busy" message. Type /usr/sbin/fuser -u /floppy/floppy0 to learn exactly why you received this message. The -u option will show any user names accessing any directories
  2. Show user names,
  3. /usr/sbin/fuser -u /floppy/floppy0
  4. The command you have entered is incorrect. Please check the instructions and try again.
  1. You can see that you (root) are currently accessing the /floppy/floppy0 directory. This is why the c indicator is listed. Now that you tested this, use your floppy disk to back up the files in your /etc directory. First, change to the /etc directory.
  2. Change directory,
  3. cd /etc
  4. Type cd /etc to change to the /etc directory.