个人工具

“UbuntuHelp:TestingStorageMedia”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
第2行: 第2行:
 
{{Languages|UbuntuHelp:TestingStorageMedia}}
 
{{Languages|UbuntuHelp:TestingStorageMedia}}
 
This page explains how to test storage media. If you suspect you have a problem with your hard disk, this page could help you.
 
This page explains how to test storage media. If you suspect you have a problem with your hard disk, this page could help you.
 
 
== Introduction ==
 
== Introduction ==
 
 
When you store your files, be they pictures or text, they reside on a physical media. They can be magnetically coded on the surface of a hard disk, etched and optically read from a CD, or electrically stored on a USB flash drive. Using these methods, your files are organised in a way analogous to placing files in a filing cabinet.  
 
When you store your files, be they pictures or text, they reside on a physical media. They can be magnetically coded on the surface of a hard disk, etched and optically read from a CD, or electrically stored on a USB flash drive. Using these methods, your files are organised in a way analogous to placing files in a filing cabinet.  
 
 
Nothing being perfect, there are two problems that may occur : your files may become lost - a corrupt index meaning that all the pieces of the files are so muddled up they no longer make any sense - or the storage media may develop defects - bad blocks on hard disks or scratched CDs.
 
Nothing being perfect, there are two problems that may occur : your files may become lost - a corrupt index meaning that all the pieces of the files are so muddled up they no longer make any sense - or the storage media may develop defects - bad blocks on hard disks or scratched CDs.
 
 
Of course, in case this should happen, tools exist to detect and repair errors. We will present these tools to you now, in the unlucky event you will need them. Remember, always backup your files on at least a separate media.
 
Of course, in case this should happen, tools exist to detect and repair errors. We will present these tools to you now, in the unlucky event you will need them. Remember, always backup your files on at least a separate media.
 
 
== Checking Filesystems ==
 
== Checking Filesystems ==
 
 
On occasion, errors may occur in the data stored on a disk. This may be due for example to power failures, system crashes or impetuous removal of media. When this happens, files may become lost or corrupt - you will need to check your data for validity.
 
On occasion, errors may occur in the data stored on a disk. This may be due for example to power failures, system crashes or impetuous removal of media. When this happens, files may become lost or corrupt - you will need to check your data for validity.
 
 
The tools used to check your data depend on your filesystem, please refer to the approriate section.
 
The tools used to check your data depend on your filesystem, please refer to the approriate section.
 
 
=== ext2 and ext3 ===
 
=== ext2 and ext3 ===
 
 
In a terminal run :
 
In a terminal run :
 
 
<pre><nowiki>
 
<pre><nowiki>
 
man e2fsck
 
man e2fsck
 
</nowiki></pre>
 
</nowiki></pre>
 
 
to consult the documentation related to testing there partitions.
 
to consult the documentation related to testing there partitions.
 
 
=== FAT32 and FAT16 ===
 
=== FAT32 and FAT16 ===
 
 
To check and repair MS-DOS type filesystem, we will use the dosfsck tool.
 
To check and repair MS-DOS type filesystem, we will use the dosfsck tool.
 
In a terminal, type the fooling to know the name of the partition you want to check :
 
In a terminal, type the fooling to know the name of the partition you want to check :
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo fdisk -l
 
sudo fdisk -l
 
</nowiki></pre>
 
</nowiki></pre>
 
 
No we will run the check with the following command (assuming your partition is /dev/hda1) :
 
No we will run the check with the following command (assuming your partition is /dev/hda1) :
 
 
<pre><nowiki>
 
<pre><nowiki>
 
dosfsck -a -v /dev/sda1
 
dosfsck -a -v /dev/sda1
 
</nowiki></pre>
 
</nowiki></pre>
 
 
* The a option is use to automatically repair the file system.
 
* The a option is use to automatically repair the file system.
 
* The v option is use to get some more information about the check.
 
* The v option is use to get some more information about the check.
 
 
You may have a look at :
 
You may have a look at :
 
<pre><nowiki>
 
<pre><nowiki>
第50行: 第32行:
 
</nowiki></pre>
 
</nowiki></pre>
 
to get some information about the others options available.
 
to get some information about the others options available.
 
 
=== NTFS ===
 
=== NTFS ===
 
 
Their is no equivalent yet to chkdsk/scandisk for NTFS in linux.
 
