由于突然断电过几次,samba服务器挂载的硬盘感觉没有之前快了,怀疑有产生磁盘坏道。
使用fsck命令对磁盘分区进行坏道分析并把坏道 标记出来。
fsck -c 检查是否存在有损坏的区块。
fsck -l <损坏区块文件> 把文件中所列出的损坏区块,加入标记
还好没有坏道。只有一些优化建议。
root@kali:~# fsck -c /dev/sdb2
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
Checking for bad blocks (read-only test): done
DATA-2: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Inode 131736995 extent tree (at level 2) could be narrower. Optimize<y>? yes
Inode 131736996 extent tree (at level 2) could be narrower. Optimize<y>? yes
Inode 131736997 extent tree (at level 2) could be narrower. Optimize<y>? yes
Inode 131736998 extent tree (at level 2) could be narrower. Optimize<y>? yes
Inode 131736999 extent tree (at level 1) could be narrower. Optimize<y>? yes
Inode 131737005 extent tree (at level 2) could be narrower. Optimize<y>? yes
Inode 131737006 extent tree (at level 2) could be narrower. Optimize<y>? yes
Inode 131737010 extent tree (at level 1) could be narrower. Optimize<y>? yes
Inode 131737013 extent tree (at level 2) could be narrower. Optimize<y>? yes
Inode 131737016 extent tree (at level 2) could be narrower. Optimize ('a' enables 'yes' to all) <y>? yes
Inode 131737026 extent tree (at level 2) could be narrower. Optimize ('a' enables 'yes' to all) <y>? yes
Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
DATA-2: ***** FILE SYSTEM WAS MODIFIED *****
DATA-2: 96879/164855808 files (2.0% non-contiguous), 255902321/659413749 blocks
root@kali:~# umount -l /media/root/DATA
root@kali:~# fsck -c /dev/sdb1
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
Checking for bad blocks (read-only test): ^C2.40% done, 23:03 elapsed. (0/0/0 errors)
Interrupted at block 7603904
DATA: Updating bad block inode.
DATA: ***** FILE SYSTEM WAS MODIFIED *****
root@kali:~# fsck -c /dev/sdb1
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
Checking for bad blocks (read-only test): done
DATA: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
DATA: ***** FILE SYSTEM WAS MODIFIED *****
DATA: 12/79339520 files (0.0% non-contiguous), 5358017/317332481 blocks
fsck具体参数参考:http://linux.51yip.com/search/fsck.ext4