Applicable models: All TNAS models
Applicable TOS version: TOS 4.2, TOS 5
In a few cases, the file system is at risk of corruption, such as abnormal shutdown, power failure, and hard disk failure. If this unfortunate thing happens, TOS may fail to load, storage pool and volume may fail to load, but your data may still have a chance to be rescued, please refer to the following methods to repair the faulty file system.
Disclaimer:
For the safety of your data, it is recommended that the repair needs to be operated by professionals. During the repair process, misoperation, power failure, and collision may cause data loss due to repair failure, your data still has a chance to be completely destroyed. If your data is exceptionally important, it is recommended that you rescue your data through a professional data recovery service. If you decide to carry out the repair operation, you need to bear all risks on your own.
Instruction
1. Log in your TNAS with SSH. How to log in your TNAS with SSH terminal?
2. Execute the following command to view the system log:
Code: Select all
dmesg
(If you do not find similar errors, it does not necessarily mean that there are no errors at all. It may be that the error was not triggered during this startup)
If you find an obvious red font mark or a message with the words "Btrfs error", as shown in the figure below, it means that there must be an abnormality in the BTRFS file system, please use the "General BTRFS file system repair method".
(If you do not find similar errors, it does not necessarily mean that there are no errors at all. It may be that the error was not triggered during this startup)
The general repair method of EXT4 file system:
Note: For step 3-step 7, if your TNAS has used the early TOS 4.0 or even TOS 3.x. Since LVM management was not adopted at that time, there may not be a directory like "/dev/mapper/vg0-lv0". Please use "/dev/md0" instead.
1. Before performing the repair, please disable the SSD Hyper Cache, and you need to execute the following instructions to unmount the current file system:
Code: Select all
cd /
umount /mnt/md0
umount /home
2. If the prompt "Target is busy", Please cancel the occupancy of the volume by the service processes, disable the SSD cache (if no SSD cache, please ignore it), and then execute the command above again.
Code: Select all
fuser -mk /mnt/md0
(At TOS 5 it should be "/Volume1" instead of "/mnt/md0")
3. Execute the repair instruction and wait for the repair to complete:
Code: Select all
e2fsck -p /dev/mapper/vg0-lv0
Code: Select all
/etc/tos/scripts/mntdata
6. If the abnormality still exists, you can repeat steps 1 and 2 and execute follow:
Code: Select all
e2fsck -b 32768 /dev/mapper/vg0-lv0 -y
7. If the abnormality still exists, you can repeat steps 1 and 2 and execute the mandatory repair instruction (risky! Please be cautious):
Code: Select all
e2fsck -f /dev/mapper/vg0-lv0 -y
The conventional repair method of BTRFS file system:
Note: For step 3-step 4, if your TNAS has used the early TOS 4.0 or even TOS 3.x. Since LVM management was not adopted at that time, there may not be a directory like "/dev/mapper/vg0-lv0". Please use "/dev/md0" instead.
Note: BTRFS is not perfect in 210 series model who uses an earlier linux kernel versions.
If your device model is F2-210 or F4-210, We recommend that you back up your data and then rebuild your BTRFS volumes to more stable EXT4 volumes.
1. Before performing the repair, please disable the SSD Hyper Cache, and you need to execute the following instructions to unmount the current file system:
Code: Select all
cd /
umount /mnt/md0
umount /home
2. If the prompt "Target is busy", Please cancel the occupancy of the volume by the service processes, disable the SSD cache (if no SSD cache, please ignore it), and then execute the command above again.
Code: Select all
fuser -mk /mnt/md0
(At TOS 5 it should be "/Volume1" instead of "/mnt/md0")
3. Execute the following command to detect the BTRFS file system:
Code: Select all
btrfs check /dev/mapper/vg0-lv0
4. After the detection is completed, execute the following instructions to restore the file system:
Code: Select all
btrfs check --repair /dev/mapper/vg0-lv0
5. As shown in the figure above, if it prompts "10 9 8 7 6 5 4 3 2 1", it means that the probability of file system recovery is very high. Just wait for the end of the recovery process and execute the following command to remount the file system:
Code: Select all
/etc/tos/scripts/mntdata