Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i have an lvm snapshot and i would like to see what files have been changed, added or deleted. (Just the file list is sufficient.)

Is there an easy way to get the list?

Thanks in advance for any reply.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted
  1. Mount the old snapshot read-only mount /dev/snapshot-somewhere /snap
  2. Make lists of the files on real fs and snapshot cd /snap; ls -lR . >/tmp/list.snap (or use mtree or rsync to make the list)
  3. Compare the lists diff -u list.real list.snap

rsync can make a file list when called with just one argument:

$ cd /tmp
$ rsync -r .
drwxrwxrwt         612 2012/01/19 10:43:15 .
-rwxr-xr-x        9444 2012/01/19 08:43:13 foo

mtree can make a file which it can check for changes against life filesystem:

$ cd /tmp/tree
$ mtree -c > /tmp/list.mtree
$ touch bar.c
$ echo '/* comment */' >> foo.c
$ mtree < /tmp/list.mtree
$ mtree < /tmp/desc 
. changed
    modification time expected Thu Jan 19 11:18:11 2012 found Thu Jan 19 11:20:46 2012
bar.c extra
foo.c changed
    size expected 1350 found 1364
    modification time expected Thu Jan 19 11:18:11 2012 found Thu Jan 19 11:21:26 2012
share|improve this answer
    
that was something i was thinking of, but isn't there a faster and maybe more sophisticated solution? can't we directly ask LVM? –  JMW Jan 19 '12 at 9:24
1  
@JMW LVM is a pure volume manager that hosts binary chunks which you may format to any file system you like. LVM doesn't know about files at all. There are filesystems that have their snapshots though. –  jkj Jan 19 '12 at 9:31
    
And there is ZFS that does both volume management and filesystem stuff :) –  jkj Jan 19 '12 at 9:32
    
ok, good to know, that there is no faster method. –  JMW Jan 19 '12 at 9:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.