Check Disk Cleanup repair command fsck | xfs_repair testdisk repair disk repair disk file

How to repair the disk using the chkdsk command

fsck | xfs_repair disk repair

 

fsck

Access: superuser
  
  usage: fsck [-sACVRP] [-t FStype] [-] [fsck-Options]  File SYS [...]
  
  Note: In the Linux system, in order to increase system performance, usually the default Some write data in memory, and does not directly write data to the hard disk, this is because the memory speed is several times faster than a hard disk. But there is a problem, if due to the "off" or other unknown reasons, causing system crashes, how do? The system collapsed. So, we need to get data at a specific time directly saved back to the hard disk. Here are a few commonly used commands, which, fsck command is the most important. When the file system error occurs, fsck command can be used to try to repair direct use of the partition number (such as / dev / had3), or use a mount point (Mount Point, such as /, / usr, etc.) specified file system can be. Assuming that once specify multiple file systems, and these systems are located on different physical disks, fsck synchronized manner will attempt to check them in order to save operating time.  
  
  Parameters:
  
  filesys: Device name (eg./dev/sda1),mount point (eg / or / usr).
  -T: a given file system type, if there is defined in the / etc / fstab or kernel itself has support this parameter is not required plus
  -s: a sequentially checks a fsck command executed
  on / etc / fstab listed all the partition for check: -A
  -C: display a complete check progress
  -d: column printing  the e2fsck  Debug result
  -p: -A while when conditions while a plurality of inspection performed with fsck
  -R: -A while when conditions are omitted / not checked
  -V: detailed display mode
  
  -a: If the check is wrong automatic repair
  -r: Check if the answer is wrong by the user fixes

        Additional information:
  
  Example:
  checking file system msdos / dev if / hda5 normal, if there is an exception automatically fix:
   fsck -a -t msdos / dev / hda5
  
  Note:
  
  This instruction can be used with / etc / fstab mutual understanding with reference to the operation to be .

        Example: Check / dev / sda3
[the root @ localhost ~] # the fsck -C -t  EX T3 / dev / sda3fsck 1.39 (29-On May-2006) the e2fsck 1.39 (29-On May-2006) / dev / sda3 Mount IS ED .
Running e2fsck ON A !!! the WARNING Mounted filesystem May causeSEVERE filesystem Damage.
the Do you want to for Really the Continue (the y-/ the n-) yes?
/ Home: in a recovering. TECHNOLOGY INFORMATION / Home: Clean, 11/524288 Files, everything is normal 25399/524120 Blocks # the above information will appear
# idea is usually only ROOT and system problems when it is used in this command. otherwise, use this command in a normal state may damage your files.

       related information:
 

    Linux FSCK data error disaster contingency plans introduced

[Applies]

1, file systems: ext2 ext3 reiserfs xfs, etc.

2, range: the file system needs FSCK when prompted, not implemented or implementation of the completion FSCK

 

[symptom]

1, can not MOUNT partition;

2, a large number of files, directories loss, generated under the root directory / LOST + FOUND folder, there are a lot #XXXXXX class files and directories;

3, FSCK error quickly completed;

4, when executed FSCK, a large number of tips, such as modifying the nodes, the nodes other operations cleared

 

[Emergency plan]

1. In case of prompt FSCK, please be careful. If possible, make the system as soon as possible, UMOUNT all partitions.

2, when necessary to perform FSCK, do first preparation, a method of: using previously available dd command outputs involved in the partition to the other bank (dd best not to do on a failed bank itself) substantially command structure as may be: dd if = / dev / sda0 of = / dev / sdb0 .....

3, when necessary to perform FSCK, do first preparation, Method 2: LINUX entire bank to mount to a virtual machine environment, the bank is set to Nonpersisten LINUX mode, then execute, after the execution, if the data is intact, it should be as soon as possible via FTP etc. copy out.

4, when necessary to perform FSCK, do first preparation, Method three: the entire LINUX banks mounted onto other systems (such as WINDOWS), do the mirror before making FSCK.

