07 qlx02vtour
Upcoming SlideShare
Loading in...5
×
 

07 qlx02vtour

on

  • 209 views

 

Statistics

Views

Total Views
209
Views on SlideShare
209
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

07 qlx02vtour 07 qlx02vtour Presentation Transcript

  • Unit 7 A Tourthrough Linux
  • ObjectivesAfter completing this unit, you should be able to:• Describe the structure of the filesystem• Mount and unmount CD-ROMs and floppy disks
  • Directory Structure•All Linux directories are contained in one, virtual, "unifiedfilesystem"• Physical devices are mounted on mount points• FLOPPY DISKS• HARD DISK PARTITIONS• CD-ROM drives• No drive letters like A:, C:, ...bootetclib1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUND/
  • /BIN, /LIB, / SBINbootetclib1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUND/•/BIN CONTAINS EXECUTABLES FOR EVERY USER•/SBIN CONTAINS SYSTEM ADMINISTRATION EXECUTABLES•/LIB CONTAINS LIBRARIES• Should always be available -At system boot -Insingle user mode -When booting from rescue disk
  • /BOOTbootetclib1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUND/• Contains kernel image and some other goodies
  • /DEVbootetclib1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUND/• Contains special files that represent hardware devices -Block special device, for example, a hard disk -Character special device, for example, mouse andkeyboard• Each device has a major and minor number -Identification within the kernel
  • /ETCbootetclib1 1 1 1 1 1 1 Ibin dev home mnt root tmp varprocsbinusrLOST+FOUND/• Contains system-wide configuration files• Some subsystems have multiple files and therefore use aseparate directory-/ETC/X11 CONTAINS X WINDOW SYSTEMCONFIGURATION -/ETC/SKEL CONTAINS DEFAULT USERCONFIGURATION FILES -/ETC/SYSCONFIG CONTAINSSYSTEM CONFIGURATION
  • /HOMEbootetclib1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUNDfred bill JANE/• Home directories of users
  • /MNTbootetclibfloppy1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUNDcdrom1win95/• Mount points for other filesystems• Note: SUSE uses /media instead of /mnt for floppy andcdrom mountpoints
  • /PROCbootetclib1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUND/•Virtual filesystem• Represents kernel and process information
  • /ROOTbootetclib1 1 1 1 1 1 1 Ibin dev home mnt root tmp varprocsbinusrlost+found/• Home directory of the root user
  • /TMPbootetclib1 1 1 1 1 1 1 Ibin dev home mnt root tmp varprocsbinusrLOST+FOUND/•Temporary storage space for programs, users •Usually automatic cleanup mechanism active
  • /USRbootetclib1 1 I I I I I Ibin dev home mnt root tmp varprocsbinusrLOST+FOUNDbin lib1sbin»UNIX SYSTEM RESOURCES► CONTAINS ALL PROGRAMS, LIBRARIES AND SO ON WHICH ARENOT ESSENTIAL FOR SYSTEM BOOT AND EMERGENCY OPERATIONS►/USR/LOCAL INTENDED FOR PROGRAMS NOT IN THEDISTRIBUTION -LOCALLY DEVELOPED -LOCALLY COMPILED/
  • /VAR1 1 1 1 1 1 1 Ibin dev home mnt root tmp varboot etc lib proc sbin usr LOST+FOUNDX• Files of variable size -logfiles -lockfiles• Directories with variable content -mail-scheduling -printing•Temporary storage space, longer than /tmptmp spool log1/
  • /LOST+FOUNDbootetclib1 1 1 1 1 1 1 1bin dev home mnt root tmp varprocsbinusrlost+found/• Exists in every filesystem• Place where lost+found files are stored after a crashrecovery by fsck.
  • Other Directories in /bootetclib1 1 1 1 1 1 1 Ibin dev home mnt root tmp varprocsbinusrlost+found/•/OPT: USED FOR SOME SOFTWARE FROM EXTERNALPROVIDERS -SEPARATE FILESYSTEM ADVISABLE•Whatever you create yourself.
  • Virtual, Unified Filesystem• Linux does not use drive letters (A:, C:, D:) to identifydrives/partitions, but creates a virtual, unified filesystem• Different drivers/partitions are "mounted" on a"mountpoint"/DEV/HDA2 IS THE"ROOT FILESYSTEM"bin lib sbin tmp spool log-this directoryis now called/var/log/DEV/HDA5 IS /DEV/HDA6 IS"mounted" on /usr "mounted" on /var
  • Typical Filesystem LayoutTypical Workstation: Typical Server:
  • The mount Command•The mount command mounts a filesystem• Makes it part of the unified filesystem structuremount [-t type] [-o opts] device mountpnt# MOUNT /DEV/HDA5 /USR
  • The umount Command•The umount command unmounts a filesystem•Takes it out of the unified filesystem structure •Filesystem should not be busyumount {device|mountpnt}# umount /DEV/HDA5-OR -# umount /USR
  • The /etc/fstab File•/ETC/FSTAB lists all known filesystems on the system • Syntax:device mountpoint type options dump fsck• Filesystems with the noauto option are not mountedautomatically but can be used as templates for mount# cat /etc/fstab/DEV/HDA1 /MNT/WIN95 vfat defaults 0 0/DEV/HDA2 / ext3 defaults 1 1/DEV/HDA5 /usr ext3 defaults 1 2/DEV/HDA6 /VAR ext3 defaults 1 2/DEV/CDROM /MNT/CDROM iso9660 noauto,owner,ro 0 0/DEV/FD0 /MNT/FLOPPY auto noauto,owner 0 0none /proc proc defaults 0 0none /DEV/PTS devpts gid=5,mode=620 0 0Note: Some distributions use filesystem labels instead of device names!
  • Mounting and Unmounting Removable Media• Most distributions configure /etc/fstab so that the consoleuser is allowed to mount removable media (floppy, cd) on apredetermined mountpoint and with predetermined options(for security)•Always unmount media before ejecting!•The GUI typically offers icons that perform the mount$ whoami tux1$ mount /mnt/cdrom $ mount/DEV/CDROM ON /MNT/CDROM TYPE $ LS /MNT/CDROMiso9660 (ro,nosuid,nodev,user=tux1)$ umount /mnt/cdrom
  • CheckpointT/F 1. Linux uses drive letters (A:, B:, C: and so forth), justlike Windows.2. The best location for the mount command would bea. /etcb. /binc. /sbind. /usr/sbin3. Where are most system-wide configuration files stored?
  • Unit Summary• Structure of the filesystem/BIN, /LIB, /SBIN /BOOT/ETC/HOME, /ROOT/TMP/USR/VAR• Special filesystems /PROC/MNT• Special files /dev