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

PPT
101 3.4 use streams, pipes and redirects
PPT
101 3.2 process text streams using filters
PPT
1.2 boot the system v2
PPT
101 1.3 runlevels , shutdown, and reboot
PPT
101 4.1 create partitions and filesystems
PPT
101 3.5 create, monitor and kill processes
PDF
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
PPT
101 1.2 boot the system
101 3.4 use streams, pipes and redirects
101 3.2 process text streams using filters
1.2 boot the system v2
101 1.3 runlevels , shutdown, and reboot
101 4.1 create partitions and filesystems
101 3.5 create, monitor and kill processes
Part 6 of "Introduction to linux for bioinformatics": Productivity tips
101 1.2 boot the system

What's hot (20)

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

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

PPT
101 4.2 maintain the integrity of filesystems
PPT
101 4.2 maintain the integrity of filesystems
PPT
4.2 maintain the integrity of filesystems
PPTX
11 linux filesystem copy
PPTX
Disk and File System Management in Linux
PPTX
Root file system
PPT
Ch12 system administration
PDF
Course 102: Lecture 27: FileSystems in Linux (Part 2)
PPTX
Files and directories in Linux 6
PDF
PPTX
Ubuntu File System
PDF
How to mount and unmount filesystem
PDF
Linux fundamental - Chap 10 fs
PDF
CIT173_Ch15_Mnstr_23.pdf
PDF
File Systems: Why, How and Where
PDF
Fsck Sx
PDF
Fsck Sx
PDF
TLPI Chapter 14 File Systems
PPT
101 4.3 control mounting and unmounting of filesystems
101 4.2 maintain the integrity of filesystems
101 4.2 maintain the integrity of filesystems
4.2 maintain the integrity of filesystems
11 linux filesystem copy
Disk and File System Management in Linux
Root file system
Ch12 system administration
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Files and directories in Linux 6
Ubuntu File System
How to mount and unmount filesystem
Linux fundamental - Chap 10 fs
CIT173_Ch15_Mnstr_23.pdf
File Systems: Why, How and Where
Fsck Sx
Fsck Sx
TLPI Chapter 14 File Systems
101 4.3 control mounting and unmounting of filesystems
Ad

More from Acácio Oliveira (20)

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

Recently uploaded (20)

PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Flame analysis and combustion estimation using large language and vision assi...
PPTX
The various Industrial Revolutions .pptx
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
Benefits of Physical activity for teenagers.pptx
PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
Five Habits of High-Impact Board Members
PPTX
Modernising the Digital Integration Hub
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
PDF
Architecture types and enterprise applications.pdf
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
DOCX
search engine optimization ppt fir known well about this
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPT
Geologic Time for studying geology for geologist
PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
sustainability-14-14877-v2.pddhzftheheeeee
Hindi spoken digit analysis for native and non-native speakers
Flame analysis and combustion estimation using large language and vision assi...
The various Industrial Revolutions .pptx
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
Custom Battery Pack Design Considerations for Performance and Safety
1 - Historical Antecedents, Social Consideration.pdf
Benefits of Physical activity for teenagers.pptx
Microsoft Excel 365/2024 Beginner's training
Five Habits of High-Impact Board Members
Modernising the Digital Integration Hub
A review of recent deep learning applications in wood surface defect identifi...
Convolutional neural network based encoder-decoder for efficient real-time ob...
Architecture types and enterprise applications.pdf
Taming the Chaos: How to Turn Unstructured Data into Decisions
search engine optimization ppt fir known well about this
A comparative study of natural language inference in Swahili using monolingua...
Geologic Time for studying geology for geologist
Credit Without Borders: AI and Financial Inclusion in Bangladesh
A contest of sentiment analysis: k-nearest neighbor versus neural network

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