Page 156 - DCAP106_OPERATING_SYSTEM_TOOLS
P. 156

Unit 9: The File System




          The file is structured as follows:                                                    Notes
          1.   The device to mount (also supports labels).

          2.   The location to mount the device to (mount point).
          3.   The file system type, or auto if you want Linux to automatically detect the file system.
          4.   Additional options (use “defaults” if you don’t want any specific option), such as noatime
               (don’t register access times to the file system to improve performance) and users (allow
               regular users to mount/umount the device).
          5.   Dump-number (you can leave this at 0).
          6.   File check order (you can leave this at 0 as well).

          The previous mount command example is not necessary any more (as the mount is performed
          automatically) but in case the mount has not been done already, the command is simplified to:

          # mount /home
          If you ever need to remove a medium from the file system, use the umount command:

          # umount /home
          This is of particular interest for removable media.


                 Example: If you want to access a CD or DVD (or even USB stick), you need to mount the
          media on the file system first before you can access it. Likewise, before you can remove the media
          from your system, you first need to unmount it:
          # mount /media/dvd
          (The DVD is now mounted and accessible)
          # umount /media/dvd
          (The DVD is now not available on the file system any more and can be removed from the tray)
          Obviously,  modern  Linux  operating  systems  have  tools  in  place  which  automatically  mount
          removable media on the file system and unmount it when they are removed. Linux does not
          offer such tool by default though.

          Swap Location

          Thgere  can  be  a    a  partition  dedicated  for  paging.  Linux  uses  this  partition  when  there  is
          inadequate  physical  memory  to  keep  all  information  regarding  running  processes  (and  their
          resources). When this is the case, the operating system will start putting information (which it
          hopes will not be used soon) on the disk, freeing up physical memory.

          Instead of a file system usable by end users, the swap partition holds a particular file system for
          memory purposes and is recognized as a swap partition in the partition table:

          # fdisk -l /dev/sda
          Disk /dev/sda: 60.0 GB, 60011642880 bytes
          255 heads, 63 sectors/track, 7296 cylinders
          Units = cylinders of 16065 * 512 = 8225280 bytes
          Disk identifier: 0x8504eb57
             Device Boot  Start    End      Blocks   Id  System
          /dev/sda1   *       1   1275    10241406   83  Linux
          /dev/sda2        1276   7296    48363682+   5  Extended



                                           LOVELY PROFESSIONAL UNIVERSITY                                   149
   151   152   153   154   155   156   157   158   159   160   161