You accidentally told tar to archive the very file it is writing.
When it later tries to read that still-growing file, the read is shorter than expected → “tar: short read”, and the run aborts after only ~1 MiB.
Why it happens
- The shell expands
/* to every entry in the root directory, including /tmp.
tar therefore walks through /tmp.
/tmp/malix.tgz is created, but because it isn’t excluded, tar opens it for reading while it’s still being written.
- It can only read a partial block ⇒ “short read”, and the archive is unusable.
Fixes
# safest: put the archive outside anything you’re packing
tar -czf /root/malix.tgz \
--exclude=/dev \
--exclude=/proc \
--exclude=/sys \
--exclude=/tmp \
-C / .
# OR keep it in /tmp but explicitly exclude it
tar -czf /tmp/malix.tgz \
--exclude=/tmp/malix.tgz \
--exclude=/dev \
--exclude=/proc \
--exclude=/sys \
--exclude=/tmp \
-C / .
Notes
• No trailing * is needed—excluding the directory itself drops everything below it.
• Using -C / . (“start in /, archive .”) avoids the leading‐slash warning.
Shortcut when you’re dealing with Docker
If the purpose is to grab the whole container filesystem, it’s even easier from the Docker host:
docker export <container-id> | gzip > malix.tgz
No excludes required—the export stream already omits /proc, /sys, /dev, etc.