[Box Backup] Question about mount-point parsing

Joe Krahn boxbackup@fluffy.co.uk
Mon, 13 Dec 2004 19:09:46 -0500


Joe Krahn wrote:
> Ben Summers wrote:
> 
>>
>> On 13 Dec 2004, at 21:04, Joe Krahn wrote:
>>
>>> Ben Summers wrote:
>>>
>>>> On 13 Dec 2004, at 17:18, Joe Krahn wrote:
>>>>
>>>>> Is the mount-point lookup in BackupDaemon.cpp related to avoiding 
>>>>> 'one filesystem' problems?
>>>>
>>>>
>>>> No.
>>>>
>>>>>
>>>>> The comment says:
>>>>> // Linux can't tell you where a directory is mounted. So we have to
>>>>> // read the mount entries from /etc/mtab! Bizarre that the OS itself
>>>>> // can't tell you, but there you go.
>>>>>
>>>>> This is sort of what the stat.st_dev field is for, but not exactly. 
>>>>> Depends what you're trying to do.
>>>>
>>>>
>>>> For this purpose, the integer device ID isn't good enough and the 
>>>> actual name is required.
>>>>
>>> OK, but what is the purpose of determining the mount point?
>>
>>
>>
>> To know which of file and directory tracking database to use. The 
>> inode numbers are used to track files so that if they're renamed, it 
>> can issue a rename command instead of uploading the data again.
>>
>> Ben
> 
> I see... you need is a unique FileSystem identifier. And, I also see noe 
> that Linux statfs does not support the statfs.f_fsid field! Very strange 
> indeed!

Just one more comment on this: I found that Linux does support f_fsid, 
but the ext2/ext3 filesystem does not. However, ext3 now includes a 
'UUID' which is like an MS-Windows GUID. A good idea, but it still is a 
filesystem-dependent feature.

Joe