Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 8. Disks and Filesystems. Ordinary Files u What is a file? –a container for ordered data –persistent (stays around) and accessible by name u Unix.

Similar presentations


Presentation on theme: "Chapter 8. Disks and Filesystems. Ordinary Files u What is a file? –a container for ordered data –persistent (stays around) and accessible by name u Unix."— Presentation transcript:

1 Chapter 8. Disks and Filesystems

2 Ordinary Files u What is a file? –a container for ordered data –persistent (stays around) and accessible by name u Unix files –regular Unix files are pretty simple v essentially a sequence of bytes –Unix files are identified by a name in a directory v this name is actually used to resolve the hard disk name/number, the cylinder number, the track number, the sector, the block number –you see none of this v it allows the file to be accessed

3 Files, Directories, Devices u Unix files come in other flavors as well, such as –Directories v a file containing pointers to other files v equivalent of a “folder” on a Mac or Windows –Links v a pointer to another file v used like the file it points to v similar to “shortcuts” in Windows, but better –Devices v access a device (like a soundcard, or mouse, or...) like it is a file

4 Figure 3-3 A Directory Hierarchy

5 System Directories u Some standard directories and files in a typical Unix system –/the root –/binBINaries (executables) used to start system –/sbinSystem BINaries for Superuser –/libLIBraries used for startup –/devDEVices (peripherals) hardware interfaces –/etcunique settings for system, config, passwds –/usrBiggest filesystem, sys tools, X, apps –/tmptemp storage, good to separate partition

6 Typical System Directory Contents –/usr USeR stuff –/usr/bin BINaries again –/usr/includeinclude files for compilers –/usr/libLIBraries of functions etc. –/usr/locallocal stuff for apps installed later –/usr/local/binlocal BINaries –/usr/local/liblocal LIBraries for apps –/usr/X11R6X window stuff –/usr/sbinsysadmin stuff –/usr/tmpplace for more TeMPorary files –/var VARiable stuff—mail, print jobs, logfiles –/var/mailthe mail spool –/var/logsecurity info VERY IMPORTANT

7 The /proc filesystem u /proc is a virtual directory. in RAM rather than in HDD. u /proc contains info about your system’s state. amount of free memory processes running external devices plugged in remaing battery power if you are working in a laptop u You can, though, navigate around it with cd command and list its contents with ls command or view some of its file contents with cat command

8 The /proc file system  Numbers are directories representing each of the running process on the system and contain all info related to it. terra$ ls /proc/480/ auxv cwd exe maps mounts stat status wchan cmdline environ fd mem root statm task For example: cmdline contains the command the process started with mem contains the amount of memory this process holds . /proc contains information about the hardware of the system cat /proc/meminfo contains information about memory state more /proc/ioports gives all the information about the availability of I/O ports on the system and the hardware device assigned to each.

9 Figure 3-8 Inodes Each file on the disk has an inode which keeps information about the file, it’s address, etc


Download ppt "Chapter 8. Disks and Filesystems. Ordinary Files u What is a file? –a container for ordered data –persistent (stays around) and accessible by name u Unix."

Similar presentations


Ads by Google