[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg and hardlinks



Jerome Warnier wrote:
> Peter Samuelson wrote:
> > [Jerome Warnier]
> >   
> >> 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?
> >>     
> >
> > You know, given the time it takes to type a 20-line email, including
> > finding the appropriate Wikipedia article to link to, it would have
> > been a lot faster to just try it.
> >
> >   # ln /bin/ls /bin/ls2
> >   # aptitude reinstall coreutils
> >   # ls -l /bin/ls /bin/ls2
> >   
> Maybe, but I also wanted to bring attention to it. ;-)

I'm curious as to why no one is looking at the index node numbers
themselves.

[jhriv@chao:/bin]% sudo ln ls ls2
[jhriv@chao:/bin]% ls -il ls{,2}
7342643 -rwxr-xr-x 2 root root 101992 Apr  4  2008 ls
7342643 -rwxr-xr-x 2 root root 101992 Apr  4  2008 ls2
[jhriv@chao:/bin]% sudo aptitude reinstall coreutils
. . .
[jhriv@chao:/bin]% ls -il ls{,2}
7350701 -rwxr-xr-x 1 root root 101992 Apr  4  2008 ls
7342643 -rwxr-xr-x 1 root root 101992 Apr  4  2008 ls2

ls2 kept the old index node, but ls gets a brand new index node, thus
showing that, indeed, dpkg will break hardlinks upon upgrade.

-- 
John H. Robinson, IV          jaqque@debian.org
                                                                 http  ((((
WARNING: I cannot be held responsible for the above,         sbih.org ( )(:[
as apparently my cats have learned how to type.          spiders.html  ((((


Reply to: