Filesystem administration
Download
1 / 55

Filesystem administration - PowerPoint PPT Presentation


  • 120 Views
  • Updated On :

Filesystem administration. Unit objectives Identify types of device files in the /dev directory Mount and unmount floppys and CD-ROMs Create, mount, and unmount partitions Monitor free space, check for errors, and use hard disk quotas. Topic A: The /dev directory and device files.

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 'Filesystem administration' - sulwyn


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
Filesystem administration l.jpg
Filesystem administration

Unit objectives

  • Identify types of device files in the /dev directory

  • Mount and unmount floppys and CD-ROMs

  • Create, mount, and unmount partitions

  • Monitor free space, check for errors, and use hard disk quotas


Topic a the dev directory and device files l.jpg
Topic A: The /dev directory and device files


The dev directory l.jpg
The /dev directory

  • Device file

    • File that represent a specific hardware device on the system

    • Typically found in the /dev directory


Device types l.jpg
Device types

  • Block devices

    • transfer data in large units

    • Can transfer information must faster than character devices

  • Character devices

    • Transfer data one data bit at a time



Device file numbers l.jpg
Device File numbers

  • Major number

    • Used by the kernel to identify what device driver to call to interact properly with a given category of hardware

  • Minor number

    • Used by the kernel to identify which specific hardware device, within a given category, to use a driver to communicate with



Removable media l.jpg
Removable Media

  • Much the same as fixed in the way the space is accessed

    • Can be removed


Filesystems l.jpg
Filesystems

  • Filesystem

    • The organization of a physical storage medium used to store and retrieve data

      • Superblock

      • Inode table

      • Data block

    • Linux Works with lots of filesystems


Formatting l.jpg
Formatting

  • The process where a filesystem is placed on a disk drive

    • ldformat

      • Low level format-for floppy

  • mkfs

    • Creates filesystem structure

    • -t defines which filesystem

  • mke2fs

    • Specifically for ext2 and ext3




Mounting and mount points l.jpg
Mounting and mount points

  • Mounting

    • Process used to associate a device with a directory in the directory tree

  • Mount point

    • Directory in the file tree to which a device is mounted




Mounting a floppy l.jpg
Mounting a floppy

  • mount shows currently mounted directories

  • fuser –u /mnt/flopppy

    • See if anyone is using the directory

  • mount –t ext2 /dev/fdo /mnt/floppy

    • /dev/fdo is the device file for the floppy

    • /mnt/floppy is the mount point


Using mount with etc fstab l.jpg
Using mount with /etc/fstab

  • fstab file

    • Automatically mounts devices at boot time

    • Consulted when user doesn’t specify full mount commands

    • Six fields

    • Device, mount point, type, mount options, dump#, fsck#


Using mount with etc fstab18 l.jpg
Using mount with /etc/fstab

  • Fstab hints

    • Options

      • ro, rw, noatuo

    • Dump#

      • 1 specifies system should be backed up

    • Fsck#

      • Is filesystem checked at boot time

      • 0-not checked

      • 1-checked first

      • 2-checked second


Mounting devices l.jpg
Mounting devices

  • When booted, a filesystem on the hard drive is mounted to the / (root) directory

  • Root directory

    • Contains the most files that start up the operating system

    • Should have enough free space to prevent errors and slow performance


Unounting devices l.jpg
Unounting devices

  • umount /mnt/floppy

    • Unmount the mount point



Using cd roms l.jpg
Using CD-ROMs

  • Most CD-ROM drives act as a normal IDE hard disk

  • Use one of four configurations

    • Primary master (/dev/hda)

    • Primary slave (/dev/hdb)

    • Secondary master (/dev/hdc)

    • Secondary slave (/dev/hdd)



Ide hard disks l.jpg
IDE Hard disks

  • Low cost

  • Uses one of four configurations, each of which has a different device file

    • Primary master (/dev/hda)

    • Primary slave (/dev/hdb)

    • Secondary master (/dev/hdc)

    • Secondary slave (/dev/hdd)


Scsi hard disks l.jpg
SCSI hard disks

  • Well-suited to Linux servers

    • Large storage space

    • High access speeds


