Re: dpkg and hardlinks
Giacomo A. Catenazzi wrote:
> Jerome Warnier wrote:
>> Raphael Hertzog wrote:
>>> On Tue, 24 Mar 2009, Jerome Warnier wrote:
>>>> For files from packages, though, deduplication might be a good
>>>> idea, as
>>>> dpkg is supposedly the only one to ever modify the files (under
>>>> /usr for
>>>> I don't know however how dpkg treats hardlinks. Does it "break" the
>>>> hardlink before replacing a file or does it replace the file whatever
>>>> its real nature is?
>>> IIRC dpkg preserves hardlinks inside a binary package but I don't
>>> see how
>>> it could do the same across multiple binary packages.
>> Oh, I didn't expect it to. I just wanted to know its behaviour when it
>> upgrades a package.
>> Before the upgrade, the file is a hardlink (because I hardlinked it
>> manually), then it tries to upgrade the file/hardlink. Does it "break"
>> the hardlink* before upgrading the file or does it overwrite the
>> file/hardlink and all of its "siblings"?
> Do you really care? (not theoretically, but in normal use).
> I would expect that same content will be delivered:
> - by "brother" packages (same source), thus usually updated
> at the same time.
> - in documentation (so maybe not so important for your use).
> I think the most problem are in files outside "dpkg" control,
> i.e. /var and /etc.
> I'm just curious: do you have a list of "same" content files?
> maybe I'm completely wrong.
Here you are, for /usr on a typical Lenny AMD64 server (generated with
"finddup -n" from package perforate):