Repairing file system errors with fsck

Source: Internet
Author: User

1, the problem description

Server Maint_samba

Because the server Maint_samba (Debian operating system) does not shut down properly, a file system error/dev/sdb1 occur during the reboot process, and you need to manually use fsck for scanning and repair. The following conditions occur:

......

Checking file systems. fsck 1.41.3 (12-oct-2008)

/DEV/SDB1 contains a file system with errors check forced

/DEV/SDB1:% of |========== percentage

......

/dev/sdb1:unexpected inconsistency; RUN fsck manually (i.e., without-a or-p options)

Fsck died with exit STATUS4

......

.../var/log/fsck/fsck---The location of the fsck error log

......

Warning

......

Press ENTER for maintenance

(or type control-d to continue):---ctrl+d continue to start the server.

2. Manual fsck Repair

2.1 fsck Introduction

Fsck can not only scan the file system, but also fix some problems with the file system. It is important to note that FSCK scans the file system in Single-user mode, repair mode, or after the device is Umount .

Warning: If you scan a running system, it can cause system files to become corrupted.

The file system Scan Tool has Fsck,fsck.ext2,fsck.jfs,fsck.msdos,fsck.vfat,fsck.ext3,fsck.reiserfs (REISERFSCK). where fsck defaults to support file system ext2, you should add-j parameters if you want to support ext3 file system scans. It is best to invoke different scanning tools based on different file systems , such as the Ext3 file system using the Fsck.ext3,ext2 file system to use FSCK.ETX2.

/DEV/SDB1 is a ext3 file system that only introduces FSCK.EXT3

Fsck.ext3

[Syntax]

fsck.ext3[necessary parameters [selection parameters] [equipment Code]

[function]

FSCK.EXT3 command:

Testing for EXT3 file systems

[Execute permissions]

Super User Normal User

[parameters]

Necessary Parameters

-A non-cross mode, automatic repair

-c check for damaged blocks.

-c< anti-narrator > Fsck.ext3 command will be all of the implementation process, to its reverse narrative, easy to monitor the program

-d verbose display command execution procedure

-F Force for inspection

-F Clean the data in the storage block area before checking the file system

-l< damaged block File > put the damaged blocks listed in the file into the tag

-l< damaged block File > Clear all Damaged flags, re-mark

-N non-interactive mode, set the file system to be checked for read-only

-p< number > Set the inode size that the FSCK.EXT2 command can handle

-R Interactive Mode

-R ignores directories

-S sequential check

-S effect is similar to the specified "-S" parameter

-T displays timing information for the FSCK.EXT2 command.

-V Display detailed process

-Y Close Interactive mode

Select Parameters

-b< partition first field address > Specify the starting address of the first field of the partition/super block

-b< Chunk Size > Set the size of each chunk of the partition

-I set the number of blocks in the inode buffer for the file system to check

-V Display version information

[reference Example]

Example 1: Detecting disks

[Root@linux test]# fsck.ext3/dev/fd0

Example 2: Detecting disks and displaying timing information

[Root@linux test]# fsck.ext3-ft/dev/fd0

2.2 Server Maint_samba use FSCK.EXT3 to repair the file system

2.2.1 View log of fsck error

fileserver:~# ls-l/var/log/fsck/

Total 8

-rw-r-----1 root adm 190 2011-06-09 10:03 CHECKFS

-rw-r-----1 root adm 2011-06-09 10:03 Checkroot

The FSCK error message appears in these two files.

fileserver:~# MORE/VAR/LOG/FSCK/CHECKFS

fileserver:~# More/var/log/fsck/checkroot

2.2.2 View the current run level:

FSCK.EXT3 Scan file system must be in Single-user mode, repair mode or the device Umount . If you scan a running system, it can cause system files to become corrupted.

choose to run in single user mode

# runlevel---View run level

fileserver:~# RunLevel

N 2

#init 1-single-user mode (1 S), you may need to enter the root password when converting to Single-user mode.

fileserver:~# Init 1

2.2.3 use FSCK.EXT3 to scan and repair a file system

fileserver:~# fsck.ext3-y/DEV/SDB1---Start scanning, correcting file system

Note the red box where you need to enter Yes

FSCK.EXT3 began to scan, modified file system, the process time is relatively long, the middle of a number of pauses in the process, just wait, you must not think that the crash and restart the server.

FSCK.EXT3 Scan and fix the file system, you may need to reboot the system as prompted. If you are not prompted to reboot the system, you will need to reboot to reboot the system.

fileserver:~# Reboot---reboot system

During the reboot of the system, FSCK scans the file system as follows:

When Fsck is finished, the login interface to the system is launched and no interference is required.

Reboot the system again and the system will start normally.

This server Maint_samba use fsck to repair the file system completion.

Turn from: http://blog.itpub.net/7351078/viewspace-697520/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.