Their is no equivalent yet to chkdsk/scandisk for NTFS in linux.
 
 
The linux-ntfs team project to make one.
 
The linux-ntfs team project to make one.
 
 
Check http://wiki.linux-ntfs.org/doku.php?id=ntfsck for the current status of the project.
 
Check http://wiki.linux-ntfs.org/doku.php?id=ntfsck for the current status of the project.
 
 
In the meanwhile, you'll have to use windows to check your NTFS partition.
 
In the meanwhile, you'll have to use windows to check your NTFS partition.
 
 
== Checking for Physical defects ==
 
== Checking for Physical defects ==
 
 
In a terminal run :
 
In a terminal run :
 
 
<pre><nowiki>
 
<pre><nowiki>
 
man badblocks
 
man badblocks
 
</nowiki></pre>
 
</nowiki></pre>
 
 
to consult the documentation related to testing disks.
 
to consult the documentation related to testing disks.
 
 
== Recovering Data ==
 
== Recovering Data ==
 
 
[http://www.cgsecurity.org/wiki/TestDisk TestDisk] is a tool for recovering lost data, click on the previous link to visit their website.
 
[http://www.cgsecurity.org/wiki/TestDisk TestDisk] is a tool for recovering lost data, click on the previous link to visit their website.
 
 
You may also find this in the Universe repository [http://packages.ubuntu.com/dapper/admin/testdisk here].
 
You may also find this in the Universe repository [http://packages.ubuntu.com/dapper/admin/testdisk here].
 
 
== Further Reading ==
 
== Further Reading ==
 
 
* [http://yhslug.tux.org/docs/hdtest.htm Testing your hard drive]
 
* [http://yhslug.tux.org/docs/hdtest.htm Testing your hard drive]
 
 
----
 
----
 
 
<code><nowiki>This page is a stub, you can help the Ubuntu documentation team by expanding it.</nowiki></code>
 
<code><nowiki>This page is a stub, you can help the Ubuntu documentation team by expanding it.</nowiki></code>
 
 
[[category:CategoryHardware]]
 
[[category:CategoryHardware]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2007年11月30日 (五) 21:44的版本


This page explains how to test storage media. If you suspect you have a problem with your hard disk, this page could help you.

Introduction

When you store your files, be they pictures or text, they reside on a physical media. They can be magnetically coded on the surface of a hard disk, etched and optically read from a CD, or electrically stored on a USB flash drive. Using these methods, your files are organised in a way analogous to placing files in a filing cabinet. Nothing being perfect, there are two problems that may occur : your files may become lost - a corrupt index meaning that all the pieces of the files are so muddled up they no longer make any sense - or the storage media may develop defects - bad blocks on hard disks or scratched CDs. Of course, in case this should happen, tools exist to detect and repair errors. We will present these tools to you now, in the unlucky event you will need them. Remember, always backup your files on at least a separate media.

Checking Filesystems

On occasion, errors may occur in the data stored on a disk. This may be due for example to power failures, system crashes or impetuous removal of media. When this happens, files may become lost or corrupt - you will need to check your data for validity. The tools used to check your data depend on your filesystem, please refer to the approriate section.

ext2 and ext3

In a terminal run :

man e2fsck

to consult the documentation related to testing there partitions.

FAT32 and FAT16

To check and repair MS-DOS type filesystem, we will use the dosfsck tool. In a terminal, type the fooling to know the name of the partition you want to check :

sudo fdisk -l

No we will run the check with the following command (assuming your partition is /dev/hda1) :

dosfsck -a -v /dev/sda1
  • The a option is use to automatically repair the file system.
  • The v option is use to get some more information about the check.

You may have a look at :

man dosfsck

to get some information about the others options available.

NTFS

Their is no equivalent yet to chkdsk/scandisk for NTFS in linux. The linux-ntfs team project to make one. Check http://wiki.linux-ntfs.org/doku.php?id=ntfsck for the current status of the project. In the meanwhile, you'll have to use windows to check your NTFS partition.

Checking for Physical defects

In a terminal run :

man badblocks

to consult the documentation related to testing disks.

Recovering Data

TestDisk is a tool for recovering lost data, click on the previous link to visit their website. You may also find this in the Universe repository here.

Further Reading


This page is a stub, you can help the Ubuntu documentation team by expanding it.