5. The reasons are several ways the above conditions can not be implemented, must be performed, the observation can be carefully FSCK tips of (turn off -a) If any node prompts for an error correction or cleared, the node size is incorrect profile and other information, should stop execution FSCK.

6, due to the need to refer to restore a lot of information, because the system does not work to maintain a state as possible, at least not again MOUNT partition (even without any read or write operation, also because of how the system works constantly to reduce the possibility of data recovery, data recovery increase difficulty)

7, seek professional data recovery company to help.

 

 

The disk mirroring solution:

1, with the same or greater than the source disk capacity of the hard disk as the target, the CLONE source disk to the target disk mode all the sectors.

2, the source disk can be completely sectors manner to the output file of a large capacity storage space (such as large-capacity hard disk, NAS, SAN, DAS, etc.)

 

Enter the Root password login using: fsck -t ext3 -r / usr / local repair

 

xfs_repair

1. Status 
currently hosts a large number of input and output error appeared on the Internet, is due to host file system corruption. Most front-line staff uses a umont and mount a recovery mode, this restoration can not really repair a damaged file system, the subsequent use, host-side input-output errors still occur again. 
2. The need to fix the scene 
. <1> the host-side system is not found where the file read and write, may be used to confirm whether the abnormality occurs by viewing the file system log host: xfs_force_shutdown, the I / O error l 
. <2> appears abnormal power failure, power is restored to normal, the host and the array after the system restart 
<3> storage medium failure: after emergence LUN failure, RAID failure, and IO timeout or there is slow disk, to slow the disc replacement, the system returns to normal 
<4> after damaging the fiber such as, cable, etc., the data transmission link is disconnected and then return to normal: transmission media failure

3. Check the file system 
Note: Check the file system must ensure that the file system umount success. 
Enter in the root directory "xfs_check / dev / sdd (letter); echo $?" (Note: Before executing this command, the file system must be umount, otherwise there will be a warning letter "xfs_check: / dev / sdd contains a mounted and writable filesystem ") hit the Enter key to view the command executed return value: 0 indicates normal, the other is not normal, indicating that the file system is damaged and needs repair.

4. repair process

Note: You need to suspend operations on the host side repair, umount and mount the file system can not be repaired. 
1) First umount the partition you want to repair the file system 
3) and enter "xfs_repair / dev / sdd (letter)" to perform a repair order. 
xfs_check / dev / SDD;? echo $ 
A) If 0 === "successfully repaired. 
B) If not 0 === "without success: Do xfs_repair -L / dev / sdd command and then the xfs_repair (repeated several times more than repairing)

5.xfs common commands 
xfs_admin: xfs file system to adjust various parameters 
xfs_copy: xfs file system copy the contents to one or more target systems (parallel) 
xfs_db: debug or detection xfs file system (file system view debris) 
xfs_check : detection xfs file system integrity 
xfs_bmap: View a file block map 
xfs_repair: try to repair damaged xfs file system 
xfs_fsr: defragmentation 
xfs_quota: management xfs file system disk quota 
xfs_metadump: the xfs file system metadata (metadata ) to copy a file 
xfs_mdrestore: recovering from a file in the metadata (metadata) to the file system xfs 
xfs_growfs: adjusting the size of a file system xfs (only extended) 
xfs_logprint: AN Print the log of the xFS filesystem 
xfs_mkfile: Create the xFS AN File 
xfs_info: the expand AN XFS filesystem 
xfs_ncheck: the pathnames from the Generate a Numbers for i-XFS 
xfs_rtcp: XFS Realtime Copy the Command 
xfs_freeze: Access to Suspend AN XFS filesystem 
xfs_io: debug the I/O path of an XFS filesystem

6. Specific applications:

