s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
2. How not to delete filesIt is vital to remember that Linux is unlike MS-DOS when it comes to undeletion. For MS-DOS (and its bastard progeny Windows 95), it is generally fairly straightforward to undelete a file - the `operating system' (I use the term loosely) even comes with a utility which automates much of the process. For Linux, this is not the case. So. Rule number one (the prime directive, if you will) is:
KEEP BACKUPS no matter what. Think of all your data. Perhaps, like me, you keep several years' of accumulated email, contacts, programs, papers on your computer. Think of how your life would be turned upside down if you had a catastrophic disk failure, or if -- heaven forbid! -- a malicious cracker wiped your disks. This is not unlikely; I have corresponded with a number of people in just such a situation. I exhort all right-thinking Linux users to go out and buy a useful backup device, work out a decent backup schedule, and to stick to it. Myself, I use a spare hard disk on a second machine, and periodically mirror my home directory onto it over the ethernet. For more information on planning a backup schedule, read Frisch (1995) (see section Bibliography and Credits). In the absence of backups, what then? (Or even in the presence of backups: belt and braces is no bad policy where important data is concerned.) Try to set the permissions for important files to 440 (or less): denying
yourself write access to them means that A good trick for selected files is to create a hard link to them in a hidden
directory. I heard a story once about a sysadmin who repeatedly deleted
It requires quite some effort to delete the file contents completely: if you say
then
will retrieve it. Of course, this does not help in the event that you overwrite the file, so keep backups anyway. On an ext2 file system, it is possible to use ext2 attributes to protect things.
These attributes are manipulated with the
There is also an `immutable' attribute, which can only be set or cleared by root. A file or directory with this attribute may not be modified, deleted, renamed, or (hard) linked. It may be set as follows:
The ext2fs also provides the `undeletable' attribute ( Some people advocate making A slightly better solution is to start using a package which handles
`recyclable' deletion by providing a command not named
Next Previous Contents |