SlideShare a Scribd company logo
1 of 10
Junior Level Linux Certification
Exam Objectives
Key Knowledge Areas
Verify the integrity of filesystems.
Monitor free space and inodes.
Repair simple filesystem problems.
Objective 4: Devices, Linux Filesystems, Filesystem Hierarchy Standard
Maintain the integrity of filesystems Weight: 2
Terms and Utilities
du
df
fsck
e2fsck
mke2fs
debugfs
dumpe2fs
tune2fs
xfs tools
2
Integrity of Filesystems
3
The main tool for checking filesystems is fsck
like mkfs, its a front end to filesystem-checking routines for various filesystem types.
Ex: $ ls /sbin/*fsck*
/sbin/btrfsck /sbin/fsck /sbin/fsck.ext3 /sbin/fsck.msdos
/sbin/dosfsck /sbin/fsck.cramfs /sbin/fsck.ext4 /sbin/fsck.vfat
/sbin/e2fsck /sbin/fsck.ext2 /sbin/fsck.ext4dev /sbin/fsck.xfs
Maintain the integrity of filesystems
Integrity of Filesystems
4
Using fsck to check filesystems
Ex: [root@comp~]# # find the device for LABEL=EXT3TEST
[root@comp~]# blkid -L EXT3TEST
/dev/sda7
[root@comp ~]# # Find label and UUID for /dev/sda7
[root@comp ~]# blkid /dev/sda7
/dev/sda7: LABEL="EXT3TEST" UUID="7803f979-ffde-4e7f-891c-b633eff981f0" SEC_TYPE="ext2"
TYPE="ext3"
[root@comp ~]# # Check /dev/sda7
[root@comp ~]# fsck /dev/sda7
fsck from util-linux-ng 2.16.2
e2fsck 1.41.9 (22-Aug-2009)
EXT3TEST: clean, 11/7159808 files, 497418/28637862 blocks
[root@comp ~]# # Check it by label using fsck.ext3
[root@comp ~]# fsck.ext3 LABEL=EXT3TEST
e2fsck 1.41.9 (22-Aug-2009)
EXT3TEST: clean, 11/7159808 files, 497418/28637862 blocks
[root@comp ~]# # Check it by UUID using e2fsck
[root@comp ~]# e2fsck UUID=7803f979-ffde-4e7f-891c-b633eff981f0
e2fsck 1.41.9 (22-Aug-2009)
EXT3TEST: clean, 11/7159808 files, 497418/28637862 blocks
[root@comp~]# # Finally check the vfat partition
[root@comp ~]# fsck LABEL=DOS
fsck from util-linux-ng 2.16.2
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
/dev/sda9: 1 files, 1/513064 clusters
Maintain the integrity of filesystems
Integrity of Filesystems
5
Error on attempt to check a mounted filesystem
Ex: [root@comp ~]# fsck UUID=a18492c0-7ee2-4339-9010-3a15ec0079bb
fsck from util-linux-ng 2.16.2
e2fsck 1.41.9 (22-Aug-2009)
/dev/sdb9 is mounted.
WARNING!!! Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.
Do you really want to continue (y/n)? No
check aborted.
Maintain the integrity of filesystems
Integrity of Filesystems
6
Monitoring free space
df cmd infos the whole filesystem. with option –T infos the mounted filesystems.
Ex: [root@comp ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sdb9 ext3 45358500 24670140 18384240 58% /
tmpfs tmpfs 1927044 808 1926236 1% /dev/shm
/dev/sda2 ext3 772976 17760 716260 3% /grubfile
/dev/sda8 xfs 41933232 4272 41928960 1% /mnt/xfstest
/dev/sda7 ext3 112754024 192248 106834204 1% /mnt/ext3test
/dev/sda9 vfat 2052256 4 2052252 1% /dos
Maintain the integrity of filesystems
with option – i Contains info on blocks contained in an inode
inode number is the file serial number - unique in the filesystem.
Inode info: owner, when file was last accessed, size, if it’s a directory, who can read/write to it.
ReiserFS and FAT32 dont have inodes (metadata files and directories are kept elsewhere)
Integrity of Filesystems
7
Maintain the integrity of filesystems
tune2fs cmd used to info block count; if fs is journaled; convert ext2 to ext3
Ex: [root@comp ~]# tune2fs -l /dev/sda2
du cmd gives info about the filename (or filenames) given as parameters.
Ex: [root@comp ~]# du -hc *
[root@comp ~]# du -shc /usr/*
Integrity of Filesystems
8
Maintain the integrity of filesystems
debugfs allows to explore inner workings of an ext filesystem.
allows to attempt undeletion of files or directories
Ex: [root@comp ~]# debugfs /dev/sdb9
Fim de sessão
9
Fim de sessão
9

More Related Content

What's hot

Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
meashi
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guide
wensheng wei
 
101 4.7 find system files and place files in the correct location
101 4.7 find system files and place files in the correct location101 4.7 find system files and place files in the correct location
101 4.7 find system files and place files in the correct location
Acácio Oliveira
 

What's hot (20)

Know the UNIX Commands
Know the UNIX CommandsKnow the UNIX Commands
Know the UNIX Commands
 
Linux
Linux Linux
Linux
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Unix(introduction)
Unix(introduction)Unix(introduction)
Unix(introduction)
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Linux Security Quick Reference Guide
Linux Security Quick Reference GuideLinux Security Quick Reference Guide
Linux Security Quick Reference Guide
 
101 4.7 find system files and place files in the correct location
101 4.7 find system files and place files in the correct location101 4.7 find system files and place files in the correct location
101 4.7 find system files and place files in the correct location
 
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
 
Bozorgmeh os lab
Bozorgmeh os labBozorgmeh os lab
Bozorgmeh os lab
 
Linux Command Suumary
Linux Command SuumaryLinux Command Suumary
Linux Command Suumary
 
Basic linux day 5
Basic linux day 5Basic linux day 5
Basic linux day 5
 
SGN Introduction to UNIX Command-line 2015 part 1
SGN Introduction to UNIX Command-line 2015 part 1SGN Introduction to UNIX Command-line 2015 part 1
SGN Introduction to UNIX Command-line 2015 part 1
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
Basic Linux day 1
Basic Linux day 1Basic Linux day 1
Basic Linux day 1
 
Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013Unix Linux Commands Presentation 2013
Unix Linux Commands Presentation 2013
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
Part 5 of "Introduction to Linux for Bioinformatics": Working the command lin...
 

Similar to 101 4.2 maintain the integrity of filesystems

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
Acácio Oliveira
 
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
Acácio Oliveira
 
For the accompanying inquiries enter the answer and give complete expl.docx
For the accompanying inquiries enter the answer and give complete expl.docxFor the accompanying inquiries enter the answer and give complete expl.docx
For the accompanying inquiries enter the answer and give complete expl.docx
edmundp8cgllams
 

Similar to 101 4.2 maintain the integrity of filesystems (20)

Ch12 system administration
Ch12 system administration Ch12 system administration
Ch12 system 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
 
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
 
11 linux filesystem copy
11 linux filesystem copy11 linux filesystem copy
11 linux filesystem copy
 
4.2 maintain the integrity of filesystems
4.2 maintain the integrity of filesystems4.2 maintain the integrity of filesystems
4.2 maintain the integrity of filesystems
 
Ch12
Ch12Ch12
Ch12
 
Unix Administration 4
Unix Administration 4Unix Administration 4
Unix Administration 4
 
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
 
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
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
pptdisk
pptdiskpptdisk
pptdisk
 
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
 
Root file system for embedded systems
Root file system for embedded systemsRoot file system for embedded systems
Root file system for embedded systems
 
Forensic artifacts in modern linux systems
Forensic artifacts in modern linux systemsForensic artifacts in modern linux systems
Forensic artifacts in modern linux systems
 
For the accompanying inquiries enter the answer and give complete expl.docx
For the accompanying inquiries enter the answer and give complete expl.docxFor the accompanying inquiries enter the answer and give complete expl.docx
For the accompanying inquiries enter the answer and give complete expl.docx
 
HARD DISK PARTITIONING,FORMATING
HARD DISK PARTITIONING,FORMATINGHARD DISK PARTITIONING,FORMATING
HARD DISK PARTITIONING,FORMATING
 
4.1 create partitions and filesystems
4.1 create partitions and filesystems4.1 create partitions and filesystems
4.1 create partitions and filesystems
 
Forcefully unmount a linux disk partition
Forcefully unmount a linux disk partitionForcefully unmount a linux disk partition
Forcefully unmount a linux disk partition
 
(120513) #fitalk an introduction to linux memory forensics
(120513) #fitalk   an introduction to linux memory forensics(120513) #fitalk   an introduction to linux memory forensics
(120513) #fitalk an introduction to linux memory forensics
 

More from Acácio Oliveira

More from Acácio Oliveira (20)

Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptxSecurity+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
Security+ Lesson 01 Topic 24 - Vulnerability Scanning vs Pen Testing.pptx
 
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptxSecurity+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
Security+ Lesson 01 Topic 25 - Application Security Controls and Techniques.pptx
 
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptxSecurity+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
Security+ Lesson 01 Topic 21 - Types of Application Attacks.pptx
 
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptxSecurity+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
Security+ Lesson 01 Topic 19 - Summary of Social Engineering Attacks.pptx
 
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptxSecurity+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
Security+ Lesson 01 Topic 23 - Overview of Security Assessment Tools.pptx
 
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptxSecurity+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
Security+ Lesson 01 Topic 20 - Summary of Wireless Attacks.pptx
 
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptxSecurity+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
Security+ Lesson 01 Topic 22 - Security Enhancement Techniques.pptx
 
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptxSecurity+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
Security+ Lesson 01 Topic 15 - Risk Management Best Practices.pptx
 
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptxSecurity+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
Security+ Lesson 01 Topic 13 - Physical Security and Environmental Controls.pptx
 
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptxSecurity+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
Security+ Lesson 01 Topic 14 - Disaster Recovery Concepts.pptx
 
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptxSecurity+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
Security+ Lesson 01 Topic 06 - Wireless Security Considerations.pptx
 
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
Security+ Lesson 01 Topic 04 - Secure Network Design Elements and Components....
 
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptxSecurity+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
Security+ Lesson 01 Topic 02 - Secure Network Administration Concepts.pptx
 
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptxSecurity+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
Security+ Lesson 01 Topic 01 - Intro to Network Devices.pptx
 
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
Security+ Lesson 01 Topic 08 - Integrating Data and Systems with Third Partie...
 
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptxSecurity+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
Security+ Lesson 01 Topic 07 - Risk Related Concepts.pptx
 
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptxSecurity+ Lesson 01 Topic 05 - Common Network Protocols.pptx
Security+ Lesson 01 Topic 05 - Common Network Protocols.pptx
 
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptxSecurity+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
Security+ Lesson 01 Topic 11 - Incident Response Concepts.pptx
 
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptxSecurity+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
Security+ Lesson 01 Topic 12 - Security Related Awareness and Training.pptx
 
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptxSecurity+ Lesson 01 Topic 17 - Types of Malware.pptx
Security+ Lesson 01 Topic 17 - Types of Malware.pptx
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

101 4.2 maintain the integrity of filesystems

  • 1. Junior Level Linux Certification
  • 2. Exam Objectives Key Knowledge Areas Verify the integrity of filesystems. Monitor free space and inodes. Repair simple filesystem problems. Objective 4: Devices, Linux Filesystems, Filesystem Hierarchy Standard Maintain the integrity of filesystems Weight: 2 Terms and Utilities du df fsck e2fsck mke2fs debugfs dumpe2fs tune2fs xfs tools 2
  • 3. Integrity of Filesystems 3 The main tool for checking filesystems is fsck like mkfs, its a front end to filesystem-checking routines for various filesystem types. Ex: $ ls /sbin/*fsck* /sbin/btrfsck /sbin/fsck /sbin/fsck.ext3 /sbin/fsck.msdos /sbin/dosfsck /sbin/fsck.cramfs /sbin/fsck.ext4 /sbin/fsck.vfat /sbin/e2fsck /sbin/fsck.ext2 /sbin/fsck.ext4dev /sbin/fsck.xfs Maintain the integrity of filesystems
  • 4. Integrity of Filesystems 4 Using fsck to check filesystems Ex: [root@comp~]# # find the device for LABEL=EXT3TEST [root@comp~]# blkid -L EXT3TEST /dev/sda7 [root@comp ~]# # Find label and UUID for /dev/sda7 [root@comp ~]# blkid /dev/sda7 /dev/sda7: LABEL="EXT3TEST" UUID="7803f979-ffde-4e7f-891c-b633eff981f0" SEC_TYPE="ext2" TYPE="ext3" [root@comp ~]# # Check /dev/sda7 [root@comp ~]# fsck /dev/sda7 fsck from util-linux-ng 2.16.2 e2fsck 1.41.9 (22-Aug-2009) EXT3TEST: clean, 11/7159808 files, 497418/28637862 blocks [root@comp ~]# # Check it by label using fsck.ext3 [root@comp ~]# fsck.ext3 LABEL=EXT3TEST e2fsck 1.41.9 (22-Aug-2009) EXT3TEST: clean, 11/7159808 files, 497418/28637862 blocks [root@comp ~]# # Check it by UUID using e2fsck [root@comp ~]# e2fsck UUID=7803f979-ffde-4e7f-891c-b633eff981f0 e2fsck 1.41.9 (22-Aug-2009) EXT3TEST: clean, 11/7159808 files, 497418/28637862 blocks [root@comp~]# # Finally check the vfat partition [root@comp ~]# fsck LABEL=DOS fsck from util-linux-ng 2.16.2 dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN /dev/sda9: 1 files, 1/513064 clusters Maintain the integrity of filesystems
  • 5. Integrity of Filesystems 5 Error on attempt to check a mounted filesystem Ex: [root@comp ~]# fsck UUID=a18492c0-7ee2-4339-9010-3a15ec0079bb fsck from util-linux-ng 2.16.2 e2fsck 1.41.9 (22-Aug-2009) /dev/sdb9 is mounted. WARNING!!! Running e2fsck on a mounted filesystem may cause SEVERE filesystem damage. Do you really want to continue (y/n)? No check aborted. Maintain the integrity of filesystems
  • 6. Integrity of Filesystems 6 Monitoring free space df cmd infos the whole filesystem. with option –T infos the mounted filesystems. Ex: [root@comp ~]# df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/sdb9 ext3 45358500 24670140 18384240 58% / tmpfs tmpfs 1927044 808 1926236 1% /dev/shm /dev/sda2 ext3 772976 17760 716260 3% /grubfile /dev/sda8 xfs 41933232 4272 41928960 1% /mnt/xfstest /dev/sda7 ext3 112754024 192248 106834204 1% /mnt/ext3test /dev/sda9 vfat 2052256 4 2052252 1% /dos Maintain the integrity of filesystems with option – i Contains info on blocks contained in an inode inode number is the file serial number - unique in the filesystem. Inode info: owner, when file was last accessed, size, if it’s a directory, who can read/write to it. ReiserFS and FAT32 dont have inodes (metadata files and directories are kept elsewhere)
  • 7. Integrity of Filesystems 7 Maintain the integrity of filesystems tune2fs cmd used to info block count; if fs is journaled; convert ext2 to ext3 Ex: [root@comp ~]# tune2fs -l /dev/sda2 du cmd gives info about the filename (or filenames) given as parameters. Ex: [root@comp ~]# du -hc * [root@comp ~]# du -shc /usr/*
  • 8. Integrity of Filesystems 8 Maintain the integrity of filesystems debugfs allows to explore inner workings of an ext filesystem. allows to attempt undeletion of files or directories Ex: [root@comp ~]# debugfs /dev/sdb9