On Wed, Mar 27, 2002 at 02:01:00PM +1100, Jeff Waugh wrote:

> Is there a shortcut to doing this all the time, however? I'd like to keep
> two trees of files, one owned as root, and one as a user, and have the
> user's files relinked if he/she changes anything. Doable? Can it be done
> with chattr options, or can it only be done via the software?

I don't think you can have two links to the same file with
different permissions on it.  At least, it doesn't work on my
system (2.4.17, with either ext2 or reiserfs).

If you're using vim, set the backupcopy option to 'no' if you
want to make the edited file have a new inode (i.e. break the
link from the old file).

If you want to understand why some applications keep the hardlink
the same, and why some applications break the link, do

    :help 'backupcopy'

in Vim.  It's got a really good explanation of why this happens.

Also check out the mklinks program, which is somewhere on Cameron
Simpson's homepage[1].  It'll scan an entire tree looking for
identical files, and hardlink them all together.  Lots of fun
when you have lots of kernels:

    16:48(0) exodus:~lk% ls
    Prism2-2001-07-11/                 linux-2.4.15/               
linux-2.4.17-pristine/
    Prism2-2001-09-27/                 linux-2.4.16/               linux-2.4.18-chiba/
    cobalt-2.0.34C53_SK.patch.bz2      linux-2.4.17-jl15-ll/       linux-2.4.18-jl1-ll/
    cobalt-linux-2.0.34C53_SK/         linux-2.4.17-jl15-ll-mki/   
linux-2.4.18-jl1-ll-mki/
    cobalt-linux-2.0.34C53_SK-andrep/  linux-2.4.17-ll-mki/        
linux-2.4.18-mcp3-WOLK/
    linux-2.4.10-pe/                   linux-2.4.17-ll-mki-mosix/  linux-2.4.18-ozone/
    linux-2.4.10-pe-mki/               linux-2.4.17-mki/           
linux-2.4.18-ozone.old/
    linux-2.4.10-pe2/                  linux-2.4.17-o1sched/       
linux-2.4.18-pristine/
    linux-2.4.10-pe2-mki/              linux-2.4.17-o1sched-rmap/  
linux-2.4.18-rx55_fix/
    linux-2.4.10-pe2-mki-hmm/          linux-2.4.17-pe/            
linux-2.4.18-rx55_fix_evil/
    linux-2.4.10-pristine/             linux-2.4.17-pe-mki/        rx55_fix_evil.patch
    16:48(0) exodus:~lk%

It cleared up > 2GB once!

1. http://www.zip.com.au/~cs/


-- 
#ozone/algorithm <[EMAIL PROTECTED]>          - trust.in.love.to.save
-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to