Linux下/lost+found的相关问题

来源:互联网 发布:香港元朗有没有mac 编辑:程序博客网 时间:2024/04/28 18:15

Orphaned files and directories (allocated but not referenced) are placed in lost+found during "fsck" operations. Files are named by the

inode reference "as found" by fack. Files present in this directory are inconsistent or badly injured.


The lost+found Directory
When files are recovered after any sort of problem or failure,they are placed in the lost + found directory, if the kernel cannot ascertain the proper location in the system

/lost found:
一般重启或关闭system,可下sync;sync.避免有些message会留在硬盘之cache上,此时dirty bit为1,当再开机时,system会去检查每一个dirtybit是否为0,假如为1则会执行fsck。作fsck时,常会问要否删除dirtybit,如选yes时,会把inode集中放在lost found;用file 指令去查寻,不重要再行删除即可(inode number)。简单言之,本目录乃记录硬盘上的partition于资料流失时作fsck寻找回来的遗失文件片段。


如果Linux分区有损坏情况,启动有问题,不能正常进入文本或图形界面。那么一般会出现提示,需要输入Root密码登录后采用

fsck -t ext3 -r /usr/local 修复 , /usr 是提示检查不能通过的分区。


fsck的命令的几个使用方法

指令:fsck

使用权限 : 超级使用者

使用方式 : fsck [-sACVRP] [-t fstype] [–] [fsck-options] filesys […]

说明 : 检查与修复 Linux 档案系统,可以同时检查一个或多个 Linux 档案系统

参数 :

filesys : device 名称(eg./dev/sda1),mount 点 (eg. / 或 /usr)

-t : 给定档案系统的型式,若在 /etc/fstab 中已有定义或 kernel 本身已支援的则不需加上此参数

-s : 依序一个一个地执行 fsck 的指令来检查

-A : 对/etc/fstab 中所有列出来的 partition 做检查

-C : 显示完整的检查进度

-d : 列印 e2fsck 的 debug 结果

-p : 同时有 -A 条件时,同时有多个 fsck 的检查一起执行

-R : 同时有 -A 条件时,省略 / 不检查

-V : 详细显示模式

-a : 如果检查有错则自动修复

-r : 如果检查有错则由使用者回答是否修复

例子 :

检查 msdos 档案系统的 /dev/hda5 是否正常,如果有异常便自动修复 : fsck -t msdos -a /dev/hda5

注意 :

此指令可与 /etc/fstab 相互参考操作来加以了解。


0 0
原创粉丝点击