Laksh mi.  fdisk is an interactive utility to manipulate disk partitions.  Use fdisk –l to review the disks and partitions on the system.  Use fdisk.

Slides:



Advertisements
Similar presentations
ITI-481: Unix Administration Rutgers University Center for Applied Computer Technologies Christopher Uriarte, Instructor Meeting 4.
Advertisements

Chapter 9 Part III Linux File System Administration
Operating Systems File Management.
Basic Unix system administration
Linux Installation LINUX INSTALLATION. Download LINUX Linux Installation To install Red Hat, you will need to download the ISO images (CD Images) of the.
04/21/2004CSCI 315 Operating Systems Design1 Disk Management.
A Guide to Unix Using Linux Fourth Edition
Allocation Methods - Contiguous
File Systems Examples.
Ext2/Ext3 Linux File System Reporter: Po-Liang, Wu.
File System Basics Brandon Checketts. Some terminology Superblocks Inodes Journaling Hard links Symbolic links Directory entries.
1 itec 400 Unix File Systems George Vaughan Franklin University.
Introduction to Unix (CA263) File System
Operating Systems File Systems (in a Day) Ch
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Operating Systems File Systems (Select parts of Ch 6)
Guide To UNIX Using Linux Third Edition
Operating Systems File Systems (Select parts of Ch 11-12)
Agenda 1. Present weekly Power Point presentation 2. Open source presentations 3. Final exam review link available 4. All lab assignments due by August.
SUSE Linux Enterprise Server Administration (Course 3037)
Guide To UNIX Using Linux Fourth Edition
Unix File System Internal Structures By C. Shing ITEC Dept Radford University.
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 4 Working.
Manage Directories and Files in Linux
CIS Lesson 2 Storage Devices. CIS Lesson 2 Floppy drive and diskettes Hard drive (IDE and SCSI) USB flash drive (aka pen drive) Storage Devices.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Disks, Filesystems 1.  sudo and PATH (environment)  disks  partitioning  formatting file systems: mkfs command  checking file system integrity: fsck.
Chapter 6: Linux Filesystem Administration
Chapter Two Exploring the UNIX File System and File Security.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
Managing Disks and Drives Chapter 13 powered by dj.
1 Objectives Manage and install new file systems.
Chapter 5 File Management File System Implementation.
1 Comp 104: Operating Systems Concepts Files and Filestore Allocation.
Manage Directories and Files in Linux. 2 Objectives Understand the Filesystem Hierarchy Standard (FHS) Identify File Types in the Linux System Change.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 Implementation.
Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,
1 LINUX SECURITY. 2 Outline Introduction Introduction - UNIX file permission - UNIX file permission - SUID / SGID - SUID / SGID - File attributes - File.
Page 112/7/2015 CSE 30341: Operating Systems Principles Chapter 11: File System Implementation  Overview  File system structure – layered, block based.
Ext2/Ext3 Linux File System Reporter: Po-Liang, Wu.
System Administration – Part 2. Devices in UNIX are files: A device can be accessed with different file names All device files are stored in /dev or its.
PTA Linux Series Copyright Professional Training Academy, CSIS, University of Limerick, 2006 © Workshop V Files and the File System Part B – File System.
Linux Filesystem WeeSan Lee. Roadmap Disk Partitions The Filesystem Filesystem Mouting & Umounting File Tree File Type File Permission.
Agenda 1. Present weekly Power Point presentation 2. Open source presentations 3. Final exam review link available 4. All lab assignments due by December.
Week Fourteen Student name: David Long Open source topic : KeePass Student name: Matthew Tankersley Open source topic : Blender 3D Modeling Student name:
Filesystem Management and Backups. 2 Section Overview Devices and Files Filesystem Management Network Filesystems Backups.
File system and file structures
Hp education services education.hp.com hp education services education.hp.com 1 HP World/Interex 2002 Linux File System Support Chris Cooper (734)
1 The File System. 2 Linux File System Linux supports 15 file systems –ext, ext2, xia, minix, umsdos, msdos, vfat, proc, smb, ncp, iso9660, sysv, hpfs,
Materi managing user & groups, file system Managing Software Packages and File Systems The Complete Guide to Linux System Administration Chapter 10.
1 C1-UD 6-6 BASIC LINUX FILE MANAGEMENT. Part IV. File System Administration Academic Year DAI. Credit 1 (Single and Multiuser Operating Systems)
Linux Filesystem Administration
Getting Started with Linux
Chapter 8 Unix & Linux.
Chapter 8 Adding a Disk.
EXT in Detail High-Performance Database Research Center
Week Fourteen Student name: Mike Gallagher
Filesystem Management and Backups
Chapter 11: File System Implementation
Chapter 12: File System Implementation
Basic Commands ls cp ls –l (in detail format) echo ls –a
Unix System Administration
Introduction to Computers
Exploring the UNIX File System and File Security
Operating System Module 1: Linux Installation
Hệ thống File.
Linux File Systems Partitioning Mounting File Systems
COP 4343 Unix System Administration
Devices, Linux Filesystems,and the Filesystem Hirarchy standard
Presentation transcript:

laksh mi

 fdisk is an interactive utility to manipulate disk partitions.  Use fdisk –l to review the disks and partitions on the system.  Use fdisk and the disk special device file in order to create new partitions. Example: # fdisk /dev/hda

 The fdisk command supports many types of partitions.  Alternative:  Gnu parted – create, copy and manipulate partitions.  Sfdisk

 Linux Supports vast amount of local, disk based, file systems. For example:  Ext 2 – previous native Linux file system.  Ext 3 – Current native Linux file system.  Vfat – DOS 32 file system.  ISO9660 – CDROM Image file system.

 Ext 3 is the default FS in many Linux distributions.  Ext 3 is a journal FS, thus improves data integrity and system availability (fast fsck).  Ext 3 is an improvement of Ext 2, so transfer to Ext 3 is considerably easy.  Ext 3 FS is part of Linux Kernel since version

Super Block Group Disctiptors Block Bitmap Inode Bitmap Inode Table Data Block Group Same for all block groups

 Ext 3 FS is divided to block groups in order to reduce seek time and preserve data integrity (reduce fragments).  Each block group contains the following:  Super Block – the super block contains data about the status of the current FS. There are several instances of the Super Block on the FS. Each instance is stored at an offset of 1024 Bytes from the previous one.

The Super Block contains the following data:  Number of Inodes on the FS and the number of free Inodes.  Number of data blocks on the FS and the number of free data blocks.  Time and mounting point of the last system mount.  Flags indicating the state of the FS.  Number of times the FS was mounted.  Time the FS was last checked.  Maximum time permissible between checks.  Magic number indicating an Ext 3 FS.

 Group Discriptors – Contain information about the block group. Such as:  The address of the block containing the block bitmap of the group.  The address of the block containing the inode bitmap of the group.  The address of the block containing the indoe table of the group.

 Block bitmap indicates which blocks in the group have been allocated.  Inode bitmap indicates which Inodes in the group have been allocated.  Inode table is an array of Inodes for that particular group.

 Use mkfs command to create Ext 3 FS.  Example: # mkfs -t ext3 -b j -L local /dev/hdb1  -t - FS type (default Ext 2)  -b - Block Size (Default 1024)  -j - Journaled  -L - volume label

 Use the dumpe2fs command in order to view the properties of the Ext2/Ext3 file system.  The dumpe2fs command prints the super block and blocks group information for the file system present on device.

 Use tune2fs to convert exsisting Ext 2 FS to Ext 3 FS.  Example: # tune2fs -j -L local /dev/hdb1  -j - Add journal to the FS  -L - Volume Label

 File system status must be clean in order to be mounted and made available on the system.  The fsck command is used to check the consistancy of the file system, and optionally, repair it.

 Usage: fsck [-fp] [-b superblock ] device  -f – Force FS check. When the superblock indicates the FS state is clean, fsck exits automatically. Use this option to force fsck check.  -p – Fix file system inconsistancies automatically (rather then interactivly asking for intervention).  Device – Logical device name or volume label.

# fsck -f /dev/hda1 fsck 1.32 (09-Nov-2002) e2fsck 1.32 (09-Nov-2002) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /boot: 35/26520 files (2.9% non-contiguous), 12575/ blocks

 Use fsck with -b superblock option to restore damaged superblocks from backup.  If the superblock of the FS is damaged, there could be no access to data on the FS.  Ext 3 keeps backups of the Superblock.  Use mkfs with the -n option to find out the location of the superblock backup.