Scsi hard disks26 l.jpg
SCSI hard disks

  • Device files associated with SCSI hard disks

    • First SCSI hard disk drive (/dev/sda)

    • Second SCSI hard disk drive (/dev/sdb)

    • Third SCSI hard disk drive (/dev/sdc)

    • Fourth SCSI hard disk drive (/dev/sdd)

    • Fifth SCSI hard disk drive (/dev/sde)

    • Sixth SCSI hard disk drive (/dev/sdf)


Hard disk partitioning l.jpg
Hard disk partitioning

  • Partition

    • A physical division of a hard disk drive

  • Minimum of two

    • Root

    • Swap

  • Better to use more

    • Segregate different types of data

    • Allow more than one type of filesystem

    • Reduce the chance filesystem corruption will render a system unusable

    • Speed up access to data




Creating hard disk partitions l.jpg
Creating hard disk partitions

  • Disk Druid

    • easy-to-use partitioning tool

    • designed for installation only

  • Fdisk

    • Used to create partitions after installation

    • Key Fdisk Filesystem Types

    • 82 Linux swap

    • 83 Linux

    • 85 Linux extended

  • fdisk –l shows current partition scheme



Monitoring filesystems l.jpg
Monitoring Filesystems

  • df (disk free) command

    • The easiest method for monitoring free space

    • Shows used and free blocks

    • df –h

      • Shows used and free space in MB

        [epapates@localhost ~]$ df -h

        Filesystem Size Used Avail Use% Mounted on

        /dev/mapper/VolGroup00-LogVol00

        3.3G 2.0G 1.1G 65% /

        /dev/hda1 99M 16M 78M 17% /boot

        tmpfs 125M 0 125M 0% /dev/shm


Checking filesystems l.jpg
Checking filesystems

  • Filesystem corruption

    • Errors in a filesystem structure that prevent the retrieval of stored data

  • Syncing

    • Process of writing data from RAM to the hard disk

  • Bad blocks

    • Areas of a storage medium that cannot be used


Checking filesystems34 l.jpg
Checking filesystems

  • Filesystems should be unmoutned before running fsck

  • For / filesystem, do the check in single user mode (runlevel 1)

  • Can also use e2fsck for ext2 or ext3 filesystems

    • More options



Hard disk quotas l.jpg
Hard disk quotas

  • Soft limits

    • Limit imposed that can be exceeded for a certain period of time

  • Hard limit

    • Limit imposed that cannot be exceeded


Chapter summary l.jpg
Chapter summary

  • Identified structure and types of device files in the /dev directory,

  • Learned about filesystems, mounted and unmounted floppy disks and CD-ROMs

  • Created hard disk partitions, mounted and unmounted hard disk partitions

  • Monitored filesystem free space, checked for errors, used hard disk quotas


Sample questions l.jpg
Sample Questions

A Linux system will not boot, even in single­user mode, but hard drive indicate that the drive is working properly. Which of the following should be to repair the file system?

A. Use the custom tool provided by the hard drive manufacturer.

B. Use a bootable Linux medium to boot into Linux and run fsck.

C. Use a bootable Linux medium to boot into Linux and run fdisk.

D. Reinstall Linux from the original install drive and apply all patches.


Sample questions39 l.jpg
Sample Questions

A Linux system will not boot, even in single­user mode, but hard drive indicate that the drive is working properly. Which of the following should be to repair the file system?

A. Use the custom tool provided by the hard drive manufacturer.

B. Use a bootable Linux medium to boot into Linux and run fsck.

C. Use a bootable Linux medium to boot into Linux and run fdisk.

D. Reinstall Linux from the original install drive and apply all patches.

Answer: B


Sample questions40 l.jpg
Sample Questions

Which of the following fstab entries will mount a Samba share at boot time?

A. servername:sharename /mountdirectory smbfs

username=windowsusername,password=windowspassword 0 0

B. //servername/sharename /mountdirectory smbfs

username=windowsusername,password=windowspassword 0 0

C. //servername/sharename /mountdirectory sambafs

username=windowsusername,password=windowspassword 0 0

D. smbmount //servername/sharename /mountdirectory ­o

username=windowsusername,password=windowspassword


Sample questions41 l.jpg
Sample Questions

Which of the following fstab entries will mount a Samba share at boot time?

A. servername:sharename /mountdirectory smbfs

username=windowsusername,password=windowspassword 0 0

B. //servername/sharename /mountdirectory smbfs

username=windowsusername,password=windowspassword 0 0

C. //servername/sharename /mountdirectory sambafs

