I have a 100 GB image file which is created using dd
. This image file is mounted via a loop device as read-write.
I want to store a backup of this image file at a remote location. I have a script which compresses the image file (using zip
) and copies the zip file to the remote storage (scheduled using cron
).
Now, my question is: should I make my script unmount the image file before zipping it? (If some read-write operation is in progress, then I would not be able to unmount it and the script would thus fail).
Or is it okay to zip it when it is still mounted? What happens if there is some write operation in progress when the zipping starts? Would the image file still be consistent?
I would appreciate some insights.