特殊:Badtitle/NS100:SystemAdministration/Fsck:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Wikibot留言 | 贡献
无编辑摘要
Wikibot留言 | 贡献
无编辑摘要
 
第32行: 第32行:
fsck -F ufs /dev/sdb1
fsck -F ufs /dev/sdb1
</nowiki></pre>
</nowiki></pre>
It is also possible to run via the shutdown command:
<pre><nowiki>
shutdown -rF
</nowiki></pre>
Check in /var/log/fsck for results if running on a headless system or a VM where the console is not available during boot.
== Errors ==
== Errors ==
Still writing, finish tommorrow.
Still writing, finish tommorrow.

2010年5月20日 (四) 00:21的最新版本

{{#ifexist: :SystemAdministration/Fsck/zh | | {{#ifexist: SystemAdministration/Fsck/zh | | {{#ifeq: {{#titleparts:SystemAdministration/Fsck|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:SystemAdministration/Fsck|1|-1|}} | zh | | }}

This page is a default template for documentation on the wiki. To create a new guide on the wiki, read the page WikiGuide.

Please Include

I am listing information that I would like included in this article. Clearly, this article is a work in progress, and maybe I will clean it up a bit. Till then, I'm just listing the links I found. One question I have, is to how to run fsck on /. This link offers a solution. Also, please include the information in this link which describes how to change the frequency that a fsck is run at startup.

Introduction

This page introduces the fsck utility, used to check and repair file systems. File systems can become inconsistent. This can be caused by power failure, incomplete shut-down and hardware failure. This causes file system operations to be incomplete. This is less of a problem with journalized file systems (such as Ext3) which write changes to a log journal before committing to the main file system. In the case of a failure, the journal is re-executed until the system is consistent. If the system is interrupted and every thirty reboots, fsck is run.

The many faces of fsck

To the new user, there often seems to be a lot of applications with similar names to fsck, such as fsck, fsck.ext2 and e2fsck. This is because different applications have been written for each file system as it has been written. In order to consolidate this into one system, the file system name is appended to fsck to run that utility. For example: fsck.ext2 runs fsck on an ext2 file system.

How does it know which file systems to check?

The /etc/fstab file is scanned. All non-zero pass numbered partitions are checked starting with one (which is normally the root partition). Next all mounted file systems are scanned sequentially.

Running

Fsck should always be run in single user mode other wise data can be corrupted. Fsck runs in two modes: interactive - where each error encountered requires the users input and non-interactive where fsck attempts repair. The program is run using the command: Interactive:

fsck -F file_system_type partition

Non-interactive:

fsck -F file_system_type -y partition

For example, to check an ntfs partition, /dev/sdb1 non-interactively:

fsck -F ufs /dev/sdb1

It is also possible to run via the shutdown command:

shutdown -rF

Check in /var/log/fsck for results if running on a headless system or a VM where the console is not available during boot.

Errors

Still writing, finish tommorrow. This page is maintained by DougieRichardson.