Mast Kalandar

bandar's colander of random jamun aur aam

Mon, 03 Nov 2003

< Computers for 5-year olds | · | Maximixed terminals and WM wars >

Implementing "undelete"


Tags: , , , [link] [comments (0)] [raw]

How can we implement undelete functionality in Minix?.

This is a linux questions list not a minix questions list. But since linux was started as a project to improve minix I will try to answer your question...except to do so for linux (answers may also apply to minix "mutatis mutandi").

The above question can be understood in many ways:

  1. Can one use a file system with undelete features under linux?
  2. Does the minix file system have some mechanism which one can use to undelete a file?
  3. Is there a way to change the minix file system so that it supports an "undelete" system call?

Essentially the answer to all three questions is "yes but beware".

A. The answer to the first question is to use a file system which supports undeletion and that can be used with user-level tools under minix (without "mount"ing) such as "mtools" for MS Dos systems. The newer ext2fs also has undelete features which can be used with e2tools.

B. The minix file system (like early versions of ext2) does not support the retention of the indirect block data upon file deletion. This means that files beyond a certain size cannot not be restored. Smaller files can be recovered using debugfs.

C. Of course, it is possible to improve the minix file system in many ways---for example see "ext2fs". More seriously, if you want to implement undeletion for minixfs, it should be possible to back-port (from the recent ext2fs) the changes made to the deletion mechanism in order to retain the indirect block data (as far as I recall minixfs anyway does not support multiple indirection levels). Unfortunately, even though minix is "micro-kernel" and so supposedly modular in design, it is far more difficult to do the necessary testing under minix than to do the same testing under linux!

However, note that:

  1. Most *nix editors edit a file "in-place" which means that the allocated blocks are over-written. This means that no file deletion actually takes place when the editing is done and so no undeletion is possible.

  2. In any file system, if the de-allocated blocks are used by another file (for example because disk space is in short supply), then the file cannot be recovered.

  3. Since linux (and minix) are multi-user and multi-tasking many more files are opened, read and written than those for which such an action is explicitly requested by the user. This worsens the problem (II) above.

Overall, one is better off using some form of file versioning as a way to prevent "accidental" deletion under *nix---and of course, there are very many different "backup" tools.

In case this question came out a course on Minix (either self-taught or with a professor :)) please note that it is probably better to learn with Linux nowadays. "The Linux Kernel" by Rusling is a good place to start (it is available online from The Linux Documentation Project).


Name
E-mail (will not be displayed)
OpenID (required)
Simple HTML and wiki markup are allowed.

Archives

< November 2003 >
SuMoTuWeThFrSa
       1
2 3 4 5 6 7 8
9101112131415
16171819202122
23242526272829
30      

2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001, 2000, 1999, 1997, 1995,