tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* Comparing two directories
@ 2001-09-05  0:04 Trevor Osatchuk
  0 siblings, 0 replies; only message in thread
From: Trevor Osatchuk @ 2001-09-05  0:04 UTC (permalink / raw)
  To: tru64-unix-managers

This should be a pretty simple one.  I had a partition on a 4.0f box that I
wanted to copy over to a 4.0d box.  I want to use the disk on the 4.0f box
for something else so I made a partition on the 4.0d box, mounted the 4.0f
partition to /mnt via nfs and ran:

tar -cvpf - /mnt | ( cd /usr/newpartition && tar -xvpf - )

This copied everything over to the new partition.  Now, I want to be sure
that everything got copied over and that the integrity of the data in
intact.  I did a df -k and got:

Filesystem  1024-blocks        Used   Available Capacity  Mounted on
/dev/rz1a        244891       54461      165940    25%    /
/proc                 0           0           0   100%    /proc
/dev/rz1g       3914988     1796681     1726808    51%    /usr
/dev/rz0g       4054823     2473054     1176286    68%    /usr/stuff
/dev/rz6c       4102391     1222772     2469379    34%    /usr/newpartition
4.0fAlpha:/mnt     7091761     1222781     5159803    20%    /mnt

as you can see, the /usr/newpartition and the /mnt partition differ in size
by 9 Kbytes.  I ran a diff and got:

/> diff -r /mnt /usr/newpartition 
File /mnt/data/socket/trv is a unknown while file
/usr/newpartition/data/socket/trv is a regular file
File /mnt/data/socket/uoa is a unknown while file
/usr/newpartition/data/socket/uoa is a regular file

So then I did:

/mnt/data/socket> ls -l /mnt/data/socket
total 0
srw-rw----   1 root     system         0 Jan  7  2000 trv
srw-rw----   1 root     system         0 Jan 12  2000 uoa
/mnt/data/socket> ls -l /usr/newpartition/data/socket
total 0
-rw-rw----   1 root     system         0 Jan  7  2000 trv
-rw-rw----   1 root     system         0 Jan 12  2000 uoa

Now, these are the only files that showed up after the diff and they don't
have any size difference.  So, why is there the discrepancy in size?  Does
this have to do with dissimilar disk geometry?  I also did df -k on the 4.0f
machine in case nfs was the culprit, but it reported the same size.  Can
anyone explain to me why the difference?  Was there a better way to copy the
partition data?  Is there a better way to compare the directory structures?


Thanks!

Trevor Osatchuk
Process Solutions Canada Ltd.
Support and Integration Analyst
(780) 452-2227 Ext. 286
trevor.osatchuk@pscl.com

Any man whose errors take ten years to correct is quite a man. 
          - J. Robert Oppenheimer, speaking of Albert Einstein 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-09-05  0:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-05  0:04 Comparing two directories Trevor Osatchuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox