Hi,

when using tar with the -M option, it seems like accidentally pressing
return while tar is writing to the current volume, may result in tar
writing again to the same volume, actually overwriting the data previously
written. Especially when running in --verbose mode one may not notice that
it happened, resulting in some kind of data loss.

I've noticed the -F option which could be used to run a custom script that
requires one to e.g. enter YES instead of just hitting return. But i think
the default behaviour might be a little bit dangerous because it may happen
without noticing it.

It reproducible with the following commands (pressed return immediately
after starting tar) :

root@bserver1:~# dd if=/dev/zero of=/tmp/test.tape bs=1M count=256
256+0 records in
256+0 records out
268435456 bytes (268 MB, 256 MiB) copied, 0,332913 s, 806 MB/s
root@bserver1:~# losetup /dev/loop0 /tmp/test.tape
root@bserver1:~# tar --create --multi-volume --file=/dev/loop0 /usr/
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets

Prepare volume #2 for ‘/dev/loop0’ and hit return: Prepare volume #3 for
‘/dev/loop0’ and hit return:

root@bserver1:~# losetup -d /dev/loop0

Regards
Heiko

Reply via email to