首页 最新文章网站服务器运维正文

恢复Linux下误删文件

左手Excel右手VBA此处内容已经被作者隐藏,请输入验证码查看内容
验证码:
请关注本站微信公众号,回复“验证码”,获取验证码。在微信里搜索“左手Excel右手VBA”或者“URItker”或者微信扫描右侧二维码都可以关注本站微信公众号。

这里用ext4做个例子 

# create ext4 fs and copy some files there fallocate -l 16m ext4.img 

losetup -f --show ext4.img 

mkfs -t ext4 /dev/loop0 

mount /dev/loop0 /mnt/ext4 

cp /mnt/ext4/ SYN

# delete some files rm /mnt/ext4/* 

# umount the ext4 fs, this is important! umount /dev/loop0 

# make a copy of the fs dd if=/dev/loop0 of=ext4-copy.img bs=4k 

# run ext4magic on the image ext4magic -m -d outputdir ext4-copy.img 

# some sample output from the command eguan@localhost:~/workspace/src/kernel$ 

sudo /home/eguan/bin/ext4

magic -m ext4.img -d testdir 

Warning: Activate magic-scan or disaster-recovery function, may be some command line options igNored "testdir" accept for recoverdir Filesystem in use: ext4.img Using internal Journal at Inode 8 Activ Time after : Sun Jun 7 22:43:54 2015 Activ Time before : Sun Jun 7 23:02:18 2015 Inode 2 is allocated Unknown code ext2 45 

#0 for block bitmap for ext4.img Warning: error-NR 2133571363 

can not found file: / MAGIC-1 : start lost directory search MAGIC-2 : start lost file search 

-------- testdir/MAGIC-2/image/jpeg/I_0000000012.jpg 

-------- testdir/MAGIC-2/image/jpeg/I_0000000013.jpg 

-------- testdir/MAGIC-2/image/jpeg/I_0000000014.jpg 

MAGIC-2 : start lost in journal search MAGIC-3 : 

start ext4-magic-scan search ext4magic : EXIT_SUCCESS

评论

精彩评论
觉得有用就打赏吧
关注本站公众号,享受更多服务!
联系方式
QQ:########
地址:中国·辽宁
Email:2727987445#qq.com
Copyright ©2015-2023.Powered by 云水客 | 网站地图 | 辽ICP备14000512号-5