FreeBSD Data Rescue

出自KMU Wiki

在2018年10月30日 (二) 09:27由Cch (對話 | 貢獻)所做的修訂版本
(差異) ←上一修訂 | 當前修訂 (差異) | 下一修訂→ (差異)
跳轉到: 導航, 搜索

Using FreeBSD and Open-Source Tools to rescue data

在 FreeBSD 下使用搶救資料的工具

目錄

[編輯] UFS fsck -y failed

If fsck -y UFS failed

# fsck -y
...
UNKNOWN FILE TYPE I=8408063
UNEXPECTED SOFT UPDATE INCONSISTENCY
CLEAR? yes
fsck_4.2bsd: bad inode number 8408064 to nextinode

Try to mount UFS read-only

# mount -r /dev/daXs1d /mnt
# find /mnt -type f -and -size -1G -print > /root/T2
# tar -T /root/T2 -cf - | ssh admin@bak "cat > host-home.tar"

If ls can not see any files or directories, you may try

  • /usr/ports/sysutils/ffs2recov
  • /usr/ports/sysutils/scan_ffs
  • /usr/ports/sysutils/sleuthkit
  • /usr/ports/sysutils/autopsy

Using autopsy

# autopsy localhost

using browser to connect http://localhost

add case -> add host -> add image -> ...

[編輯] Bad Partition Table

[編輯] Using testdisk to check and undelete partitions

Path: /usr/ports/sysutils/testdisk

Info: Tool to check and undelete partitions

WWW: https://www.cgsecurity.org/wiki/TestDisk


[編輯] Using magicrescue

/usr/ports/sysutils/magicrescue

magicrescue can rescue following file types (ls /usr/local/share/magicrescue/recipes/)

  • avi
  • flac
  • gzip
  • mp3-id3v1
  • perl
  • canon-cr2
  • gimp-xcf
  • jpeg-exif
  • mp3-id3v2
  • png
  • elf
  • gpl
  • jpeg-jfif
  • msoffice
  • zip
First to get the image of the disk or partition

# dd if=/dev/daX of=IMG_DIR/daX.img

Then using magicrescue to rescue MS-Office and JPEG files

# magicrescue -r msoffice -r jpeg-jfif -r jpeg-exif -d OUTPUT_DIR IMG_DIR/daX.img

[編輯] Using foremost

[編輯] Using gpart

[編輯] Reference

magicrescue