0% found this document useful (0 votes)
24 views

How To Fix File Systems in Linux

The Linux file system can become corrupt and must be fixed using the fsck command in single-user mode. To fix a file system, one must first open a terminal, become the root user, check which file system needs fixing using the mount command, bring the system to run level one using init 1, unmount the file system with umount, run fsck with the correct options to check and repair the file system, remount the file system, and return to multi-user mode with init 3.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

How To Fix File Systems in Linux

The Linux file system can become corrupt and must be fixed using the fsck command in single-user mode. To fix a file system, one must first open a terminal, become the root user, check which file system needs fixing using the mount command, bring the system to run level one using init 1, unmount the file system with umount, run fsck with the correct options to check and repair the file system, remount the file system, and return to multi-user mode with init 3.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

How to Fix File Systems in Linux

Kristen Waters Kristen Waters has been writing for the computer industry since 2004. She has written training materials for both large and small computer companies as well as how-to and informative articles for many online publications. She holds Bachelor of Science degrees from both York College of Pennsylvania and the University of Maryland. By Kristen Waters, eHow Contributor updated: March 28, 2011 The Linux operating system is made up of one or more file systems. These file systems can become corrupt over time, or if the computer was not powered down correctly. The "fsck" command is used to fix corrupt file systems. This command must be run in single user mode. Single user mode only allows the root user to be logged into the system. The file system that is being checked must be unmounted (not in use). Difficulty: Easy

Instructions
o

1. 1 Open a terminal window. The terminal window is located under the "Accessories," "Utilities" or "Xterm" sections of the main "Applications" or "Program" menu.

2 Type the command "su" to become the root user. Type the root password, when prompted.

3 Type the command "mount," to see the list of file systems. Note the name and type of the file system you want to fix. The file system name will be

something like "/dev/sda2" or "/home." The type will typically be "ext2" or "ext3."
o

4 Type the command "init 1" to bring the system down to run level one. This ensures that only the root user can access the file system.

5 Type the command "umount /dev/sda2" to unmount the file system that you want to fix. Replace "/dev/sda2" with the correct file system name.

6 Type the command "fsck -t ext2 /dev/sda2," to fix the file system. Replace "ext2" with the correct filesystem type. Replace "/dev/sda2" with the correct file system name. This command will run take some time, depending on the size of the file system.

7 Repeat Step 5 until the output reports a "0" or no errors.

8 Type the command "mount /dev/sda2" to remount the filesystem.

9 Type the command "init 3" to bring the system back up to multi-user mode.

You might also like