Prerequisite
A sparse file should be prepared before test. e.g.:
~ touch empty-filesystem.raw
~ truncate -s 500M empty-filesystem.raw
~ mkfs.ext4 empty-filesystem.raw
mke2fs 1.46.1 (9-Feb-2021)
Creating filesystem with 512000 1k blocks and 128016 inodes
Filesystem UUID: fe6cfb58-134a-42b3-afab-59474d9515e0
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
~ shasum -a 512 empty-filesystem.raw
4277f6174bf43d1f03f328eaf507f4baf84a645d79239b3ef4593a87b5127ceb097d540281e1f3557d9ad1d2591135bbcf24db480c1bd732b633b93cf4fe50c9 empty-filesystem.raw
For convenience, the above example file is already uploaded to the S3 server. The URL is https://longhorn-backing-image.s3.us-west-1.amazonaws.com/empty-filesystem.raw
.
Of course, you can generate your own test file as well.
Test step
- Create a backing image via one of the following ways:
- Select source type
Download From URL
and input the S3 URL of your test file. - Upload your test file to the cluster as the backing image.
- Select source type
- Wait for the backing image ready.
- Enter into the backing image manager pod. Verify the following of the backing image file:
- the apparent size is the same as that of the test file.
- the actual size is much smaller than the apparent size.
- the SHA512 checksum matches.
- Create a volume using this backing image file.
- Attach the volume then verify the content. For the example backing image, you can verify it by directly mounting the volume without making a filesystem and see if the volume already contains an empty EXT4 filesystem
- Verify the volume work fine.
- Do cleanup.