Practical Networking

Purging and Salvaging Deleted Files

Chad Sexton

What happens when users accidentally delete an important file or save the wrong version of a file? As you probably know, most users call you, the network administrator, in a panic, hoping that you can save the day. Before you pull out a backup tape and start restoring the file, however, you can try to salvage the file.

This article explains how an IntranetWare or NetWare 4 server handles deleted files. This article also explains how to change the server's default settings for permanently erasing, or purging, deleted files and how to manually salvage these files. In addition, this article explains how to purge deleted files--a process that can improve the server's performance.

BRINGING FILES BACK FROM THE DEAD

By default, when a user deletes a file stored on a server, the file remains in a recoverable state on the server's hard drive until this file is either salvaged or purged. When a user deletes a file, the server waits for the time specified by the Minimum File Delete Wait Time parameter before marking the file as purgeable. Because neither the server nor any user can purge this file during the time specified by the Minimum File Delete Wait Time parameter, you can salvage the file during this time. You can set the Minimum File Delete Wait Time parameter to a value between 0 seconds and 7 days. The default value is 1 minute 5.9 seconds.

To keep its hard drive from filling to capacity with deleted files, a server tries to free up at least 1/32 of the hard drive space allotted to each volume. The server makes this space available by purging the oldest deleted files.

Before purging a deleted file, this server checks the File Delete Wait Time parameter, which specifies how long the server must wait after a user deletes a file before actually purging the file. If the amount of time specified in the File Delete Wait Time parameter has not passed, the server tries to leave this file on the volume--even if the server must leave less than 1/32 of the volume's hard drive space free. However, if this server must make room for new files, the server disregards the File Delete Wait Time parameter and immediately purges the file. You can set the File Delete Wait Time parameter to a value between 0 seconds and 7 days. The default value is 5 minutes 29.6 seconds.

You can set the Minimum File Delete Wait Time and File Delete Wait Time parameters in three ways: You can enter the SET command at the server console, you can run the SERVMAN utility at the server console, or you can add the appropriate SET commands to the server's AUTOEXEC.NCF file.

To understand how the Minimum File Delete Wait Time and File Delete Wait Time parameters work, suppose that a 32 MB volume were full and both parameters were set to the default value. If a user deleted a 1 MB file from this volume, no one could create a new file on the volume until 1 minute 5.9 seconds had passed (as specified by the Minimum File Delete Wait Time parameter).

If you used the NetWare Administrator (NWADMIN) utility to check the volume's available hard drive space during this time, you would find that this volume had 0 MB of free space. The NWADMIN utility would also report that unpurgeable deleted files were using 1 MB of the volume's hard drive space.

After 1 minute 5.9 seconds, any user could create a 1 MB or smaller file on the volume, and the server would purge the deleted file to make room for the new file. If no one created a new file, the server would wait 5 minutes 29.6 seconds (as specified by the File Delete Wait Time parameter) after the user deleted the 1 MB file and then automatically purge this file. Any user who had the Create right to the volume could salvage the file until the server automatically purged this file or until a user with the Erase right to the volume manually purged the file.

If you need to free up hard drive space, you can specify that the server immediately purge deleted files: You simply set the Immediate Purge of Deleted Files parameter to On. (The default setting is Off.) If you change this parameter, however, you will not be able to salvage deleted files. You can change this parameter in the same way you change the Minimum File Delete Wait Time and File Delete Wait Time parameters.

SALVAGING OR PURGING DELETED FILES

Depending on your company's network, deleted files can eventually fill up a server's hard drive and affect the server's performance. If you want to know how much disk space deleted files occupy on a volume, you simply launch the NWADMIN utility, double-click the Volume object, and click the Statistics button. The Statistics dialog box appears, displaying (among other statistics) the amount of hard drive space the volume can use, the amount of hard drive space occupied by purgeable deleted files, and the amount of hard drive space occupied by deleted files that you cannot yet purge.

You can use two utilities to salvage or purge deleted files from a volume: the NWADMIN utility and the FILER utility. The next sections explain how to use both utilities.

Using the NWADMIN Utility

To salvage or purge deleted files with the NWADMIN utility, you complete the following steps:

1. From the browser window, select the directory in which the files were stored before they were deleted.

2. Select the Salvage option from the Tools menu. (This option allows you to salvage and purge deleted files.)

