You can create an img from the Linux partition with dd directly.
For example:
Code: Select all
dd if=/dev/sdb1 of=~/ubuntu_MATE_17.04.img
If your partition is too big then it is possible to create an img with dd in the size of your used part of the partition and format it. After that mount it and rsync the files to this mounted img.
- Boot your Linux system for example ubuntu MATE 17.04
- (20G image)
Code: Select all
dd if=/dev/zero of=ubuntu_MATE_17.04.img count=20000 bs=1M
-
Code: Select all
mkfs.ext4 ubuntu_MATE_17.04.img
-
Code: Select all
tune2fs -c0 -i0 ubuntu_MATE_17.04.img
-
Code: Select all
sudo mount ubuntu_MATE_17.04.img /mnt/
-
Code: Select all
sudo rsync --stats --progress --numeric-ids -axAhHSP / /mnt/ --exclude=/dev --exclude=/proc --exclude=/sys --exclude=/tmp --exclude=/mnt --exclude=/media
-
Code: Select all
sudo mkdir /mnt/tmp /mnt/sys /mnt/proc /mnt/dev /mnt/media
Cheers,
Christian