Chapter 7. Troubleshooting/FAQs

Q:

Why are my cloned disks so big, I thought QCOWs would be smaller if my disk was mostly empty [48]

A:

Creating a disk image from a device copies all blocks from the source device. This includes data which has been deleted on the filesystem.

When you delete a file from the filesystem the operating system will not signal to the disk that it should mark the formerly occupied blocks as free [49] . The additional overhead associated with the operation would hurt disk performance.

What option do you have available if you want to minimize the size of the created disk image? You have two options, a free utility called zerofree [50] , and virt-sparsify. I refer you to Section 4.1.5, “virt-sparsify” for more information on virt-sparsify.

Q:

Why do I get a device busy error message when unmounting $THING?

A:

A process is accessing files on the mounted volume. Possible fixes:

  • Sometimes the solution is a simple as lazily unmounting the device. Do this by giving the -l option to umount.

  • Make sure you don't have any open shells whose present working directory is in the path you're trying to unmount.

  • If that doesn't work you can try using the fuser command to find what processes are accessing the device. For example: fuser /mnt/thumbdrive. This command also accepts an optional -k option, which will try to kill all processes accessing the busy path.

  • If none of that works you can try the lsof command (superuser permissions required to see everything being accessed). For example: lsof | grep /mnt/path.



[48] This character is called the interrobang. I just blew your mind.

[49] This is what allows data recovery software to work