3. The Salvage dialog box appears. In the Include field, specify which files you want listed. You can enter a specific filename, or you can use wildcard symbols to list multiple files. If you leave the line blank or type the wildcard symbols *.*, the NWADMIN utility lists the files in the specified directory that have been deleted but can be recovered.

4. If you want to change the order in which the NWADMIN utility displays files, use the Sort Options pull-down menu to select one of the following options: Sort by Deletion Date, Sort by Deletor, Sort by File Name, Sort by File Size, or Sort by File Type.

5. If you want to display all of the files that were stored in a deleted directory, use the Source pull-down menu to select the Get From Deleted Directories option.

6. Click the List button to display the files you have specified. (See Figure 1.)

7. Select the files you want to salvage or purge.

8. Click either the Salvage button or the Purge button, depending on what you want to do. If you salvage files from an existing directory, they are restored to that directory. If you salvage files from a deleted directory, they are restored to the volume's root directory.

9. When you are finished, click the Close button.

Using the FILER Utility

The DOS-based FILER utility is included with IntranetWare and NetWare 4.x. Although the FILER utility does not offer a GUI, this utility has one advantage over the NWADMIN utility: You can use the FILER utility to purge all of the files in a directory and all of its subdirectories. The NWADMIN utility can purge files only in one directory or subdirectory.

Salvaging Files. To use the FILER utility to salvage deleted files, you complete the following steps:

1. Type FILER at the DOS prompt. The Available Options menu appears.

2. The FILER utility's window displays the current directory, which is the directory from which the FILER utility will salvage files. If you want to salvage files from this directory, skip to step 3. If you want to salvage files from a different directory, choose the Select Current Directory option. Then enter the appropriate directory path, or press the Insert key to locate this directory. After you select a new current directory, the Available Options menu appears again.

3. Select the Salvage Deleted Files option. The Salvage menu appears.

4. Select the View/Recover Deleted Files option if the files are located in an existing directory, or select the Salvage From Deleted Directories option if the files are located in a deleted directory.

5. Specify which files you want listed. Enter a filename, or use wildcard symbols to list multiple files. Use an asterisk (*) or *.* to display all of the deleted files in the directory you selected. After you specify the files you want listed, press the Enter key.

6. To specify how you want the files sorted, press the F3 key. The Salvage Sort Options window appears. You can select one of the following options: Sort List by File Name, Sort List by File Size, Sort List by Deletion Date, or Sort List by Deletor.

7. To salvage a file, select the file, and press the Enter key. To salvage multiple files, use the F5 key to mark each file. After you have selected all of the files you want to salvage, press the Enter key.

If you salvage files from an existing directory, the files are restored to that directory. If you salvage files from a deleted directory, the files are restored to the volume's root directory.

Purging Files. To use the FILER utility to purge deleted files, you complete the following steps:

1. Type FILER at the DOS prompt. The Available Options menu appears.

2. The FILER utility's window displays the current directory, which is the directory from which the FILER utility will purge deleted files. If you want to purge files from this directory, skip to step 3. If you want to purge files from a different directory, select the Select Current Directory option. Then enter the appropriate directory path, or press the Insert key to locate this directory. After you select a new current directory, the Available Options menu appears again.

3. Select the Purge Deleted Files option.

4. The File Name Pattern to Purge window appears. Specify which files you want to purge. Enter a specific filename, or use wildcard symbols to list multiple files. Use an asterisk (*) or *.* to purge all of the deleted files in the directory you selected. After you specify the files you want purged, press the Enter key.

5. The Purge Options window appears. Specify whether you want to purge deleted files only in the current directory or in all of the subdirectories of the current directory. Then press the Enter key. The server begins to purge the files you selected.

CONCLUSION

Both IntranetWare and NetWare 4 allow you to determine how long deleted files remain on a server's hard drive. Depending on your company's network environment, you can delay the purging of deleted files, or you can specify that deleted files are purged immediately.

To ensure that the "Practical Networking" column meets your needs, we need to know what you want to learn about. Send suggestions for future issues to practical@niche-associates.com. In addition, please send any networking tips or tricks you would like to share with other users.

Chad Sexton works for Niche Associates, an agency specializing in technical writing.

NetWare Connection, December 1997/January 1998, pp. 42-43