Re: [Vserver] How best to unhashify

From: Herbert Poetzl <herbert_at_13thfloor.at>
Date: Tue 14 Mar 2006 - 13:04:33 GMT
Message-ID: <20060314130433.GA21506@MAIL.13thfloor.at>

On Tue, Mar 14, 2006 at 09:58:50AM +1100, Tony Lewis wrote:
> With reckless abandon, I vhashified a couple of vserver Ubuntu guests
> with no exclusions. Now I find that upgrading is a problem. These
> vservers are just for fun, so no harm done, but I'm curious as to the
> best way to unhashify, should a mistake be made.
>
> Would it be:
>
> for each file in /vservers/.hash
> for all files in /vservers/* (except /vservers/.hash) with the same
> inode
> cp the file, preserving username, perms, timestamp, to a temp file
> rm the file
> mv the copied file to the original file
> remove the file in /vservers/.hash
>
> Or is there a more elegant way?

something like this (untested) should do the trick:

find /vservers/guest -type f -exec showattr {} \; | gawk '/^----UI-/ { printf "cp -a %s %s.unhash\nmv %s.unhash %s\n",$2,$2,$2,$2; }' | sh

it will break unified files but leave 'normal' hardlinks
as is, probably not a big deal in your case ...

best,
Herbert

> Tony
> _______________________________________________
> Vserver mailing list
> Vserver@list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Tue Mar 14 13:05:20 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Tue 14 Mar 2006 - 13:05:22 GMT by hypermail 2.1.8