码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 文件系统修复

时间:2015-08-28 00:59:09      阅读:297      评论:0      收藏:0      [点我收藏+]

标签:

1.问题引出

在Linux操作系统下,安装ceph分布式存储系统,在安装OSD时,执行了一条命令:

1
ceph-deploy disk zap osdnode1:/dev/sda3


命令执行失败,日志如下:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[ceph_deploy.cli][INFO  ] ceph-deploy options:
[ceph_deploy.cli][INFO  ]  username                      : None
[ceph_deploy.cli][INFO  ]  verbose                       : False
[ceph_deploy.cli][INFO  ]  overwrite_conf                : False
[ceph_deploy.cli][INFO  ]  subcommand                    : zap
[ceph_deploy.cli][INFO  ]  quiet                         : False
[ceph_deploy.cli][INFO  ]  cd_conf                       : <ceph_deploy.conf.cephdeploy.Conf instance at 0x12be4d0>
[ceph_deploy.cli][INFO  ]  cluster                       : ceph
[ceph_deploy.cli][INFO  ]  func                          : <functiondisk at 0x12b6938>
[ceph_deploy.cli][INFO  ]  ceph_conf                     : None
[ceph_deploy.cli][INFO  ]  default_release               : False
[ceph_deploy.cli][INFO  ]  disk                          : [(‘osdnode1‘,‘/dev/sda3‘, None)]
[ceph_deploy.osd][DEBUG ] zapping /dev/sda3 on osdnode1
[osdnode1][DEBUG ] connection detected needforsudo
[osdnode1][DEBUG ] connected to host: osdnode1
[osdnode1][DEBUG ] detect platform information from remote host
[osdnode1][DEBUG ] detect machine type
[osdnode1][DEBUG ] find the location of an executable
[ceph_deploy.osd][INFO  ] Distro info: CentOS 6.7 Final
[osdnode1][DEBUG ] zeroing last few blocks of device
[osdnode1][DEBUG ] find the location of an executable
[osdnode1][INFO  ] Running command: sudo /usr/sbin/ceph-disk zap /dev/sda3
[osdnode1][DEBUG ] CreatingnewGPT entries.
[osdnode1][DEBUG ] Warning: The kernel is still using the old partition table.
[osdnode1][DEBUG ] Thenewtable will be used at the next reboot.
[osdnode1][DEBUG ] GPT data structures destroyed! You may now partition the disk using fdisk or
[osdnode1][DEBUG ] other utilities.
[osdnode1][DEBUG ] CreatingnewGPT entries.
[osdnode1][DEBUG ] Warning: The kernel is still using the old partition table.
[osdnode1][DEBUG ] Thenewtable will be used at the next reboot.
[osdnode1][DEBUG ] The operation has completed successfully.
[osdnode1][WARNING] Traceback (most recent call last):
[osdnode1][WARNING]   File"/usr/sbin/ceph-disk", line 2994,in<module>
[osdnode1][WARNING]     main()
[osdnode1][WARNING]   File"/usr/sbin/ceph-disk", line 2972,inmain
[osdnode1][WARNING]     args.func(args)
[osdnode1][WARNING]   File"/usr/sbin/ceph-disk", line 2690,inmain_zap
[osdnode1][WARNING]     zap(dev)
[osdnode1][WARNING]   File"/usr/sbin/ceph-disk", line 1071,inzap
[osdnode1][WARNING]     update_partition(‘-d‘, dev,‘zapped‘)
[osdnode1][WARNING]   File"/usr/sbin/ceph-disk", line 1033,inupdate_partition
[osdnode1][WARNING]     dev,
[osdnode1][WARNING]   File"/usr/sbin/ceph-disk", line 306,incommand
[osdnode1][WARNING]     **kwargs)
[osdnode1][WARNING]   File"/usr/lib64/python2.6/subprocess.py", line 642,in__init__
[osdnode1][WARNING]    
[osdnode1][WARNING]   File"/usr/lib64/python2.6/subprocess.py", line 1234,in_execute_child
[osdnode1][WARNING]    
[osdnode1][WARNING]   File"/usr/lib64/python2.6/pickle.py", line 1374,inloads
[osdnode1][WARNING]    
[osdnode1][WARNING]   File"/usr/lib64/python2.6/pickle.py", line 858,inload
[osdnode1][WARNING]    
[osdnode1][WARNING]   File"/usr/lib64/python2.6/pickle.py", line 971,inload_string
[osdnode1][WARNING]    
[osdnode1][WARNING] LookupError: unknown encoding: string-escape
[osdnode1][ERROR ] RuntimeError: command returned non-zero exit status: 1

[ceph_deploy][ERROR ] RuntimeError: Failed to execute command: /usr/sbin/ceph-disk zap /dev/sda3


2.实际影响

我osdnode1设备无法正常工作,体现在:
相关命令罗列后不会返回结果 
执行创建等命令失败


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[root@osdnode1 home]# df -h
-bash:/bin/df: Input/outputerror
[root@osdnode1 home]# mount
/dev/sda3on /typeext4 (rw)
proc on/proctypeproc (rw)
sysfs on/systypesysfs (rw)
devpts on/dev/ptstypedevpts (rw,gid=5,mode=620)
tmpfs on/dev/shmtypetmpfs (rw)
/dev/sda1on/boottypeext4 (rw)
none on/proc/sys/fs/binfmt_misctypebinfmt_misc (rw)
 
mount: warning:/etc/mtabis not writable (e.g.read-only filesystem).
       It‘s possible that information reported bymount(8) is not
       up todate. For actual information about systemmountpoints
       check the/proc/mountsfile.
 
[root@osdnode1 home]# df -h
-bash:/bin/df: Input/outputerror

一直报IO error.


3.解决办法

后通过如下方法修复:命令执行过程中一路yes next就OK.

fsck -t ext4 /dev/sda3

技术分享


修复成功后

技术分享

Linux 文件系统修复

标签:

原文地址:http://my.oschina.net/myspaceNUAA/blog/498387

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!