Undelete, backup inodes

is there a way to backup all inodes? (could that help with undeleting files?)

What exactly are you attempting or want to do?
What is your os?
what file system are you using?

I'm not sure that I understand your question because, looking at your profile on this forum, you are a significant contributor. Therefore, I apologise in advance if I have completely missed the point.

There's no easy way AFAIK to 'backup' (and therefore restore) inodes. However, if it's idiots deleting files that you're concerned about, then sysadmins can manage that by creating a second 'link' to a file, in for example, another directory. If a user accidently/deliberately deletes a file then they only delete that link and the actual data isn't lost until all links are removed. Therefore, putting the link back where is should be will instantly 'restore' the file.

Does that help? Or, as I say, have I misunderstood the question?

1 Like

I would add to hicksd8 comments that linking the directory will not help. You need to link each individual item.

For example, if you have directory /dir/main and link it to /dir/backup, it will appear to be two copies, but this is two copies of the directory itself, not the content. Deleting a file in /dir/main will also delete it in /dir/backup. You need to link:-

  • /dir/main/file1 to /dir/backup/file1
  • /dir/main/file2 to /dir/backup/file2
  • /dir/main/file3 to /dir/backup/file3

If you have subdirectories, you will need to create these and link the files, e.g. having /dir/main/sub1/fileA means you need to create /dir/backup/sub1 and then link:-

  • /dir/main/sub1/fileA to /dir/backup/sub1/fileA
  • /dir/main/sub1/fileB to /dir/backup/sub1/fileB
  • /dir/main/sub1/fileC to /dir/backup/sub1/fileC

If this is what you are after, I hope that this means you don't fall into a trap just by linking the directories.

If you are after something else, please explain where we have gone wrong. perhaps you need to review your backup strategy and your access rights if there is such a risk of loss.

Robin

1 Like

@rbatte1.....That is what I said......create the link to another directory NOT link the directory itself. Sorry I didn't make that clear enough.

hicksd,
I think yours is an excellent suggestion. I just wanted to be explicit so that what may seem like a simple shortcut to reduce the effort didn't fail to protect them in the way hoped.

What you wrote was clear enough to me, but then that's because I'm always paranoid with such things having 'experienced unexpected behaviour' before :o The strongest lessons are with such 'interesting occurrences' :stuck_out_tongue:

I suppose there will be a problem with any new files that are created and if we get round that, files that are deleted & then re-created and files that are changed, therefore the linked file is changed too.

orange47,
What do you actually need to achieve? Would it be simpler to remove the ability to remove the files in question? Is the root account known by those responsible for the losses. If it is, then they could cause untold damage on your server. If it isn't can you remove their write permission to the directory that the files are in?

Robin

thanks, I just wanted a sort of small backup, that might help a bit in case some file gets accidentally deleted. filesystem is ufs, on sparc solaris 10.

What exactly are you trying to protect, from what? Is this intended to be systemwide, or a small area?

Note that a file link can't protect a file from being overwritten.

I'm trying to help undeleting a file, since there is no 'trashcan' builtin.

And you can't narrow that requirement any further at all?

If you want the entire system protected from everything, use real backups, not 'small' ones.

1 Like