i delete a file that is being written to - where does the data being written go?
Hello. To test this, go to a terminal and do:
$ cd /tmp
$ dd if=/dev/urandom of=foofile bs=1M count=50
Open another terminal and do cd /tmp in that too. Now in any one terminal, do:
$ cp foofile goofile
and *immediately* (before this cp command completes (which is why I created a 50 MB file) go to the other terminal and do:
$ rm goofile
Now go back to the terminal with the cp command. You find that the copy apparently completes successfully without any error messages. However, there is no goofile anymore. So my questions:
1. where does the data go?
2. is it possible to recover the data? In case of mv across partitions it would be important though not in case of cp, or case of mv in same partition (which is too fast for us to delete the target file before its completion. Just try mv foofile /mnt/anotherpar
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Ubuntu Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Shriramana Sharma for more information if necessary.