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
> [email protected]
> http://list.linux-vserver.org/mailman/listinfo/vserver
_______________________________________________
Vserver mailing list
[email protected]
http://list.linux-vserver.org/mailman/listinfo/vserver

Reply via email to