Re: [Vserver] UN - vhashify - ing

From: Corey Wright <undefined_at_pobox.com>
Date: Fri 14 Jul 2006 - 05:49:09 BST
Message-Id: <20060713234909.f098e536.undefined@pobox.com>

On Thu, 13 Jul 2006 09:03:29 -0700
"Roderick A. Anderson" <raanders@acm.org> wrote:

> Corey Wright wrote:
> > On Wed, 12 Jul 2006 14:53:51 -0700
> > "Roderick A. Anderson" <raanders@acm.org> wrote:
> >
> >
> >>Is there a neat trick to un-hashify a guest?
> >
> >
> > find / -type f \
> > | while read FILE; do
> > cp -av ${FILE} ${FILE}.remove-hashification
> > rm ${FILE}
> > mv ${FILE}.remove-hashification ${FILE}
> > done
> >
> > that's just an example, but should convey the idea well enough.
>
> Will this work from both inside and outside the guest? It a filesystem
> thing being exploited ( utilized probably sounds better ) by
> Linux-Vserver?

yes, copying a file, "deleting" the original, and moving (or copying) the
copy back, will work in both the context of the host & guests, as it is a
mechanism based on the filesystem and not namespaces.

the above can be done more selectively/intelligently by insuring a file is
immutable and unlinkable using either showattr and/or lsattr.

by analyzing my hashified files (confirmed with "ls -i"):

if (showattr ${FILE} | grep ^....ui. >/dev/null); then
  echo copy, rm, and mv
fi

or

if (showattr ${FILE} | grep ^....i............ >/dev/null); then
  echo copy, rm, and mv
fi

i'm not sure which, if any, is correct to find an immutable-but-unlinkable
file created in the process of hashifying as documentation on the subject
is scarce and i don't feel like reading/reverse-engineering the source code.

but that should give you a good jump start on the subject.

corey

-- 
undefined@pobox.com
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Fri Jul 14 06:25:35 2006
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Fri 14 Jul 2006 - 06:25:46 BST by hypermail 2.1.8