SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Linux File System
Partitions & the fdisk command
• 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
Partitions & the fdisk command
• The fdisk command supports many types
of partitions.
• Alternative:
– Gnu parted – create, copy and manipulate
partitions.
– Sfdisk
Supported Local File Systems
• 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 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 2.4.16.
Super
Block
Ext 3 File System Structure
Group
Disctiptors
Block
Bitmap
Inode
Bitmap
Inode
Table
Data Data Data
Block Group
Same for all block groups
Ext 3 File System Structure
• 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.
Ext 3 File System Structure
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.
Ext 3 File System Structure
– 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.
Ext 3 File System Structure
 Count of free blocks in the group.
 Count of free indoes in 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.
Creating Ext 3 File System
• Use mkfs command to create Ext 3 FS.
• Example:
# mkfs -t ext3 -b 2048 -j -L local /dev/hdb1
• -t - FS type (default Ext 2)
• -b - Block Size (Default 1024)
• -j - Journaled
• -L - volume label
The dumpe2fs Command
• 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.
Converting Ext 2 to Ext 3
• 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
Using the fsck Command
• 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.
Using the fsck Command
• 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.
Using the fsck Command
# 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/105808 blocks
Restoring Damaged Superblock
• 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, 73729
Superblock Back up Locations
Restoring Damaged Superblock
Restoring Damaged Superblock
# 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/105808 blocks
• Use the information gained by the mkfs
command to salvage the FS superblock:
Mounting File Systems
• 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.
Mouting File Systems
/
usr
home
etc
local
hda1
bin
sbin
lib
hdb1
bin
sbin
The Mount Command
• 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
The Mount Command
• -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
The Mount Command
• -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).
The Mount Command
• 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
• 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.
The /etc/fstab File
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
/dev/hda3 swap swap defaults 0 0
/etc/fstab file structure
The /etc/fstab File
• 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.
The /etc/fstab File
• 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.
The /etc/fstab File
• 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.
The /etc/fstab File
 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.
The /etc/fstab File and mount
• 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).
/etc/mtab File
• 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.
/etc/mtab File
# cat /etc/mtab
/dev/hda2 / ext3 rw 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
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:
The umount Command
• 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.
The umount Command
• 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.
The umount Command
#fuser -v -m /dev/hda1
USER PID ACCESS COMMAND
/dev/hda1 root 2471 f.... vi
• Example:
The umount Command
# fuser -k -m /dev/hda1
/dev/hda1: 2471
• Use fuser -k -m device to kill processes making
use of the file system.

Weitere ähnliche Inhalte

Was ist angesagt?

Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystemsAcácio Oliveira
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory StructureKevin OBrien
 
How to design a file system
How to design a file systemHow to design a file system
How to design a file systemNikhil Anurag VN
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemHungWei Chiu
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemSadia Bashir
 
Lecture 5 Kernel Development
Lecture 5 Kernel DevelopmentLecture 5 Kernel Development
Lecture 5 Kernel DevelopmentMohammed Farrag
 
A Quick Introduction to Linux
A Quick Introduction to LinuxA Quick Introduction to Linux
A Quick Introduction to LinuxTusharadri Sarkar
 
Lpi lição 01 exam 102 objectives
Lpi lição 01  exam 102 objectivesLpi lição 01  exam 102 objectives
Lpi lição 01 exam 102 objectivesAcácio Oliveira
 
Files and directories in Linux 6
Files and directories  in Linux 6Files and directories  in Linux 6
Files and directories in Linux 6Meenakshi Paul
 
Writing flexible filesystems in FUSE-Python
Writing flexible filesystems in FUSE-PythonWriting flexible filesystems in FUSE-Python
Writing flexible filesystems in FUSE-PythonAnurag Patel
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2Acácio Oliveira
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentalsDima Gomaa
 

Was ist angesagt? (20)

Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
pptdisk
pptdiskpptdisk
pptdisk
 
101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems101 4.3 control mounting and unmounting of filesystems
101 4.3 control mounting and unmounting of filesystems
 
Vfs
VfsVfs
Vfs
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Linux file system
Linux file systemLinux file system
Linux file system
 
How to design a file system
How to design a file systemHow to design a file system
How to design a file system
 
Linux lecture5
Linux lecture5Linux lecture5
Linux lecture5
 
The basic concept of Linux FIleSystem
The basic concept of Linux FIleSystemThe basic concept of Linux FIleSystem
The basic concept of Linux FIleSystem
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Lesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File SystemLesson 2 Understanding Linux File System
Lesson 2 Understanding Linux File System
 
Lecture 5 Kernel Development
Lecture 5 Kernel DevelopmentLecture 5 Kernel Development
Lecture 5 Kernel Development
 
A Quick Introduction to Linux
A Quick Introduction to LinuxA Quick Introduction to Linux
A Quick Introduction to Linux
 
