Why would a device file in RH ES 4 have a non-zero size

David Tonhofer, m-plify S.A. d.tonhofer at m-plify.com
Thu Dec 29 22:02:42 UTC 2005


>> A simple question but mystifying for me:
>>
>>   "Why would a device file in RH ES 4 have a non-zero size"
>>
>> Context:
>>
>> The device file in question has been created by an rsync backup.
>>
>> The original device file
>> (e.g. /dev/agpgart)
>> as seen through stat(1) shows:
>>
>>    Size: 0 Blocks: 0   "character special file"
>>
>> The copy of the device file
>> (e.g. /var/archive/hourly.0/foomachine/dev/agpgart)
>> as seen through stat(1) shows:
>>
>>    Size: 0 Blocks: 8   "character special file"
>>

--On Thursday, December 29, 2005 6:01 PM +0300 A.Fadyushin at it-centre.ru wrote:

> You say that e2fsck did not found problems. What is the file size after
> e2fsck? E2fsck may clear the file size without informing the user about
> the correction. The non-zero sizes of device files are not allowed on
> EXT2 filesystem. According to the e2fsprogs documentation such a
> situation (non-zero size of a device file) should be found and corrected
> since e2fsprogs version 1.19.
>> From the e2fsck ver. 1.19 (July 13, 2000) documentation:
> "E2fsck now checks if special devices have a non-zero size, and offers
> to clear the size field if it finds such an inode."
>
> Alexey Fadyushin.

Hi Alexey,

The '8 blocks' count is the block count shown after application of e2fsck.

But i'm note sure that the special file actually violates the '0 size'
convention: the size *is* 0, it's just the blockcount that is not 0. Would
ext2 assign blocks to a file of 0 size, e.g. to pre-allocate? Or to put
in SELinux ACL data (in this case though, the volume is not monted with
acl options but SELINUX=permissive.

I will put the question to the rsync mailing list, maybe someone knows
more.

-- David








More information about the redhat-list mailing list