1 / 55

Filesystem administration

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.

sulwyn
Download Presentation

Filesystem administration

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. Topic A: The /dev directory and device files

  3. The /dev directory • Device file • File that represent a specific hardware device on the system • Typically found in the /dev directory

  4. 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

  5. Common device files

  6. 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

  7. Topic B: Using floppy disks and CD-ROMs

  8. Removable Media • Much the same as fixed in the way the space is accessed • Can be removed

  9. 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

  10. 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

  11. Common Linux filesystems

  12. Commands used to create filesystems

  13. 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

  14. Directory structure prior to mounting

  15. Directory structure after mounting a floppy

  16. 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

  17. 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#

  18. 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

  19. 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

  20. Unounting devices • umount /mnt/floppy • Unmount the mount point

  21. Commands for mounting and unmounting

  22. 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)

  23. Topic C: Hard disks

  24. 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)

  25. SCSI hard disks • Well-suited to Linux servers • Large storage space • High access speeds

  26. 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)

  27. 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

  28. A sample Linux partitioning strategy

  29. Sample dual-boot Linux partitioning strategy

  30. 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

  31. Topic D: Monitoring filesystems

  32. 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

  33. 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

  34. 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

  35. Common options to the fsck command

  36. 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

  37. 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

  38. 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.

  39. 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

  40. 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

  41. 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

  42. 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

  43. 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

  44. 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.

  45. 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.

  46. Sample Questions When the command mke2fs ­j is run, what type of system is created? A. ext2 B. ext3 C. jfs D. xfs

  47. 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

  48. 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

  49. 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.

  50. 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.

More Related