Hi all,
I ended up resolving the question I posted last week. The reason the partition
devices read all zeros was because, in fact, those positions on the disk were
all zeros. Somehow, everything past 1.1 GB got set to all zeros on the disk,
so it was all correct. I was confused trying to resolve that with a backup (dd)
copy of the disk that I had, which I finally noticed was about 1.1 GB long, not
4.3 as I was expecting. Thus the inconsistancies that I was seeing.
Anyway, thanks for the input.
I am somewhat curious how it got zerod in the first place. I wasn't working on
it at first, but the person who was claims the file started at 4.3 GB (the right
size). So, at some point it got truncated. The modification time was not
updated on the file. Doing a dd back to the disk with a short file shouldn't
affect anything past the end of the file, right? Therefore, there would have
had to have been some kind of condition whereby the file got truncated while a
dd was going on, and for some reason, it started writing zeros instead of
stopping.
It doesn't matter for my problem at this point, since the files are gone either
way, but it might make an interesting academic question. :-)
Aaron
On Sep 06, 2003 23:43 -0600, Aaron Dewell wrote:
> Doing a dd back to the disk with a short file shouldn't
> affect anything past the end of the file, right? Therefore, there would have
> had to have been some kind of condition whereby the file got truncated while a
> dd was going on, and for some reason, it started writing zeros instead of
> stopping.
That's a common pitfall of dd. It will truncate regular output files unless
you use "conv=notrunc". If you are writing to a block device it obviously
can't truncate the device so you don't notice it unless you are trying to
dd over an existing file.
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/