Lpi lição 01 exam 102 objectives
Lpi lição 01  exam 102 objectivesLpi lição 01  exam 102 objectives
Lpi lição 01 exam 102 objectives
 
Files and directories in Linux 6
Files and directories  in Linux 6Files and directories  in Linux 6
Files and directories in Linux 6
 
1.2 boot the system v2
1.2 boot the system v21.2 boot the system v2
1.2 boot the system v2
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Writing flexible filesystems in FUSE-Python
Writing flexible filesystems in FUSE-PythonWriting flexible filesystems in FUSE-Python
Writing flexible filesystems in FUSE-Python
 
101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2101 2.1 design hard disk layout v2
101 2.1 design hard disk layout v2
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 

Ähnlich wie 11 linux filesystem copy

Root file system
Root file systemRoot file system
Root file systemBindu U
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystemsAcácio Oliveira
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Ahmed El-Arabawy
 
Linux Basics
Linux BasicsLinux Basics
Linux BasicsLokesh C
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systemsalok pal
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
UNIX(Essential needs of administration)
UNIX(Essential needs of administration)UNIX(Essential needs of administration)
UNIX(Essential needs of administration)Papu Kumar
 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsShu-Yu Fu
 
101 4.2 maintain the integrity of filesystems
101 4.2 maintain the integrity of filesystems101 4.2 maintain the integrity of filesystems
101 4.2 maintain the integrity of filesystemsAcácio Oliveira
 
Poking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And ProfitPoking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And Profitssusera432ea1
 
101 2.1 design hard disk layout
101 2.1 design hard disk layout101 2.1 design hard disk layout
101 2.1 design hard disk layoutAcácio Oliveira
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control YuvrajWadavale
 

Ähnlich wie 11 linux filesystem copy (20)

Ch12
Ch12Ch12
Ch12
 
Root file system
Root file systemRoot file system
Root file system
 
101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems101 4.1 create partitions and filesystems
101 4.1 create partitions and filesystems
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
 
Unix Administration 4
Unix Administration 4Unix Administration 4
Unix Administration 4
 
Windowsforensics
WindowsforensicsWindowsforensics
Windowsforensics
 
Linux Basics
Linux BasicsLinux Basics
Linux Basics
 
Ch12 system administration
Ch12 system administration Ch12 system administration
Ch12 system administration
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
UNIX(Essential needs of administration)
UNIX(Essential needs of administration)UNIX(Essential needs of administration)
UNIX(Essential needs of administration)
 
TLPI Chapter 14 File Systems
TLPI Chapter 14 File SystemsTLPI Chapter 14 File Systems
TLPI Chapter 14 File Systems
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
 
101 4.2 maintain the integrity of filesystems
101 4.2 maintain the integrity of filesystems101 4.2 maintain the integrity of filesystems
101 4.2 maintain the integrity of filesystems
 
Poking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And ProfitPoking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And Profit
 
101 2.1 design hard disk layout
101 2.1 design hard disk layout101 2.1 design hard disk layout
101 2.1 design hard disk layout
 
Os
OsOs
Os
 
File000128
File000128File000128
File000128
 
File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
 

Mehr von Shay Cohen

Linux Performance Tunning Memory
Linux Performance Tunning MemoryLinux Performance Tunning Memory
Linux Performance Tunning MemoryShay Cohen
 
Linux Performance Tunning Kernel
Linux Performance Tunning KernelLinux Performance Tunning Kernel
Linux Performance Tunning KernelShay Cohen
 
Linux Performance Tunning introduction
Linux Performance Tunning introductionLinux Performance Tunning introduction
Linux Performance Tunning introductionShay Cohen
 
chroot and SELinux
chroot and SELinuxchroot and SELinux
chroot and SELinuxShay Cohen
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Infra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automationInfra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automationShay Cohen
 
14 network tools
14 network tools14 network tools
14 network toolsShay Cohen
 
13 process management
13 process management13 process management
13 process managementShay Cohen
 
12 linux archiving tools
12 linux archiving tools12 linux archiving tools
12 linux archiving toolsShay Cohen
 
10 finding files
10 finding files10 finding files
10 finding filesShay Cohen
 
08 text processing_tools
08 text processing_tools08 text processing_tools
08 text processing_toolsShay Cohen
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editorShay Cohen
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissionsShay Cohen
 
05 standard io_and_pipes
05 standard io_and_pipes05 standard io_and_pipes
05 standard io_and_pipesShay Cohen
 
04 using and_configuring_bash
04 using and_configuring_bash04 using and_configuring_bash
04 using and_configuring_bashShay Cohen
 
03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystemShay Cohen
 
02 linux desktop usage
02 linux desktop usage02 linux desktop usage
02 linux desktop usageShay Cohen
 
09 string processing_with_regex copy
09 string processing_with_regex copy09 string processing_with_regex copy
09 string processing_with_regex copyShay Cohen
 
01 linux history overview
01 linux history overview01 linux history overview
01 linux history overviewShay Cohen
 

