linux下文件损坏怎么删除 No such file or directory

root下rm -rf仍不可行,rm: cannot remove `public/’: Is a directory

尝试命令行删除

[root@paly home]#ls
0.97        data      fire1       iso    nfs  Python-3.6.0      test     tom   tom2  vmlinuz
bincopy.sh  download  initrd.img  mysql  pub  Python-3.6.0.tgz  test.py  tom1  ton
[root@paly home]#cd test
[root@paly test]#ls
public									#这里publilc是问题文件
[root@paly test]#ls -lah
total 4.0K
drwxr-xr-x   3 root root    0 Mar 24 21:31 .
drwxr-xr-x. 15 root root 4.0K Mar 16 18:26 ..
dr-xr-xr-x   2 root root    0 Mar 24 21:31 public
[root@paly test]#rm -rf public/
rm: cannot remove `public/': Is a directory
[root@paly test]#rm -v -fr public/
rm: cannot remove `public/': Is a directory

[root@paly test]#cd public/
-bash: cd: public/: No such file or directory
[root@paly test]#pwd
/home/test
[root@paly test]#touch a
touch: cannot touch `a': Permission denied
[root@paly test]#pwd
/home/test
[root@paly test]#cd public/
-bash: cd: public/: No such file or directory
[root@paly test]#mkdir to
mkdir: cannot create directory `to': Permission denied
[root@paly test]#ls -lah
total 4.0K
drwxr-xr-x   3 root root    0 Mar 25 00:35 .					#这里最终发现是由某个脚本或者软件自动生成的
drwxr-xr-x. 15 root root 4.0K Mar 25 00:35 ..
dr-xr-xr-x   2 root root    0 Mar 25 00:35 public
[root@paly home]#chmod -R u+w test  
chmod: cannot read directory `test/public': No such file or directory
[root@paly test]#file public/
public/: cannot open `public/' (No such file or directory)
[root@paly test]#file public
public: directory
[root@paly test]#getfacl public/
getfacl: public/: No such file or directory
[root@paly test]#userdel -r test
userdel: user 'test' does not exist
[root@paly home]#cp -r test ./fire1/
cp: cannot access `test/public': No such file or directory
[root@paly test]#ls -ld .
drwxr-xr-x 3 root root 0 Mar 24 21:31 .
[root@paly test]#ls -ld public/
ls: cannot access public/: No such file or directory

进入单用户模式操作

在这里插入图片描述
mount -o remount,rw /

[root@paly test]#df -Th
Filesystem           Type   Size  Used Avail Use% Mounted on
/dev/mapper/vg_ton-lv_root
                     ext4    19G  8.8G  8.4G  52% /
tmpfs                tmpfs  249M     0  249M   0% /dev/shm
/dev/sda1            ext4   477M   54M  398M  12% /boot

fsck 磁盘修复

有待研究 系统盘的fsck修复方法

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值