You are on page 1of 18

System and Network

Administration Linux based

ITEC 3116
File System Hierarchy
Lecture 9-Week 5,
May 2020.
Recap of the previous Lecture
 Ubuntu Terminal/Bash
 Basic Commands
 Linux File System
 I Nodes
 File Hierarchy Standard
 Directories & Subdirectories
Agenda for Today’s Class
File System Structure
 File System Structure and
Hierarchy
 Structure and commands of
Subdirectories
The “/”

boot bin dev etc lib proc root sbin tmp usr var

4
/dev

 Usually is the location of device files


 A device and a file both can be read from and
written to. So config a device is same with edit
a file. EXP: sending data to /dev/ttyS0 that
means you are sending data to a
communication device, such as a modem.
 'block devices' are devices that store or hold
data
 'character devices' can be thought of as
devices that transmit or transfer data

5
/dev … detail

 /dev/ttyS0 → Device connected to Com1 (Modem, mouse,..)


 /dev/psaux → PS/2 mouse connection
 /dev/lp0 → First parallel port
 /dev/dsp → Sound card (digital signal processor)
 /dev/usb → USB device nodes.
 /dev/sda → First SCSI device
 /dev/scd → First SCSI CD-ROM device
 /dev/cdrom → CD-ROM drive
 /dev/fd0 → floppy drive
 /dev/had → The partition on primary hdd

6
/etc

 Contains all system related


configuration files
 Local file used to control the
operation of a program
 Those files must be static and cannot
be an executable binary

7
/etc … detail

 /etc/X11/ : contains all the configuration files for the X


Window System
 /etc/ftpchroot : List of ftp users that need to be chrooted
 /etc/ftpaccess : Determines who might get ftp-access to
your machine.
 /etc/gateways : Lists gateways for 'routed'
 /etc/group, /etc/passwd. lists the configured user groups
and who belongs to them.
 /etc/hostname : Contains the hostname of your machine

8
/home

 The user home directories


 Accessible only to its owner and the
system administrator
 Contains the user’s personal
configuration files

9
/initrd

 /initrd (initial ramdisk) Provides the


capability to load a RAM disk by the boot
loader.
 This RAM disk can be mounted as the root file
system and programs can be run from it.
Afterwards, a new root file system can be
mounted from a different device. The previous
root (from initrd) is then moved to a directory
and can be subsequently unmounted.
 Initrd is mainly designed to allow system
startup to occur in two phases, where the
kernel comes up with a minimum set of
compiled-in drivers, and where additional
modules are loaded from initrd.
10
/lib

 Contains kernel modules and those


shared library images (the C
programming code library) needed to
boot the system and run the
commands in the root filesystem, ie.
by binaries in /bin and /sbin
 Windows equivalent to a shared
library would be a DLL (dynamically
linked library) file
11
/lost+found

 Contains the files which were


recovered after an unexpected event,
such as a proper shutdown.
 Try to move each file back to its
original location

12
/mnt

 This is a generic mount point under


mounted (mount is to make a
filesystem available to the system)
the filesystems or devices.
 When a filesystem no longer needs to
be mounted, it can be unmounted
with umount
• mount /dev/hda2 /home
• umount /dev/hda2

13
/sbin
 Like /bin bet less important
 /sbin should contain only binaries essential for
booting, restoring, recovering, and/or repairing the
system in addition to the binaries in /bin.
 /sbin is a standard subdirectory of the root directory
in Linux and other Unix-like operating systems that
contains executable (i.e., ready to run) programs.
They are mostly administrative tools, that should be
made available only to the root (i.e., administrative)
user.

14
/sbin … detail
 shutdown → Command to bring the system down.
 Fastboot → Reboot the system without checking the disks
(optional)
 Fasthalt → Stop the system without checking the disks
(optional)
 halt → Command to stop the system (optional)
 ifconfig → Configure a network interface (optional)

15
/usr

 The largest share of data on a system


 the most important directories in the
system as it contains all the user
binaries, their documentation,
libraries, header files, etc.... X and its
supporting libraries, and User
programs like telnet, ftp, etc.... as
well, can be found here.

16
/var

 Contains variable data, files and


directories the system must be able
to write to during operation, like
system logging files, mail and printer
spool directories, and transient and
temporary files

17
Lecture End

You might also like