[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
如果在centos系统下,你不小心删除了文件或目录(例如:rm -rf test.txt
),那么不要慌,先静下心来,下面我告诉你恢复方法(删除文件和目录都是一样的)
下边唯一要注意的是,要换成你自己被删除文件的目录
<>1.执行命令“cd /gitea”进入服务器根目录gitea;
<>2.执行命令“ mkdir asd”创建一个文件夹;
<>3.执行命令“ rm -rf asd ”删除该文件;ll查看此时文件以及不存在了
<>4.执行命令“ debugfs ”运用系统自带恢复工具debugfs来修复;
<>5.额外开一个xshell,执行命令“ df /gitea/ ”打开刚刚被删除文件所在分区;查看到分区为/dev/vda1
<>6.执行命令“ open /dev/vda1 ”查看目录分区;
<>7.执行命令“ ls -d /www/wwwroot/gitea”显示被删除文件所在目录;
<>8.执行命令“ logdump -i <1452682>”查找文件所在区块号;
<>9.记住上图block后面的数值并执行命令“ quit ”退出debugfs;
<>10.执行命令“dd if=/dev/vda1 of=/www/wwwroot/gitea/asd bs=1152 count=1
skip=5767796 ”恢复文件操作;
<>11.bs与上图offset值一致,skip与block值一致; <>12.执行命令“ ls
”可以看到文件demo.txt被删除后又重新找回来了,恢复成功。