1 / 18

Workbook 5: The Linux Filesystem

Workbook 5: The Linux Filesystem. OS515: 2010. The basic anatomy of a regular file. What’s in an inode ?. Ownership information. Links: The number of dentries that refer to this inode. Permissions. Blocks: The amount of disk space consumed.

adelie
Download Presentation

Workbook 5: The Linux Filesystem

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Workbook 5: The Linux Filesystem OS515: 2010

  2. The basic anatomy of a regular file

  3. What’s in an inode? Ownership information Links: The number of dentries that refer to this inode Permissions Blocks: The amount of disk space consumed Access: Last time the file was readModify: Last time the file data changedChange: Last time the inode data changed

  4. File types • In Unix there is an expression “Everything is a file” • Types help us identify the function of the file

  5. The stat Command

  6. Viewing inode information with ls

  7. Directory Structure

  8. Hard Links

  9. Soft Links

  10. Comparing Links Hard Links Soft Links • Cannot hard link directories • Hard links have no concept of "original" and "copy “ • Hard links must refer to files in the same filesystem • Can soft link directories • Soft links have a concept of "referrer" and "referred". Removing the "referred" file results in a dangling referrer • Soft links may span filesystems (partitions)

  11. Disks, File Systems, and Mounting • Linux allows low level access to disk drives through device nodes in the /dev directory. /dev/fd0 =

  12. Filesystems • While devices hold the data they must be prepared and made available

  13. File Systems • Filesystems are created with some variant of the mkfs command • The default filesystem of Red Hat Enterprise Linux 5.2 is the ext3 filesystem /sbin/mkfs.ext2 /dev/fd0

  14. Mounting Filesystems • The mount command is used to map the root directory of a disk's (or a disk partition's) filesystem to an already existing directory. That directory is then referred to as a mount point. • The umount command is used to unmount a filesystem from a mount point. • The df command is used to report filesystem usage, and tables currently mounted devices. mount /dev/fd0 /media/floppy mount /dev/hdb3 /data

  15. Permanent and Temporary Mounts

  16. Mounting Issues • By default, only the root user can mount and unmount devices (console users are the exception) • A filesystem can only be unmounted if it is considered "non-busy“ • The GNOME graphical environment runs an automounter, which keeps an eye on the CD/ROM drive, and will automatically mount the filesystem of any newly inserted disk • In order to improve performance, the kernel buffers all block device (harddrive) interactions so you must umount to ensure these buffers are flushed to disk

  17. Advanced File Commands • locate and find • Used to locate/find files within the file system. Locate and find work in different ways • gzip and bzip2 • Used to compress/decompress a datastream • tar • Used to create an archive of files (early uses were to archive files to tape), and can be used with zgip/bzip2 to create compressed archives.

More Related