Skip to main content
fixed device names
Source Link

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file.

Despite that by default e2image saves metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

QCOW2 format is more preferable for backups than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process not only used space, but free space too.

So, usage examples are:

  • Backup sda1 partition, including files & metadata, to the file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in progress. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore partition /dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1sda1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file.

Despite that by default e2image saves metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

QCOW2 format is more preferable for backups than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process not only used space, but free space too.

So, usage examples are:

  • Backup sda1 partition, including files & metadata, to the file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in progress. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore partition dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file.

Despite that by default e2image saves metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

QCOW2 format is more preferable for backups than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process not only used space, but free space too.

So, usage examples are:

  • Backup sda1 partition, including files & metadata, to the file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in progress. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore partition /dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sda1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

deleted 24 characters in body
Source Link

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file.

Despite that by default e2image is savingsaves metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

For backing up, QCOW2 format is more preferable for backups than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process free space too, not only used space, but free space too.

So, usage examples are:

  • Backup a sda1 partition, including files & metadata, to athe file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in processprogress. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore a partition dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file.

Despite that by default e2image is saving metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

For backing up, QCOW2 format is more preferable than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process free space too, not only used space.

So, usage examples are:

  • Backup a sda1 partition, including files & metadata, to a file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in process. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore a partition dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file.

Despite that by default e2image saves metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

QCOW2 format is more preferable for backups than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process not only used space, but free space too.

So, usage examples are:

  • Backup sda1 partition, including files & metadata, to the file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in progress. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore partition dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

deleted 24 characters in body
Source Link

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file specified by image-file.

Despite that by default e2image is saving metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

For backing up, QCOW2 format is more preferable than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process free space too, not only used space.

So, usage examples are:

  • Backup a sda1 partition, including files & metadata, to a file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in process. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore a partition dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file specified by image-file.

Despite that by default e2image is saving metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

For backing up, QCOW2 format is more preferable than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process free space too, not only used space.

So, usage examples are:

  • Backup a sda1 partition, including files & metadata, to a file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in process. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore a partition dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

You could also try e2image:

The e2image program will save critical ext2, ext3, or ext4 filesystem metadata located on device to a file.

Despite that by default e2image is saving metadata only, it's able to save data too, by the use of -a option. (See section "Including data" by the link)

The -a option can be specified to include all data. This will give an image that is suitable to use to clone the entire FS or for backup purposes. Note that this option only works with the raw or QCOW2 formats.

For backing up, QCOW2 format is more preferable than raw format. QCOW2 image is a normal file with size that is close to used space of partition to back up. Raw image is a sparse file with all the implications - tools that don't handle sparse files specifically will process free space too, not only used space.

So, usage examples are:

  • Backup a sda1 partition, including files & metadata, to a file boot-part.qcow2:
sudo mount -o remount,ro /dev/sda1 sudo e2image -a -Q /dev/sda1 boot-part.qcow2 

Note that remounting as read-only is required to guarantee that no one will write to the partition, while backup is in process. After all, you are able to remount as read-write by sudo mount -o remount,rw /dev/sda1 if you need to.

  • Restore a partition dev/sda1 from QCOW2 image file boot-part.qcow2:
sudo umount /dev/sda1 sudo e2image -r boot-part.qcow2 /dev/sdd1 

Note that umount is a must since you can't rewrite superblocks of a mounted partition. If /dev/sda1 is not mounted that time, you can skip this step. :)

It's also worth noting that in restoring scenario size of /dev/sda1 should be equal or greater than partition inside image file, otherwise you will get error: e2image: Invalid argument while trying to convert qcow2 image (boot-part.qcow2) into raw image (/dev/sda1).

Source Link
Loading