文件系统错误修复实例(1)
2014-04-19 21:46
447 查看
》错误信息
[root@alex~]# grep error /var/log/messages
Apr 15 17:21:00 alex kernel: EXT2-fs error (device cciss/c0d0p3): ext2_lookup: deleted inode referenced: 23824100
ext2_lookup是ext2文件系统中处理路径查找的入口函数,参数dir表示父目录的inode结构,nd是指向一个上下文辅助结构的指针。
错误信息显示某个进程访问的inode已经被删除。这类大部分都可以通过文件系统修复工具fsck来修复。具体操作为:
(1)以root权限登陆系统;
(2)卸载出错分区;
(3)对出错分区执行fsck.ext2/3/4修复命令(e2fsck和fsck.ext2是完全一样的);
(4)重新挂载;
(5)完成;
》操作
以下面这条错误信息为便进行一次修复操作。
Apr 15 17:21:00 alex kernel: EXT2-fs error (device cciss/c0d0p3): ext2_lookup: deleted inode referenced: 23824100
设备/dev/cciss/c0d0p3挂载在/home分区,直接卸载貌似不行,显示文件系统正在被使用,所以先应该停掉占用该文件系统的进程。fuser工具可以帮我们解决这个问题,关于fuser的简单介绍在附录中。
[root@alex /]# umount /home/
umount: /home: device is busy
umount: /home: device is busy
使用fuser杀掉占用/home文件系统的所有进程,然后再umount。
[root@alex /]# /sbin/fuser -k /home/
[root@alex /]# umount /home
这时就可以用e2fsck来修复了,执行命令。
[root@alex /]# e2fsck /dev/cciss/c0d0p3
完了之后,重新mount就可以使用了。
[root@alex /]# mount /dev/cciss/c0d0p3 /home
》附录
fuser命令是用来显示所有正在使用着指定的file, file system 或者 sockets的进程的信息。它通常用于解决类似上文中卸载磁盘时出现的“resource busy”问题,有以下常用的一些选项。
-k
kills all process accessing a file. For example fuser -k /path/to/your/filename kills all processes accessing this directory without confirmation. Use -i for confirmation
-i
ask before killing (ignored without -k)
-v
verbose.
-u
append username
-a
display all files
-n space
Select a different name space. The name spaces file (file names, the default), udp (local UDP ports), and tcp (local TCP ports) are sup-ported. For ports, either the port number or the symbolic name can be specified. If there is no ambiguity, the shortcut notation name/space (e.g. name/proto) can be used.
-m
name specifies a file on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed. If a directory file is specified, it is automatically changed to name/. to use any file system that might be mounted on that directory.
>
[root@alex~]# grep error /var/log/messages
Apr 15 17:21:00 alex kernel: EXT2-fs error (device cciss/c0d0p3): ext2_lookup: deleted inode referenced: 23824100
ext2_lookup是ext2文件系统中处理路径查找的入口函数,参数dir表示父目录的inode结构,nd是指向一个上下文辅助结构的指针。
file:fs/ext2/namei.c static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) { struct inode * inode; ino_t ino; if (dentry->d_name.len > EXT2_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); ino = ext2_inode_by_name(dir, &dentry->d_name); inode = NULL; if (ino) { inode = ext2_iget(dir->i_sb, ino); if (IS_ERR(inode)) return ERR_CAST(inode); } return d_splice_alias(inode, dentry); }
错误信息显示某个进程访问的inode已经被删除。这类大部分都可以通过文件系统修复工具fsck来修复。具体操作为:
(1)以root权限登陆系统;
(2)卸载出错分区;
(3)对出错分区执行fsck.ext2/3/4修复命令(e2fsck和fsck.ext2是完全一样的);
(4)重新挂载;
(5)完成;
》操作
以下面这条错误信息为便进行一次修复操作。
Apr 15 17:21:00 alex kernel: EXT2-fs error (device cciss/c0d0p3): ext2_lookup: deleted inode referenced: 23824100
设备/dev/cciss/c0d0p3挂载在/home分区,直接卸载貌似不行,显示文件系统正在被使用,所以先应该停掉占用该文件系统的进程。fuser工具可以帮我们解决这个问题,关于fuser的简单介绍在附录中。
[root@alex /]# umount /home/
umount: /home: device is busy
umount: /home: device is busy
使用fuser杀掉占用/home文件系统的所有进程,然后再umount。
[root@alex /]# /sbin/fuser -k /home/
[root@alex /]# umount /home
这时就可以用e2fsck来修复了,执行命令。
[root@alex /]# e2fsck /dev/cciss/c0d0p3
完了之后,重新mount就可以使用了。
[root@alex /]# mount /dev/cciss/c0d0p3 /home
》附录
fuser命令是用来显示所有正在使用着指定的file, file system 或者 sockets的进程的信息。它通常用于解决类似上文中卸载磁盘时出现的“resource busy”问题,有以下常用的一些选项。
-k
kills all process accessing a file. For example fuser -k /path/to/your/filename kills all processes accessing this directory without confirmation. Use -i for confirmation
-i
ask before killing (ignored without -k)
-v
verbose.
-u
append username
-a
display all files
-n space
Select a different name space. The name spaces file (file names, the default), udp (local UDP ports), and tcp (local TCP ports) are sup-ported. For ports, either the port number or the symbolic name can be specified. If there is no ambiguity, the shortcut notation name/space (e.g. name/proto) can be used.
-m
name specifies a file on a mounted file system or a block device that is mounted. All processes accessing files on that file system are listed. If a directory file is specified, it is automatically changed to name/. to use any file system that might be mounted on that directory.
>
相关文章推荐
- 系统恢复技术-grub文件错误,如何修复
- Linux运维笔记-文档总结-系统恢复技术之grub 文件错误修复
- 修复错误配置fstab文件导致系统无法正常启动
- fsck命令_Linux fsck 命令用法详解:检查并且试图修复文件系统中的错误
- 使用fsck修复文件系统错误
- 使用fsck命令修复linux文件系统错误【避开引起系统崩溃,启动不了的"-a"选项】
- linux系统修改系统时间重启后导致文件系统错误原因以及修复方法
- 使用fsck修复文件系统错误
- linux系统中的定时器crontab的使用攻略、常见错误问题和运行.jar文件的具体实例。
- ubuntu自动修复挂载文件系统而产生的错误
- Log4net 框架系列:log4net日志文件在asp.net中的应用实例-记录系统错误
- 使用fsck修复文件系统错误
- Log4net 框架系列:log4net日志文件在asp.net中的应用实例-记录系统错误
- 修复错误配置fstab文件导致系统无法正常启动
- 使用kail-linux出现文件系统有错误,需要手动修复
- Log4net 框架系列:log4net日志文件在asp.net中的应用实例-记录系统错误
- Linux 文件系统错误的修复方法 ddrescue替代dd的恢复软件 备用超级块
- 使用fsck修复文件系统错误
- 修复引导时的文件系统错误和修复grub引导程序导致的故障
- 使用fsck修复文件系统错误