Ubuntu pve linux等编译 ext4magic文件恢
手残不小心删除了虚拟机,损失惨重
https://sourceforge.net/projects/ext4magic/
下载后上传
然后设置执行权限
./configure
onfigure: error: You must install the develop packages "ext2fs , blkid , e2p , uuid" to build ext4magic
root@pve:/home/ext4magic-0.3.2# opkg install ext2fs
解决办法
apt install e2fslibs-dev libblkid-dev uuid-dev zlib1g-dev libbz2-dev libmagic-dev
但是build时报错
image.png
所以
STEP 1:下载RPM文件(感谢大神做的RPM包)
wget https://www.o2oxy.cn/ext4magic-0.3.1-1.2.x86_64.rpm.tar.gzSTEP
2:由于ubuntu的软件安装工具是dpkg,只能安装dep包,所以需要通过alien工具讲RPM包转换成dep包
解压
tar xzvf https://www.o2oxy.cn/ext4magic-0.3.1-1.2.x86_64.rpm.tar.gz
安装 alien
sudo apt-get install alien
转换 (有的rpm转换会失败)
sudo alien ext4magic-0.3.1-1.2.x86_64.rpm
STEP 3: 安装dep包
sudo dpkg -i ext4magic-0.3.1-1.2.x86_64.dep
但是最后发现我的pve不需要
apt install ext4magic --fix-missing
分区写入文件
dd if=/dev/nvme0n1p3 of=/mnt/a/test/copy.image
参考
https://blog.csdn.net/jycjyc/article/details/122428135
https://blog.csdn.net/u011471873/article/details/84254459(没多大参考意义)
https://teratail.com/questions/80853
https://ext4magic.sourceforge.net/install_en.html#Install_ext4magic_from_source