查看文件块状况: xfs_bmap -v sarubackup.tar.bz2 
查看磁盘碎片状况: xfs_db -c frag -r /dev/sda1 
文件碎片整理: xfs_fsr sarubackup.tar.bz2 
磁盘碎片整理: xfs_fsr /dev/sda1


Found that the system did not open properly, there is the restart action, and report as shown in error, the error is obvious hints file system damage occurs! In the windows of illegal reboot command need to run chkdsk to repair, only under linux fsck to repair .linnux error for the file system is very sensitive, because of an unexpected power failure or other causes unexpected system shutdown or restart linux, linux is likely to file system causing serious damage, leading to not enter the system properly. In linux fsck become an indispensable command fsck command, but there is a fatal weakness, is to have mounted the partitions running great risk, not completely repair the system crashes out . So to create a snapshot before remediation is one of the most secure method.
    Need to confirm what the partition file system, this can look and associated disk drive letter with fdisk -l, enter fsck -c display the full inspection schedule; enter y, if there are multiple corrupted files will be prompted to enter multiple times after y, repair input after fsck -t ext4 / dev / sda1 or fsck.ext4 to. this command determines the disk type. the fourth step fsck -y / dev / sda1 only the damaged file repair, repair OK were reboot
    summary
1: Enter the fsck -c
2: Input Yes  
. 3: Enter -t ext4 the fsck / dev / sda1
. 4: -Y input the fsck / dev / sda1; 
5. The reboot

filesys: disk device name (eg./dev/sda1), mount (mount) point (eg / or / usr.)
-t: Given the type of file system, or kernel itself has been defined support if the / etc / fstab of this parameter plus you do not need
-s: sequentially one by one to check execution instruction fsck
-A: on / etc / fstab all listed partitions (Partition) for tests
-C: display a complete check progress
-d: Print out  e2fsck  Debug results
-p: At the same time there is -A conditions, while checks performed along a plurality of fsck
-R: -A while when conditions are omitted / not checked
-V: detailed display mode
-a: If the check is wrong then automatically fix
-r: If the check is wrong by the user to answer whether repair
-y: option specifies detect each file is automatically entered yes, the uncertainty that is not normal, they can perform all the checks # fsck -y repair.

 

 

https://www.cnblogs.com/zafu/p/11406525.html     

testdisk repair disk file

https://blog.csdn.net/WannaHaha/article/details/89710113

Cmd command in the desktop version windowsPC and most windows server are common, it is very important for users to master the command;

Check the situation often encounter hard drive, disk clean-up time, but using 360, Kingsoft and other antivirus software, there will be some security risks, especially large enterprises have their own anti-virus software does not allow the use of other anti-virus software with a plug-in or advertisement under master cleanmgr, chkdsk, sfc commands is particularly important.

 

cleanmgr.exe system is Microsoft built a small program, use it, users can "relatively safe state clean common system junk." In fact, it is Disk Cleanup.

 

Chkdsk: chkdsk simply put, is used to check the disk, but also a simple fix command;

 chkdsk i: / f, i where the disk drive letter, that is, you want to repair disk symbol, for example you want to repair disc c, c will be replaced by i, behind / f repair command is shown in FIG. :

 

 

Sfc.exe: System File Checker (System file checker) is a software tool integrated in a windows system. The software can scan all protected system files and verify the integrity of system files and replaces incorrect versions with correct Microsoft version.

In Windows XP, win7,8,10, and it's more powerful, not only can scan all protected system files to verify their version, you can also set file cache size, clear the file cache and repopulate "% SystemRoot% \ system32 \ Dllcache "folder.

Log in as Administrator Windows XP, win7,8,10, the Windows XP installation CD into the drive, type "SFC / SCANNOW" in the "Command Prompt" window Enter the command, the "System File Checker" Start automatic scanning system files and does not require any of your intervention.

In fact, the following two commands should still we usually often used:

sfc / scannow immediately scans all protected system files, puzzling questions you can use it to solve yo, the proportion of installed systems faster.

sfc / purgecache clear the file cache system for streamlining, free up disk space (when insufficient disk space on your system disk can try)