Mehr von Shay Cohen (19)

Linux Performance Tunning Memory
Linux Performance Tunning MemoryLinux Performance Tunning Memory
Linux Performance Tunning Memory
 
Linux Performance Tunning Kernel
Linux Performance Tunning KernelLinux Performance Tunning Kernel
Linux Performance Tunning Kernel
 
Linux Performance Tunning introduction
Linux Performance Tunning introductionLinux Performance Tunning introduction
Linux Performance Tunning introduction
 
chroot and SELinux
chroot and SELinuxchroot and SELinux
chroot and SELinux
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Infra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automationInfra / Cont delivery - 3rd party automation
Infra / Cont delivery - 3rd party automation
 
14 network tools
14 network tools14 network tools
14 network tools
 
13 process management
13 process management13 process management
13 process management
 
12 linux archiving tools
12 linux archiving tools12 linux archiving tools
12 linux archiving tools
 
10 finding files
10 finding files10 finding files
10 finding files
 
08 text processing_tools
08 text processing_tools08 text processing_tools
08 text processing_tools
 
07 vi text_editor
07 vi text_editor07 vi text_editor
07 vi text_editor
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
 
05 standard io_and_pipes
05 standard io_and_pipes05 standard io_and_pipes
05 standard io_and_pipes
 
04 using and_configuring_bash
04 using and_configuring_bash04 using and_configuring_bash
04 using and_configuring_bash
 
03 browsing the filesystem
03 browsing the filesystem03 browsing the filesystem
03 browsing the filesystem
 
02 linux desktop usage
02 linux desktop usage02 linux desktop usage
02 linux desktop usage
 
09 string processing_with_regex copy
09 string processing_with_regex copy09 string processing_with_regex copy
09 string processing_with_regex copy
 
01 linux history overview
01 linux history overview01 linux history overview
01 linux history overview
 

Kürzlich hochgeladen

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Kürzlich hochgeladen (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

11 linux filesystem copy

  • 2. Partitions & the fdisk command • 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
  • 3. Partitions & the fdisk command • The fdisk command supports many types of partitions. • Alternative: – Gnu parted – create, copy and manipulate partitions. – Sfdisk
  • 4. Supported Local File Systems • 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.
  • 5. Ext 3 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 2.4.16.
  • 6. Super Block Ext 3 File System Structure Group Disctiptors Block Bitmap Inode Bitmap Inode Table Data Data Data Block Group Same for all block groups
  • 7. Ext 3 File System Structure • 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.
  • 8. Ext 3 File System Structure 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.
  • 9. Ext 3 File System Structure – 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.
  • 10. Ext 3 File System Structure  Count of free blocks in the group.  Count of free indoes in 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.
  • 11. Creating Ext 3 File System • Use mkfs command to create Ext 3 FS. • Example: # mkfs -t ext3 -b 2048 -j -L local /dev/hdb1 • -t - FS type (default Ext 2) • -b - Block Size (Default 1024) • -j - Journaled • -L - volume label
  • 12. The dumpe2fs Command • 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.
  • 13. Converting Ext 2 to Ext 3 • 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
  • 14. Using the fsck Command • 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.
  • 15. Using the fsck Command • 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.
  • 16. Using the fsck Command # 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/105808 blocks
  • 17. Restoring Damaged Superblock • 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.
  • 18. # mkfs -t ext3 -n /dev/hda1 mke2fs 1.32 (09-Nov-2002) Filesystem label= ... Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729 Superblock Back up Locations Restoring Damaged Superblock
  • 19. Restoring Damaged Superblock # 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/105808 blocks • Use the information gained by the mkfs command to salvage the FS superblock:
  • 20. Mounting File Systems • 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.
  • 22. The Mount Command • 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
  • 23. The Mount Command • -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
  • 24. The Mount Command • -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).
  • 25. The Mount Command • 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.
  • 26. The /etc/fstab File • 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.
  • 27. The /etc/fstab File LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /proc proc defaults 0 0 /dev/hda3 swap swap defaults 0 0 /etc/fstab file structure
  • 28. The /etc/fstab File • 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.
  • 29. The /etc/fstab File • 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.
  • 30. The /etc/fstab File • 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.
  • 31. The /etc/fstab File  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.
  • 32. The /etc/fstab File and mount • 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).
  • 33. /etc/mtab File • 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.
  • 34. /etc/mtab File # cat /etc/mtab /dev/hda2 / ext3 rw 0 0 none /proc proc rw 0 0 none /dev/pts devpts rw,gid=5,mode=620 0 0 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:
  • 35. The umount Command • 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.
  • 36. The umount Command • 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.
  • 37. The umount Command #fuser -v -m /dev/hda1 USER PID ACCESS COMMAND /dev/hda1 root 2471 f.... vi • Example:
  • 38. The umount Command # fuser -k -m /dev/hda1 /dev/hda1: 2471 • Use fuser -k -m device to kill processes making use of the file system.