Bird
0
0

You run this command to back up a volume but get an error:

medium📝 Troubleshoot Q6 of 15
Docker - Production Patterns
You run this command to back up a volume but get an error:
docker run --rm -v myvol:/data busybox tar cvf /data/myvol.tar /data

What is the likely cause?
AIncorrect tar syntax for creating archive
BTrying to write the tar file inside the same volume being archived
CMissing --backup flag in docker run
DVolume myvol does not exist
Step-by-Step Solution
Solution:
  1. Step 1: Identify tar target path

    The command tries to create the tar file inside the same volume directory being archived.
  2. Step 2: Understand tar behavior

    Writing the archive inside the source directory causes tar to include the archive itself recursively, leading to errors.
  3. Final Answer:

    Trying to write the tar file inside the same volume being archived -> Option B
  4. Quick Check:

    Archive inside source causes recursive error [OK]
Quick Trick: Never save backup archive inside the source volume [OK]
Common Mistakes:
  • Assuming wrong tar syntax
  • Expecting docker run needs backup flag
  • Not verifying volume existence first

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes