简体   繁体   中英

how to extract file from a ext4 filesystem data?

i have a XXX.img file.

system.img: Linux rev 1.0 ext4 filesystem data, UUID=XXXX (extents) (large files)

i want to extract some file from it, how?

or XXX.subimg.tgz file

first gunzip it, get subimg file, then as image file.

mount -o loop [imgfilename] [path to mount]

就像ISO文件一样。

mkdir -p /mnt/rootfs 
mkdir -p /mnt/disk

mount -o loop rootfs.ext4 /mnt/rootfs 
mount /dev/sda2 /mnt/disk

cp -r /mnt/rootfs/* /mnt/disk

umount /mnt/rootfs

If you cannot mount (because you don't have root privileges), you can extract the ext4 filesystem data in userspace using extfstools .

To install it, run:

git clone https://github.com/qmfrederik/extfstools
cd extfstools
./autogen.sh
./configure
make

To extract all files from XXX.img to savedir :

ext2rd XXX.img ./:savedir

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM