[londonperl] A difficult filesystem

Dirk Koopman djk at tobit.co.uk
Wed Jun 20 19:01:21 BST 2007


Andy Armstrong wrote:
> On 20 Jun 2007, at 17:25, Dirk Koopman wrote:
>>> To clarify - the rsync based backup runs fine. What fails is using 
>>> rsync to copy the /whole/ filesystem. I was only using rsync to do 
>>> that because I've had success with it in the past. I don't need a 
>>> remote copy, both drives in the same machine.
>>
>> is cp -a too simplistic,
> 
> Hard links. Many of them.
> 
>> failing that there is always that old standby
>>
>> find / ! -name newdisc | cpio -pduvm /newdisk
> 
> Hard links :)
>

Which every cpio since the ark detects and correctly deals with:-

djk at dirk4:~$ cd /tmp
djk at dirk4:/tmp$ mkdir test
djk at dirk4:/tmp/test$ touch a b c d
djk at dirk4:/tmp/test$ ln a aa
djk at dirk4:/tmp/test$ ln a bb
djk at dirk4:/tmp/test$ rm bb
djk at dirk4:/tmp/test$ ln a ab
djk at dirk4:/tmp/test$ ln a ac

djk at dirk4:/tmp/test$ ls -i
4267930 a  4267930 aa  4267930 ab  4267930 ac  4267932 b  4267936 c 
4267937 d

djk at dirk4:/tmp/test$ cd ..
djk at dirk4:/tmp$ mkdir testb
djk at dirk4:/tmp$ cd test
djk at dirk4:/tmp/test$ find . | cpio -pduvm /tmp/testb
/tmp/testb/./a
/tmp/testb/./b
/tmp/testb/./c
/tmp/testb/./d
cpio: /tmp/testb/./a linked to /tmp/testb/./aa
/tmp/testb/./aa
cpio: /tmp/testb/./a linked to /tmp/testb/./ab
/tmp/testb/./ab
cpio: /tmp/testb/./a linked to /tmp/testb/./ac
/tmp/testb/./ac
0 blocks

djk at dirk4:/tmp/testb$ ls -i
4267939 a  4267939 aa  4267939 ab  4267939 ac  4267940 b  4267941 c 
4267942 d




More information about the london.pm mailing list