Package: coreutils
Version: 8.5-1
Severity: minor
File: /bin/cp

I have a backup script that does the typical "rsync followed by cp
-al" to maintain snapshots of the backup.  I unexpectedly ran out of
inodes on the destination filesystem the other day...one of the
machines I back up has hundreds of thousands of symlinks on it.  These symlinks 
all seem to get their inode for each snapshot.  I've trivially reproduced the 
problem:
$ mkdir sym; cd sym
$ ln -s xxx yyy
$ ln yyy zzz
$ echo foo > aaa
$ ln aaa bbb
$ ls -li
3015279 -rw-r--r-- 2 cchiappa cchiappa 4 Jul 22 09:34 aaa
3015279 -rw-r--r-- 2 cchiappa cchiappa 4 Jul 22 09:34 bbb
 659196 lrwxrwxrwx 2 cchiappa cchiappa 3 Jul 22 09:32 yyy -> xxx
 659196 lrwxrwxrwx 2 cchiappa cchiappa 3 Jul 22 09:32 zzz -> xxx
$ cd ..
$ cp -al sym sym2
$ ls -li sym sym2
sym:
3015279 -rw-r--r-- 4 cchiappa cchiappa 4 Jul 22 09:34 aaa
3015279 -rw-r--r-- 4 cchiappa cchiappa 4 Jul 22 09:34 bbb
 659196 lrwxrwxrwx 2 cchiappa cchiappa 3 Jul 22 09:32 yyy -> xxx
 659196 lrwxrwxrwx 2 cchiappa cchiappa 3 Jul 22 09:32 zzz -> xxx

sym2:
3015279 -rw-r--r-- 4 cchiappa cchiappa 4 Jul 22 09:34 aaa
3015279 -rw-r--r-- 4 cchiappa cchiappa 4 Jul 22 09:34 bbb
3015281 lrwxrwxrwx 1 cchiappa cchiappa 3 Jul 22 09:35 yyy -> xxx
3015284 lrwxrwxrwx 1 cchiappa cchiappa 3 Jul 22 09:35 zzz -> xxx

Notice that the regular files in sym2 share an inode with their
source, but but we now have three inodes for the symlinks (1 for
sym/{yyy,zzz} and 1 each for sym2/{yyy,zzz}).

Workaround: eliminate the cp -al and use rsync's --list-dest support
(which is a little bit tricky but I suppose more integrated anyhow)

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages coreutils depends on:
ii  libacl1                       2.2.49-3   Access control list shared library
ii  libattr1                      1:2.4.44-2 Extended attribute shared library
ii  libc6                         2.11.2-2   Embedded GNU C Library: Shared lib
ii  libselinux1                   2.0.94-1   SELinux runtime shared libraries

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to