fsck

Access: superuser
  
  usage: fsck [-sACVRP] [-t FStype] [-] [fsck-Options]  File SYS [...]
  
  Note: In the Linux system, in order to increase system performance, usually the default Some write data in memory, and does not directly write data to the hard disk, this is because the memory speed is several times faster than a hard disk. But there is a problem, if due to the "off" or other unknown reasons, causing system crashes, how do? The system collapsed. So, we need to get data at a specific time directly saved back to the hard disk. Here are a few commonly used commands, which, fsck command is the most important. When the file system error occurs, fsck command can be used to try to repair direct use of the partition number (such as / dev / had3), or use a mount point (Mount Point, such as /, / usr, etc.) specified file system can be. Assuming that once specify multiple file systems, and these systems are located on different physical disks, fsck synchronized manner will attempt to check them in order to save operating time.  
  
  Parameters:
  
  filesys: Device name (eg./dev/sda1),mount point (eg / or / usr).
  -T: a given file system type, if there is defined in the / etc / fstab or kernel itself has support this parameter is not required plus
  -s: a sequentially checks a fsck command executed
  on / etc / fstab listed all the partition for check: -A
  -C: display a complete check progress
  -d: column printing  the e2fsck  Debug result
  -p: -A while when conditions while a plurality of inspection performed with fsck
  -R: -A while when conditions are omitted / not checked
  -V: detailed display mode
  
  -a: If the check is wrong automatic repair
  -r: Check if the answer is wrong by the user fixes

        Additional information:
  
  Example:
  checking file system msdos / dev if / hda5 normal, if there is an exception automatically fix:
   fsck -a -t msdos / dev / hda5
  
  Note:
  
  This instruction can be used with / etc / fstab mutual understanding with reference to the operation to be .

        Example: Check / dev / sda3
[the root @ localhost ~] # the fsck -C -t  EX T3 / dev / sda3fsck 1.39 (29-On May-2006) the e2fsck 1.39 (29-On May-2006) / dev / sda3 Mount IS ED .
Running e2fsck ON A !!! the WARNING Mounted filesystem May causeSEVERE filesystem Damage.
the Do you want to for Really the Continue (the y-/ the n-) yes?
/ Home: in a recovering. TECHNOLOGY INFORMATION / Home: Clean, 11/524288 Files, everything is normal 25399/524120 Blocks # the above information will appear
# idea is usually only ROOT and system problems when it is used in this command. otherwise, use this command in a normal state may damage your files.

       related information:
 

    Linux FSCK data error disaster contingency plans introduced

[Applies]

1, file systems: ext2 ext3 reiserfs xfs, etc.

2, range: the file system needs FSCK when prompted, not implemented or implementation of the completion FSCK

 

[symptom]

1, can not MOUNT partition;

2, a large number of files, directories loss, generated under the root directory / LOST + FOUND folder, there are a lot #XXXXXX class files and directories;

3, FSCK error quickly completed;

4, when executed FSCK, a large number of tips, such as modifying the nodes, the nodes other operations cleared

 

[Emergency plan]

1. In case of prompt FSCK, please be careful. If possible, make the system as soon as possible, UMOUNT all partitions.

2, when necessary to perform FSCK, do first preparation, a method of: using previously available dd command outputs involved in the partition to the other bank (dd best not to do on a failed bank itself) substantially command structure as may be: dd if = / dev / sda0 of = / dev / sdb0 .....

3, when necessary to perform FSCK, do first preparation, Method 2: LINUX entire bank to mount to a virtual machine environment, the bank is set to Nonpersisten LINUX mode, then execute, after the execution, if the data is intact, it should be as soon as possible via FTP etc. copy out.

4, when necessary to perform FSCK, do first preparation, Method three: the entire LINUX banks mounted onto other systems (such as WINDOWS), do the mirror before making FSCK.

