Corey Wright wrote:
hopefully the line wrapping doesn't visually destroy the following too much.
# ls -1i /home/vservers/*/bin/bash | cut -d' ' -f1 | uniq -c
13 6751094
(all thirteen instances of /bin/bash within vservers occupy inode 6751094.)
# ls -il /home/vservers/{test,client}/bin/bash*
6751094 -rwxr-xr-x 14 root root 729640 2005-05-02
17:39 /home/vservers/client/bin/bash
6751094 -rwxr-xr-x 14 root root 729640 2005-05-02
17:39 /home/vservers/test/bin/bash
(there are 14 hardlinks: 13 belonging to vservers, and the master one
within /etc/vservers/.defaults/apps/vunify/hash/0.)
# cp -av /home/vservers/client/bin/bash{,.unlinked}
`/home/vservers/client/bin/bash' ->
`/home/vservers/client/bin/bash.unlinked'
# ls -1i /home/vservers/{test,client}/bin/bash*
6751094 /home/vservers/client/bin/bash
573454 /home/vservers/client/bin/bash.unlinked
6751094 /home/vservers/test/bin/bash
# rm /home/vservers/client/bin/bash
rm: remove write-protected regular file `/home/vservers/client/bin/bash'? y
# mv /home/vservers/client/bin/bash{.unlinked,}
# ls -il /home/vservers/{test,client}/bin/bash*
573454 -rwxr-xr-x 1 root root 729640 2005-05-02
17:39 /home/vservers/client/bin/bash
6751094 -rwxr-xr-x 13 root root 729640 2005-05-02
17:39 /home/vservers/test/bin/bash
# vserver client hashify -nv
Initializing exclude-list for /home/vservers/client (client)
Starting to traverse directories...
<snip>
unifying '/bin/bash'
<snip>
# vserver client hashify
# ls -il /home/vservers/{test,client}/bin/bash
6751094 -rwxr-xr-x 14 root root 729640 2005-05-02
17:39 /home/vservers/client/bin/bash
6751094 -rwxr-xr-x 14 root root 729640 2005-05-02
17:39 /home/vservers/test/bin/bash
so, that's how it works for me.
this is how i set it up, synthesized from
http://linux-vserver.org/alpha+util-vserver under "vhashify".
* mkdir -p /etc/vservers/.defaults/apps/vunify/hash
* mkdir -p /home/vservers/.hash
* ln -s /home/vservers/.hash /etc/vservers/.defaults/apps/vunify/hash/0
* mkdir -p /etc/vservers/<vserver>/apps/vunify
* customize exclusions (if necessary)
o cp
-av /usr/lib/util-vserver/defaults/vunify-exclude
/etc/vservers/<vserver>/apps/vunify/exclude
o echo '/usr/src/*' >>/etc/vservers/<vserver>/apps/vunify/exclude
* vserver <vserver> hashify -nv | less
* vserver <vserver> hashify
all but the first three steps should be repeated for each vserver.
note: /etc/vservers/.defaults/apps/vunify/hash/0,
/etc/vservers/.defaults/vdirbase,
and correspondingly /etc/vservers/*/vdir must all be (or symlink to
directories) on the same filesystem, otherwise hardlinks cannot be
created.
hth.
corey
Thanks for the detailed explanation. I have done exactly what you said,
but the two folders /etc/vservers/.defaults/aaps/vunify/hash/0 (and the
linked one /home/vservers/.hash)
contain a separate file for each file in the 2 vservers I unified (i.e.
twice as many files as there should be). So when I check my vserver
files, the number of links is 2 for the unified files: one link from the
vserver and one link from the host. But the files are not unified
between the two vservers.
Is there any configuration that might be necessary for unification and I
may have missed?
Thanks,
-FS
_______________________________________________
Vserver mailing list
[email protected]
http://list.linux-vserver.org/mailman/listinfo/vserver