我的服务器中的分区 /dev/sdb 未通过 FSCK 检查,但我似乎无法找到修复它的方法。操作系统是 CentOS 6.8。
在 /etc/fstab 中,我已经注释掉这个分区。
我使用了命令 umount /dev/sdb 但它返回说尚未安装。
另外,我尝试过
root@server3 [/]# umount /dev/sdb1
umount: /dev/sdb1: not mounted
root@server3 [/]# fsck -A /dev/sdb1
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/sda5 is mounted.
e2fsck: Cannot continue, aborting.
文件系统当前设置为:
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 221G 156G 55G 75% /
tmpfs 16G 0 16G 0% /dev/shm
/dev/sda1 504M 66M 413M 14% /boot
/dev/sda3 4.0G 139M 3.7G 4% /tmp
/dev/sdb2 219G 66G 142G 32% /wjgbk
FSTAB 文件如下所示:
#
# /etc/fstab
# Created by anaconda on Fri Oct 11 07:42:05 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=8fec8cf7-4999-489c-a344-8b16ab7402e2 / ext4 usrjquota=quota.user,jqfmt=vfsv0 1 1
UUID=7f2583f8-7d07-43a9-9f81-0f24a449e97a /boot ext4 defaults 1 2
#UUID=793f6375-bd81-4392-9cf7-adff4149b72c /home2 ext4 usrjquota=quota.user,jqfmt=vfsv0 1 2
UUID=2e71e9e4-a05a-4282-9e48-a82a364ef3e8 /tmp ext4 defaults 1 2
UUID=7e4202fe-c53a-4475-bfb8-66271e08137f /wjgbk ext4 defaults 1 2
UUID=67f4cccf-fca2-46b8-8f4c-53af3512b7af swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/tmp /var/tmp ext3 defaults,bind,noauto 0 0
UID 参考如下:
root@server3 [/dev]# blkid
/dev/sdb1: UUID="793f6375-bd81-4392-9cf7-adff4149b72c" TYPE="ext4"
/dev/sdb2: UUID="7e4202fe-c53a-4475-bfb8-66271e08137f" TYPE="ext4"
/dev/sda1: UUID="7f2583f8-7d07-43a9-9f81-0f24a449e97a" TYPE="ext4"
/dev/sda2: UUID="67f4cccf-fca2-46b8-8f4c-53af3512b7af" TYPE="swap"
/dev/sda3: UUID="2e71e9e4-a05a-4282-9e48-a82a364ef3e8" TYPE="ext4"
/dev/sda5: UUID="8fec8cf7-4999-489c-a344-8b16ab7402e2" TYPE="ext4"
关于如何进行 FSCK 检查有什么想法吗?我需要从此分区恢复数据并尽快将其全部移动到新服务器。
编辑1 将 fsck -A 命令从 /dev/sdb 更改为 /dev/sdb1
编辑2 将 fsck -A 命令更改为 fsck,结果如下:
root@server3 [/]# fsck /dev/sdb1
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/sdb1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error reading block 59770103 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes
Force rewrite<y>? no
Pass 2: Checking directory structure
Entry '383294_502fe9d985d3b76501e4272957465134f1b4c4d4' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394754. Clear<y>? yes
Entry '383304_41397ee07938e4643f13371c7fe0dbbf830739b7' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394764. Clear<y>? yes
Entry '383293_f885e3b62c361401c18e54b626553ee3818a43f4' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394753. Clear<y>? yes
我意识到这可能会删除文件所以我最终说了 N,结果是:
Entry '429064_247dc988326a61ac34725f538d91836904e39ae1' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14962043. Clear<y>? no
Error reading block 59770103 (Attempt to read block from filesystem resulted in short read). Ignore error<y>? no
ext2fs_read_inode: Attempt to read block from filesystem resulted in short read while reading inode 14962043 in check_filetype
e2fsck: aborted
附件文件夹中有 10000 个文件。解决这个问题的最佳方法是什么?
编辑3 好的,我在缺乏足够知识的情况下尝试勇敢面对这一切,但整个过程的结果如下:
root@server3 [/]# fsck /dev/sdb1
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
/dev/sdb1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Error reading block 59770103 (Attempt to read block from filesystem resulted in short read) while getting next inode from scan. Ignore error<y>? yes
Force rewrite<y>? yes
Pass 2: Checking directory structure
Entry '383297_262f4d70abcf3d2c216151dbe949014711c272af' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394757. Clear<y>? no
Entry '429064_247dc988326a61ac34725f538d91836904e39ae1' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14962043. Clear<y>? no
Entry '429064_247dc988326a61ac34725f538d91836904e39ae1' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '383308_b1543d401a14ea6b49c0858186c1035dff384865' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394768. Clear<y>? no
Entry '383308_b1543d401a14ea6b49c0858186c1035dff384865' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '429056_2d9fef7cf6e345d84f61fda8b304fab3314d98d7' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14962036. Clear<y>? no
Entry '429056_2d9fef7cf6e345d84f61fda8b304fab3314d98d7' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '429067_2dc02dc3352898752f4f6925aee9fd2b999e8a60' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14962046. Clear<y>? no
Entry '429067_2dc02dc3352898752f4f6925aee9fd2b999e8a60' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '429055_695706ed8849d0c7d9fb22e7031c8ced335e1d6d' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14962035. Clear<y>? no
Entry '429055_695706ed8849d0c7d9fb22e7031c8ced335e1d6d' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '429069_3a8ae4186c516271931537ed190379cadb18723d' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14962048. Clear<y>? no
Entry '429069_3a8ae4186c516271931537ed190379cadb18723d' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '383307_633c8342ad75635917fe2334efaca3e646f2fcae' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394767. Clear<y>? no
Entry '383307_633c8342ad75635917fe2334efaca3e646f2fcae' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '383306_e9d1b3d89e582d3ab4e9f4e1d7f16c3eea095d75' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394766. Clear<y>? no
Entry '383306_e9d1b3d89e582d3ab4e9f4e1d7f16c3eea095d75' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Entry '383302_468fc12b1f4f6d739b28bbf450aea564c0376044' in /user1/public_html/boards/attachments (13631562) has deleted/unused inode 14394762. Clear<y>? no
Entry '383302_468fc12b1f4f6d739b28bbf450aea564c0376044' in /user1/public_html/boards/attachments (13631562) has an incorrect filetype (was 1, should be 0).
Fix<y>? yes
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -(59274765--59275233) -(59277488--59277567) -(60222133--60222135) -(60223991--60224205) -(60224208--60224390)
Fix<y>? no
Inode bitmap differences: -(14394753--14394768) -(14962033--14962048)
Fix<y>? no
/dev/sdb1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sdb1: ********** WARNING: Filesystem still has errors **********
/dev/sdb1: 1071256/16007168 files (0.4% non-contiguous), 52105940/64000000 blocks
关于我应该接受哪些变化以及不应该接受哪些变化,您有什么想法吗?
答案1
/dev/sdb 是整个磁盘,而不是磁盘上的分区。您需要对分区进行 fsck,例如 /home2 的 /dev/sdb1。