Description of problem: Enterprise Linux 7 can support a maximum individual file size of 16TB. When create a 16 TB raw image, qemu-img reports the image size is too large. However, when create a 16Tb luks image, the error prompt is a little different. qemu-img should give meaningful error messages like creating raw image does. Can reproduce the issue with qemu-kvm-rhev-2.9.0-14.el7. Version-Release number of selected component (if applicable): kernel-3.10.0-829.el7.x86_64 qemu-kvm-rhev-2.10.0-16.el7 How reproducible: 100% Steps to Reproduce: 1. Mount an ext4 file system # mount -t ext4 /dev/sdc /home/tests/ext4 # df -Th /home/tests/ext4/ Filesystem Type Size Used Avail Use% Mounted on /dev/sdc ext4 40G 49M 38G 1% /home/tests/ext4 2. Create a luks image specified image size as 16TB # qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0 test.luks 16T Formatting 'test.luks', fmt=luks size=17592186044416 key-secret=sec0 qemu-img: test.luks: Could not resize file: File too large # qemu-img info test.luks image: test.luks file format: raw virtual size: 0 (0 bytes) disk size: 0 3. Create a raw image specified image size as 16TB # qemu-img create -f raw test.img 16T Formatting 'test.img', fmt=raw size=17592186044416 qemu-img: test.img: The image size is too large for file format 'raw' # qemu-img info test.img image: test.img file format: raw virtual size: 0 (0 bytes) disk size: 0 Actual results: Report that image size is too large Expected results: Report that could not resize file, and image is created in raw format Additional info:
Upstream patch: https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg04779.html
Reproduced this issue in latest qemu package. Steps: # qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0 test.luks 16T Formatting 'test.luks', fmt=luks size=17592186044416 key-secret=sec0 qemu-img: test.luks: Could not resize file: File too large # qemu-img info test.luks image: test.luks file format: raw virtual size: 0 (0 bytes) disk size: 0 # df -T test.luks Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/loop0 ext4 5095040 20472 4796040 1% /mnt # qemu-img --version qemu-img version 4.0.0 (qemu-kvm-4.0.0-6.module+el8.1.0+3736+a2aefea3) Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks
Pulled upstream, see: https://git.qemu.org/?p=qemu.git;a=commit;h=3d1900a471c89ebdd9ea7f3582fe487e2f494419
Tested with qemu-kvm-5.1.0-2.module+el8.3.0+7652+b30e6901, not hit this issue. So set status to VERIFIED. Versions: kernel-4.18.0-232.el8.x86_64 qemu-kvm-5.1.0-2.module+el8.3.0+7652+b30e6901 create 16TB luks format image on ext4 # qemu-img create -f raw loop_img 50G # losetup /dev/loop0 loop_img # mkfs.ext4 /dev/loop0 # mkdir /home/luks_test # mount /dev/loop0 /home/luks_test/ # df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/loop0 ext4 51343840 53272 48652744 1% /home/luks_test # qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0 /home/luks_test/test.luks 16T Formatting '/home/luks_test/test.luks', fmt=luks size=17592186044416 key-secret=sec0 qemu-img: /home/luks_test/test.luks: The requested file size is too large # ls /home/luks_test/* # I also try to create 8EiB luks image on xfs file system, it work well too. # umount /home/luks_test # mkfs.xfs -f /dev/loop0 # mount /dev/loop0 /home/luks_test/ # df -T Filesystem Type 1K-blocks Used Available Use% Mounted on /dev/loop0 xfs 52403200 398400 52004800 1% /home/luks_test # qemu-img create -f luks --object secret,id=sec0,data=base -o key-secret=sec0 /home/luks_test/test.luks 8E qemu-img: Invalid image size specified. Must be between 0 and 9223372036854775807. # ls /home/luks_test/ #
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:8.3 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:5137