Complete the code to create a disk image using the dd command.
dd if=[1] of=/path/to/image.img bs=4M
The dd command copies data from the input file (if=) to the output file (of=). To create a disk image, the input file should be the disk device, such as /dev/sda.
Complete the command to verify the integrity of a disk image using SHA256 checksum.
sha256sum [1]The sha256sum command calculates the SHA256 checksum of a file. To verify a disk image, you provide the image file name, such as image.img.
Fix the error in the command to mount a disk image read-only.
mount -o loop,[1] image.img /mntrw which allows writing.To mount a disk image in read-only mode, use the ro option. This prevents any changes to the mounted image.
Fill both blanks to create a dictionary comprehension that maps file names to their sizes if size is greater than 1000 bytes.
{filename: [1] for filename, [2] in files.items() if size > 1000}The comprehension maps each filename to its size. The loop unpacks filename and size from files.items(). The condition filters sizes greater than 1000.
Fill all three blanks to create a dictionary comprehension that maps uppercase file names to their sizes if size is less than 5000 bytes.
{ [1]: [2] for filename, size in files.items() if [3] < 5000 }The comprehension creates keys by converting filename to uppercase using filename.upper(). The values are the size. The condition filters sizes less than 5000 bytes.