You are not logged in.

#1 2016-09-26 01:48:42

fabiotk
Banned
Registered: 2016-04-03
Posts: 10

Lost content of file after disk went full

My root partition is separated and has only 40GB. I cp to there a file about 4.5GB of size and in the middle of opperation the disk went full. But before it went full, I was with the file /etc/httpd/conf/httpd.conf opened in nano. I made the modification I needed to make and CTRL + X to save the modification and leave nano editor. At this time, the HD was already fulfilled. Nano pointed to me that couldn't save because the partition was full and left. After that, the content of httpd.conf is empty. Is there a way to recover it? Why did the content was lost? Thanks

Offline

#2 2016-09-26 11:13:25

Starfish
Member
From: Germany
Registered: 2015-10-21
Posts: 134

Re: Lost content of file after disk went full

While you edit a file with an editor, it is not immediately written back to the disk but cached in RAM. If you tried to write it back to the disk and nano said it couldn't because there was not enough space, it's not on the disk. Since nano exited, all of the process' memory was released. RAM is volatile so all of the bits became meaningless a few microseconds after its exit. To my knowledge the data is now irretrievably lost.
Next time you try to save something and the disk is full, it is crucial to leave the editor running. Then you should delete or backup enough data on the partition you need until the editor can write back to it.


"Yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the present." - Master Oogway

Offline

Board footer

Powered by FluxBB