username=windowsusername,password=windowspassword 0 0

D. smbmount //servername/sharename /mountdirectory ­o

username=windowsusername,password=windowspassword

Answer: B


Sample questions42 l.jpg
Sample Questions

Which of the following is a valid entry for /etc/fstab?

A. /dev/hd1 /mnt/hda1 ntfs defaults,noatime,notail 0 0

B. /dev/hdb1 /mnt/hdb1 ext3 defaults,noatime,notail 0 0

C. /dev/hda1 /proc/hda1 ntfs defaults,noatime,notail 0 0

D. /dev/hdb1 /mnt/hdb1 reiser defaults,noatime,notail 0 0


Sample questions43 l.jpg
Sample Questions

Which of the following is a valid entry for /etc/fstab?

A. /dev/hd1 /mnt/hda1 ntfs defaults,noatime,notail 0 0

B. /dev/hdb1 /mnt/hdb1 ext3 defaults,noatime,notail 0 0

C. /dev/hda1 /proc/hda1 ntfs defaults,noatime,notail 0 0

D. /dev/hdb1 /mnt/hdb1 reiser defaults,noatime,notail 0 0

Answer: B


Sample questions44 l.jpg
Sample Questions

At boot time, the computer reported that there are problems with inodes and blocks. What is the problem, and how is it corrected?

A. The boot sector is corrupt and needs to be replaced.

B. The file system has become corrupt and needs to be repaired.

C. The partition table has become corrupt and needs to be repaired.

D. The drive is configured using an improper file system and needs to be reformatted.


Sample questions45 l.jpg
Sample Questions

At boot time, the computer reported that there are problems with inodes and blocks. What is the problem, and how is it corrected?

A. The boot sector is corrupt and needs to be replaced.

B. The file system has become corrupt and needs to be repaired.

C. The partition table has become corrupt and needs to be repaired.

D. The drive is configured using an improper file system and needs to be reformatted.

Answer: B.


Sample questions46 l.jpg
Sample Questions

When the command mke2fs ­j is run, what type of system is created?

A. ext2

B. ext3

C. jfs

D. xfs


Sample questions47 l.jpg
Sample Questions

When the command mke2fs ­j is run, what type of system is created?

A. ext2

B. ext3

C. jfs

D. xfs

Answer: B


Sample questions48 l.jpg
Sample Questions

You want to know how much space is being occupied by your user's home directories. Which of the following will provide you with this information?

A. du ­l /home

B. du ­b /home

C. du ­m /home

D. du ­c /home


Sample questions49 l.jpg
Sample Questions

You want to know how much space is being occupied by your user's home directories. Which of the following will provide you with this information?

A. du ­l /home

B. du ­b /home

C. du ­m /home

D. du ­c /home

Answer: D.


Slide50 l.jpg

A customer has installed a new IDE hard drive in a Linux system. The drive has been

partitioned and formatted with the ext2 file system. She is complaining that the new drive

must be mounted manually every time the computer is booted. What needs to be done?

A. Use a utility to edit fstab.

B. Add the proper drive module to the kernel.

C. Add the drive information to the /dev directory.

D. Change the runlevel to reflect the number of partitions in the system.


Slide51 l.jpg

A customer has installed a new IDE hard drive in a Linux system. The drive has been

partitioned and formatted with the ext2 file system. She is complaining that the new drive

must be mounted manually every time the computer is booted. What needs to be done?

A. Use a utility to edit fstab.

B. Add the proper drive module to the kernel.

C. Add the drive information to the /dev directory.

D. Change the runlevel to reflect the number of partitions in the system.

Answer: A.


Slide52 l.jpg

When using fdisk and a partition type of 85 is selected, which kind of partition will

be created?

A. swap

B. reiserfs

C. linux native

D. linux extended


Slide53 l.jpg

When using fdisk and a partition type of 85 is selected, which kind of partition will

be created?

A. swap

B. reiserfs

C. linux native

D. linux extended

Answer: D


Slide54 l.jpg

Which of the following commands is used to obtain the summary of hard disk partitions?

A. fsck

B. fdisk

C. fsck ­l

D. fdisk ­l


Slide55 l.jpg

Which of the following commands is used to obtain the summary of hard disk partitions?

A. fsck

B. fdisk

C. fsck ­l

D. fdisk ­l

Answer: D.