file ... has been truncated to ... bytes

Please ask questions here if you are not familiar with fsarchiver
Post Reply
sven
Posts: 3
Joined: Sun Feb 28, 2010 8:56 am

file ... has been truncated to ... bytes

Post by sven » Sun Feb 28, 2010 9:05 am

Hi all.

I am trying a live backup of a root filesystem (ext3) with version 0.6.8 on openSUSE 11.2;
yes, I know the dangers :-)
But why does such a message show up:

oper_save.c#184,createar_obj_regfile_unique(): file [/tmp/i.log] has been truncated to 50618368 bytes (original size: 79391466): padding with zeros

although this file is unmodified for hours.
I must admit: the file is open for writing, but can this be problematic?

Sven

admin
Site Admin
Posts: 550
Joined: Sat Feb 21, 2004 12:12 pm

Re: file ... has been truncated to ... bytes

Post by admin » Sun Feb 28, 2010 9:14 am

The backup of a file is not an atomic operation. So things can happen between the beginning of the backup of that file and the end of the backup. This is what happened in that case. What happened is the size of the file at the beginning was larger than the size at the end. So fsarchiver has already written the size of the file in the archive, and it cannot copy 79391466 bytes because the file is smaller. So it will copy zero bytes to respect the original size. It means this file will be inconsistent when you restore the archive. But I guess that's not really important.

You should consider backup based on LVM snapshots. You can backup your root filesystem when it's being used, and it's 100% safe.

sven
Posts: 3
Joined: Sun Feb 28, 2010 8:56 am

Re: file ... has been truncated to ... bytes

Post by sven » Sun Feb 28, 2010 9:31 am

Thanks for the explanations.
The only thing what puzzled me is that the size of the reported file definitely changed the last time
before the backup started. Maybe it is caused by caching effects because the file
was open for writing during the backup?

admin
Site Admin
Posts: 550
Joined: Sat Feb 21, 2004 12:12 pm

Re: file ... has been truncated to ... bytes

Post by admin » Sun Feb 28, 2010 9:34 am

You should not have that error if the file has not changed. So there is a problem somewhere. You can check file properties using "stat <myfile>".

Post Reply