Our sysadmin has created a backup system that creates snapshots of the hard drive.
When I try to restore an older version from the snapshot:
cp /path/to/snapshots/foo.bar /path/to/folder/foo.bar
I get an error:
cp: `/path/to/snapshots/foo.bar' and `/path/to/folder/foo.bar' are the same file.
I can delete the file and copy it but I wanted to know if there is a way to do this with cp.
I know that the files are not linked because:
- I can change the content of the source and the snapshots are kept unchanged (tested)
- I can delete the source and the snapshots are there to restore (tested)
- The files are stored on the university computation cluster. If something like that were true, somebody would have been fired already (or at least shouted at).
inode number of the files is the same
The cluster is implemented over red hat linux and I don't know what is the file system
Filesystem 1K-blocks Used Available Use% Mounted on <ipadress>:/vol/hpc/storage 67633152 67633152 0 100% /storage <ipadress>:/vol/hpc/storage 2186805248 982498048 1204307200 45% /storage
File: `/path/to/snapshots/foo.bar' Size: 404 Blocks: 8 IO Block: 4096 regular file Device: 17h/23d Inode: 19750461 Links: 1 Access: (0644/-rw-r--r--) Uid: (<num1>/ yotama9) Gid: ( <num2>/ <groupname>) Access: 2012-01-22 00:03:27.246852000 +0200 Modify: 2012-01-19 23:10:32.746397000 +0200 Change: 2012-01-19 23:10:32.746397000 +0200 File: `/path/to/folder/foo.bar' Size: 404 Blocks: 8 IO Block: 4096 regular file Device: 17h/23d Inode: 26335134 Links: 1 Access: (0644/-rw-r--r--) Uid: (<num1>/ yotama9) Gid: ( <num2>/ <groupname>) Access: 2012-01-24 16:03:48.732453000 +0200 Modify: 2012-01-24 16:03:30.728900000 +0200 Change: 2012-01-24 16:03:30.728900000 +0200