Journal Articles
Browse in : |
All
> Journals
> CVu
> 013
(15)
|
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.
Title: File Recovery Under Xenix
Author: Martin Moene
Date: 28 June 2010 08:53:00 +01:00 or Mon, 28 June 2010 08:53:00 +01:00
Summary:
Body:
"IMPOSSIBLE!" I hear you cry. In most cases I would agree with you.
If the system is working hard then the filesystem blocks that you discard will end up in someone elses file faster than you can act to stop it.
If however you are the only active user on a machine and you 'rm' a precious program or document that you have been working on for weeks try this program before fully enjoying a nervous breakdown!.
- If you are not already root get super user status - quickly the longer this part takes to more likely you are to loose the data.
- Once root type 'sync;/etc/haltsys' to shut the machine down fast. Make sure you have the agreement of others logged on for this.
- Your next action depends on which filesystem the deleted file was on. If it was on /dev/usr or another mounted filesystem then simply take the machine single user.
In this case recover must be living in /bin or /etc so you can execute it without mounting usr. If the file was on root then some foresight is needed - you have to prepare a system boot floppy with the recover program on it. The important thing is that the filesystem with the lost file must not be re-mounted until the recovery has taken place. If ANY files are written to the filesystem blocks from the freelist will be taken to write them into. It is these very blocks that recover is interested in. - Cd to a directory in which it will be safe to create temporary files. If saving a big file off root from a boot floppy then mount /dev/usr from the floppy & use /usr/tmp as the work area.
- Invoke recover with the name of the filesystem device (/dev/root or /dev/usr) and a number of K byte blocks to recover from the free list. This number should be the size of the file that you lost plus a few more for luck.
- You will find that recover will create a number of files in the current directory in the form flist[0-<number you wanted>]. It is now up to you to piece together your original file from these fragments. The only help I can give you for this stage is the observation that flist0 is usualy the first block of the file, flist1 the second & so on. If any files have been written since your file was deleted then the first few blocks will be missing. This is because the free list is actualy used as a stack. The most recentley freed block is the first to be allocated to a new file.
The file is compiled with the following options.cc -M2es -DM_KERNAL -o recover recover.c
Happy Hunting!
Notes:
More fields may be available via dynamicdata ..