# mkfs -t ext3 -n /dev/hda1 mke2fs 1.32 (09-Nov-2002) Filesystem label=... Superblock backups stored on blocks: 8193, 24577, 40961, 57345, Superblock Back up Locations

# fsck -b 8193 /dev/hda1 fsck 1.32 (09-Nov-2002) e2fsck 1.32 (09-Nov-2002) /boot was not cleanly unmounted, check forced. Pass 1: Checking inodes, blocks, and sizes... Pass 5: Checking group summary information /boot: ***** FILE SYSTEM WAS MODIFIED ***** /boot: 35/26520 files (2.9% non-contiguous), 12575/ blocks Use the information gained by the mkfs command to salvage the FS superblock:

 In order to make the file system available for use, the file system must be mounted.  Use a directory as a mount point, to connect the file system about to be mounted to the file system tree, starting from root ( / ).  Each directory can be used to mount one file system at a time.  A directory that is being used can not serve as a mount point.

/ usr home etc local hda1 bin sbin lib hdb1 bin sbin

 Use the mount command in order to make FS available.  Syntax: mount -t type -o options logical_device mount_point  Example: # mount -t ext3 -o noatime /dev/hdb1 /usr/local

 -t – file system type. Local file systems could be:  Ext 2 (default)  Ext 3  msdos – FAT 16 FS  vfat – FAT 32 FS  ntfs - Windows NT

 -o – Mount option. Options could be:  ro – read only.  rw – read and write.  suid/nosuid – allow/deny suid bit to take effect.  exec/noexec – permit/deny the execution of binaries.  noatime – do not update file access time (makes FS much faster).

 logical_device – this could be either a logical device name like: dev/hdb1 or, a volume label like: LABEL=local  mount_point – A directory that would serve as the mount point for the file system.

 The /etc/fstab file is used to mount FS automatically at boot time or to make the mounting of frequently mounted FS easier.  The /etc/fstab is created during system installation and should be edited manually to include filesystems needed to be available when system starts.

LABEL=//ext3defaults1 1 LABEL=/boot/bootext3defaults1 2 none/dev/ptsdevpts gid=5,mode= none/procproc defaults 0 0 /dev/hda3 swapswap defaults 0 0 /etc/fstab file structure

 Device to Mount – Logical device name or Volume Label of the device to be mounted.  Mount Point – The directory to be the mount point of the file system.  File System Type – The type of te file system to be mounted.

 Mount Options – options should be used while working with the file system (defaults = rw, suid, exec, auto, nouser, async).  FS Backup – is used by the dump tool to decide which FS needs to be backed up. Accepted values are 0 for no backup, or 1 indicating this file system needs to be backed up.

FS Check Pass – the order by which file systems  needs to be checked before being mounted. Acceptable values are 1 to 9.  File systems are being checked according to the order starting with 1 ending with 9.  File systems with FS check pass 1 are being checked one after the other, while file systems with FS check pass 2 and up are being checked in parallel.

 fsck will try and correct any error it encountered which does not require changes to the file system.  If the error requires changes to the file system, the system drops to single user mode and fsck must be run manually.

 Upon writing an incomplete mount command, mount will try and get the missing information from /etc/fstab  Use the mount -a command to mount all local file systems listed in /etc/fstab (excpet those indicating noauto in the mount options).

 The /etc/mtab file contains information about all mounted file systems.  The /etc/mtab file is dynamically changed by the system and should not be edited manually.

# cat /etc/mtab /dev/hda2 / ext3 rw 0 0 none /proc proc rw 0 0 none /dev/pts devpts rw,gid=5,mode= usbdevfs /proc/bus/usb usbdevfs rw 0 0 /dev/hda1 /boot ext3 rw 0 0 none /dev/shm tmpfs rw 0 0 Example of /etc/mtab file:

 Use the umount command to make file systems unavailable.  Command usage: umount dir | device  Use either mount point or logical device name to make a file system unavailable.

 File systems could not be made unavailable if resources on that file system is being used. # cd /boot # umount /boot umount: /boot: device is busy Use fuser -v -m logical_device to check which processes are using the file system.

 Example: #fuser -v -m /dev/hda1 USER PID ACCESS COMMAND /dev/hda1 root 2471 f.... vi

# fuser -k -m /dev/hda1 /dev/hda1: 2471 Use fuser -k -m device to kill processes making use of the file system.