chapter 8 working with the bash shell
Download
Skip this Video
Download Presentation
Chapter 8: Working with the BASH Shell

Loading in 2 Seconds...

play fullscreen
1 / 12

Chapter 8: Working with the BASH Shell - PowerPoint PPT Presentation


  • 68 Views
  • Uploaded on

Chapter 8: Working with the BASH Shell. The /dev directory. Each device is represented as files in /dev Devices are divided into two types Character Block The first character in the long listing indicates the type of the device

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Chapter 8: Working with the BASH Shell' - yadid


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
the dev directory
The /dev directory
  • Each device is represented as files in /dev
  • Devices are divided into two types
    • Character
    • Block
  • The first character in the long listing indicates the type of the device
  • Major and minor numbers replace the size. Major for the type of the device and minor for the device itself
  • If a device file is corrupted or deleted you can use mknod to re-create it if you know the type, major and minor numbers. $mknod /dev/fd10 b 2 10
  • Otherwise, you can use: $/dev/MAKEDEV fd0
  • The file /proc/devices contains a list of used devices
file systems
File Systems
  • An advantage of Linux is that you can use several files systems at the same time, thus
  • Each partition can have its own file system
  • Mounting means making the data available
  • A storage device can be mounted to any directory in the system
  • It is common to use directories under /mnt
  • Mounting will temporary covers up all the content of the mount point for the duration of mounting
  • To mount and un-mount devices, use the mount/ unmount commands
  • The file system table (fstab) contains various information about currently mounted devices
floppy disks
Floppy Disks
  • To format a floppy disk (i.e. creating a file system) you use the mkfs commands
  • mkfs takes a –t option to specify the file system type and you need to specify the device file to be used
  • $ mkfs –t ext3 fd4
  • The default file system is ext2
  • A list of variant to mkfs is given in Table 6-3
  • A disk should be mounted to be accessible
  • The command mount lists currently mounted file systems
  • Similar effect can be achieved by viewing the mount table. $cat /etc/mtab
  • After mounting, use the mount point as the root dir.
floppy disks cont
Floppy Disks (cont.)
  • When an ext2 is created on a device, a directory called lost+found is created by default
  • To check if amount directory is not used by any users, you use the fuser: $fuser –u /mnt/floppy
  • You need to unmount the floppy disk before ejecting it. To do so, use $unmount /mnt/floppy
  • The unmount commands accepts the device to be un-mounted or the mount point directory
  • You can use the fuser to check if any process is using the mount directory which will prevent the device from being un-mounted
  • The file-systems table is used to mount devices at boot time and in case the mount command does not have enough arguments
floppy disks cont1
Floppy Disks (cont.)
  • The /etc/fstab has six fields: Device to mount, mount point, type, mount options, dump#, fsck#
    • The dump# determines if the Fs is to be backed up or not
    • The fsck# determines if FS is to be checked at boot or not
  • The mount can take fewer arguments
  • Example: $mount /dev/fd0 or $mount /mnt/floppy
  • Contents of /etc/fstab
  • Generally, floppy disks are mounted automatically when using a GUI environment such as the KDE or the GNOME
cd roms
CD-ROMs
  • They are different than floppies in which they usually use IDE controller
  • Thus, they use similar naming convention like IDE hard disks (hda for primary master, etc.)
  • Besides, they typically use the iso9660 filesystem, thus they are mounted with
    • -t iso9660 option for the filesystem type
    • -r for read-only
  • $mount –r –t iso9660 /dev/cdrom / mnt/cdrom
  • They can be un-mounted using unmount
  • CD-ROM can NOT be ejected unless properly un-mounted.
hard disks
Hard Disks
  • They are usually partitioned with different FS why
    • Separate different data types
    • Use of more than FS
    • Improve system reliability (FS corruption)
    • Enhance system performance
  • The MBR stores info about all particitions
  • Hard disk structure: Tracks, sectors, cylinder
  • Physical and logical partitions
  • Partitioning hard disks:
    • During installation: using Druid
    • After installation: Using fdisk
  • The machine might need to be rebooted to manually reload the new partition info
maintenance commands
Maintenance Commands
  • Monitoring disk usage using disk free space (df)
  • It gives results in terms of block numbers
  • The –h option prints results measured in MB & GB
  • It only views mounted file systems
  • To get info about a specific directory use du (Directory Usage)
  • It, du, gives results in KB
  • The option –s give summary and can be used with –h
  • To view total number of i-nodes and the number of free ones use: dumpe2fs –h /dev/sda0
maintenance commands cont
Maintenance Commands (cont)
  • Disk quotas
  • Soft limit and hard limit
  • Setting quotas (quotaon/quotaoff)
  • Editing quota (edquota)
  • List quota values for all users (repquota)
  • Checking quota values for individual users (quota –v )
ad