5. The reasons are several ways the above conditions can not be implemented, must be performed, the observation can be carefully FSCK tips of (turn off -a) If any node prompts for an error correction or cleared, the node size is incorrect profile and other information, should stop execution FSCK.

6, due to the need to refer to restore a lot of information, because the system does not work to maintain a state as possible, at least not again MOUNT partition (even without any read or write operation, also because of how the system works constantly to reduce the possibility of data recovery, data recovery increase difficulty)

7, seek professional data recovery company to help.

 

 

The disk mirroring solution:

1, with the same or greater than the source disk capacity of the hard disk as the target, the CLONE source disk to the target disk mode all the sectors.

2, the source disk can be completely sectors manner to the output file of a large capacity storage space (such as large-capacity hard disk, NAS, SAN, DAS, etc.)

 

Enter the Root password login using: fsck -t ext3 -r / usr / local repair

 

xfs_repair

1. Status 
currently hosts a large number of input and output error appeared on the Internet, is due to host file system corruption. Most front-line staff uses a umont and mount a recovery mode, this restoration can not really repair a damaged file system, the subsequent use, host-side input-output errors still occur again. 
2. The need to fix the scene 
. <1> the host-side system is not found where the file read and write, may be used to confirm whether the abnormality occurs by viewing the file system log host: xfs_force_shutdown, the I / O error l 
. <2> appears abnormal power failure, power is restored to normal, the host and the array after the system restart 
<3> storage medium failure: after emergence LUN failure, RAID failure, and IO timeout or there is slow disk, to slow the disc replacement, the system returns to normal 
<4> after damaging the fiber such as, cable, etc., the data transmission link is disconnected and then return to normal: transmission media failure

3. Check the file system 
Note: Check the file system must ensure that the file system umount success. 
Enter in the root directory "xfs_check / dev / sdd (letter); echo $?" (Note: Before executing this command, the file system must be umount, otherwise there will be a warning letter "xfs_check: / dev / sdd contains a mounted and writable filesystem ") hit the Enter key to view the command executed return value: 0 indicates normal, the other is not normal, indicating that the file system is damaged and needs repair.

4. repair process

Note: You need to suspend operations on the host side repair, umount and mount the file system can not be repaired. 
1) First umount the partition you want to repair the file system 
3) and enter "xfs_repair / dev / sdd (letter)" to perform a repair order. 
xfs_check / dev / SDD;? echo $ 
A) If 0 === "successfully repaired. 
B) If not 0 === "without success: Do xfs_repair -L / dev / sdd command and then the xfs_repair (repeated several times more than repairing)

5.xfs common commands 
xfs_admin: xfs file system to adjust various parameters 
xfs_copy: xfs file system copy the contents to one or more target systems (parallel) 
xfs_db: debug or detection xfs file system (file system view debris) 
xfs_check : detection xfs file system integrity 
xfs_bmap: View a file block map 
xfs_repair: try to repair damaged xfs file system 
xfs_fsr: defragmentation 
xfs_quota: management xfs file system disk quota 
xfs_metadump: the xfs file system metadata (metadata ) to copy a file 
xfs_mdrestore: recovering from a file in the metadata (metadata) to the file system xfs 
xfs_growfs: adjusting the size of a file system xfs (only extended) 
xfs_logprint: AN Print the log of the xFS filesystem 
xfs_mkfile: Create the xFS AN File 
xfs_info: the expand AN XFS filesystem 
xfs_ncheck: the pathnames from the Generate a Numbers for i-XFS 
xfs_rtcp: XFS Realtime Copy the Command 
xfs_freeze: Access to Suspend AN XFS filesystem 
xfs_io: debug the I/O path of an XFS filesystem

6. Specific applications:

查看文件块状况: xfs_bmap -v sarubackup.tar.bz2 
查看磁盘碎片状况: xfs_db -c frag -r /dev/sda1 
文件碎片整理: xfs_fsr sarubackup.tar.bz2 
磁盘碎片整理: xfs_fsr /dev/sda1


