lab9 Filesystem
  • Introduction
  • Important Commands
    • File Permissions
    • Disk Duplication
    • Create FAT Filesystems
    • Check and Repair FAT filesystem
    • Mount
    • Demo
    • Viewing with Hex Editor
      • Endian-ness in FAT32
  • Linux File System Calls
  • Directory Related Calls in C Language
  • Overview of FAT32
  • Accessing FAT using C
    • C Header of FAT
      • Header: Boot Sector
      • Header: Dir Entry
      • Read the header
    • 8+3 File Name
    • Traversing Cluster
    • Finding Next Cluster
    • Reference
Powered by GitBook
On this page
  • Steps
  • How to solve device busy problem (Study by yourself)
  • Method 1: lsof
  • Method 2: fuser

Was this helpful?

  1. Important Commands

Mount

PreviousCheck and Repair FAT filesystemNextDemo

Last updated 5 years ago

Was this helpful?

The mount command mounts a storage device or file system, making it accessible and attaching it to an existing directory structure. This attached directory is called a mount point. In this way, users can access a storage device or filesystem just like a normal directory.

Remember to unmount after using, otherwise the file system is not fully synchonized, which will cause loss of data.

Steps

  1. First, create a mount point:

    $ mkdir ~/rd
  2. Then, we mount the disk to the mount point:

    $ sudo mount -t vfat -o loop test.disk ~/rd
  3. After that, we can unmount the disk by:

    $ sudo umount ~/rd

How to solve device busy problem (Study by yourself)

There is the case where a process continously occupies the device such that you cannot unmount it.

In this case,we can make use of either one of the two commands to locate the process.

Method 1: lsof

$ lsof ~/rd

Method 2: fuser

$ fuser -vm ~/rd

By these two commands, you can know tail with PID 11793 is occupying the resource. By killing it usingkill -9, you can umount the resource successfully.