Found that the system did not open properly, there is the restart action, and report as shown in error, the error is obvious hints file system damage occurs! In the windows of illegal reboot command need to run chkdsk to repair, only under linux fsck to repair .linnux error for the file system is very sensitive, because of an unexpected power failure or other causes unexpected system shutdown or restart linux, linux is likely to file system causing serious damage, leading to not enter the system properly. In linux fsck become an indispensable command fsck command, but there is a fatal weakness, is to have mounted the partitions running great risk, not completely repair the system crashes out . So to create a snapshot before remediation is one of the most secure method.
    Need to confirm what the partition file system, this can look and associated disk drive letter with fdisk -l, enter fsck -c display the full inspection schedule; enter y, if there are multiple corrupted files will be prompted to enter multiple times after y, repair input after fsck -t ext4 / dev / sda1 or fsck.ext4 to. this command determines the disk type. the fourth step fsck -y / dev / sda1 only the damaged file repair, repair OK were reboot
    summary
1: Enter the fsck -c
2: Input Yes  
. 3: Enter -t ext4 the fsck / dev / sda1
. 4: -Y input the fsck / dev / sda1; 
5. The reboot

filesys: disk device name (eg./dev/sda1), mount (mount) point (eg / or / usr.)
-t: Given the type of file system, or kernel itself has been defined support if the / etc / fstab of this parameter plus you do not need
-s: sequentially one by one to check execution instruction fsck
-A: on / etc / fstab all listed partitions (Partition) for tests
-C: display a complete check progress
-d: Print out  e2fsck  Debug results
-p: At the same time there is -A conditions, while checks performed along a plurality of fsck
-R: -A while when conditions are omitted / not checked
-V: detailed display mode
-a: If the check is wrong then automatically fix
-r: If the check is wrong by the user to answer whether repair
-y: option specifies detect each file is automatically entered yes, the uncertainty that is not normal, they can perform all the checks # fsck -y repair.

 

 

https://www.cnblogs.com/zafu/p/11406525.html     

testdisk repair disk file

https://blog.csdn.net/WannaHaha/article/details/89710113

Cmd command in the desktop version windowsPC and most windows server are common, it is very important for users to master the command;

Check the situation often encounter hard drive, disk clean-up time, but using 360, Kingsoft and other antivirus software, there will be some security risks, especially large enterprises have their own anti-virus software does not allow the use of other anti-virus software with a plug-in or advertisement under master cleanmgr, chkdsk, sfc commands is particularly important.

 

cleanmgr.exe system is Microsoft built a small program, use it, users can "relatively safe state clean common system junk." In fact, it is Disk Cleanup.

 

Chkdsk: chkdsk simply put, is used to check the disk, but also a simple fix command;

 chkdsk i: / f, i where the disk drive letter, that is, you want to repair disk symbol, for example you want to repair disc c, c will be replaced by i, behind / f repair command is shown in FIG. :

 

 

Sfc.exe: System File Checker (System file checker) is a software tool integrated in a windows system. The software can scan all protected system files and verify the integrity of system files and replaces incorrect versions with correct Microsoft version.

In Windows XP, win7,8,10, and it's more powerful, not only can scan all protected system files to verify their version, you can also set file cache size, clear the file cache and repopulate "% SystemRoot% \ system32 \ Dllcache "folder.

Log in as Administrator Windows XP, win7,8,10, the Windows XP installation CD into the drive, type "SFC / SCANNOW" in the "Command Prompt" window Enter the command, the "System File Checker" Start automatic scanning system files and does not require any of your intervention.

In fact, the following two commands should still we usually often used:

sfc / scannow immediately scans all protected system files, puzzling questions you can use it to solve yo, the proportion of installed systems faster.

sfc / purgecache clear the file cache system for streamlining, free up disk space (when insufficient disk space on your system disk can try)

Guess you like

Origin www.cnblogs.com/klb561/p/11932216.html