Issues with files in QNX 6.3.2 OS

Hi,

I am running qnx 6.3.2 and i am facing few strange errors with the server, I found many Corrupted files in the server and i am not sure how to fix them properly. I know about chkfsys command but i am not sure about the data safety if run this command. I found few files like below which says that the files are corrupted,

log.m2-178056-2w116: can’t read `log.m2-178056-2w116’ (Corrupted file system detected).

Also i have another problem, when i use ls -ltr to list the files i get the below output for few files which says can’t stat file name. What does this mean?

drivers.tdb: can’t stat `drivers.tdb’

Can any one help me in fixing this.

My guess is that these are log files that get corrupted when power is removed from the system without closing the files first.

Compared to most systems, QNX is pretty good when it comes to dealing with this type of problem. Unless these logs are worth thousands of dollars and you plan on hiring an expert (for thousands of dollars) to find every last shred of data on the disk, I highly recommend using chkfsys. It usually will clean up the mess pretty well. It is more likely that you will find old junk at the end of these files than you will lose good data. And it is unlikely that you will lose anything but log data.

I said unlikely. This type of problem is like cancer. If untreated, the problem can spread. On disk links can end up pointing nowhere, or somewhere dangerous, like your program files. The disk has no memory protection like the processor. If you find that is the case, hopefully you will have backups. If not, make sure you have backups for the future.

It is a good idea to put chkfsys in your startup script, so it runs every time.

Thanks for your reply, i have some corrupted files even in user home directories. Is there any way to run chkfsys on a single directory so that it runs only on them but not on complete disk as it may take long time.Also kindly let me know the exact syntax of the chfsys to be used to repair the corrupted file systems.

We found some cases, when even running chkfsys, the file-system is not properly repaired. Digging a little deeper, we found, that the only way to fix the QNX4 file-system, is to run chkfsys with the partition unmounted. This implies to run chkfsys from the boot image. This method has the disadvantage that the time it takes to boot up the system increases according to disk size. So, we define a standard way to partition our hard disks in order to improve check time, only with most critical files (For example database files).

Here is an example of the modified .build file. You can see there the chkfsys syntax we used. (as you know, you must be very careful to recompile the system image, and make sure the alternative image works well before install the new one :slight_smile: )

Seems to work well…

QNX 6.4* uses other type of file-system wich implements “copy on write”, and these types of errors should no longer occur (I made some successful tests, but not enough yet)

I hope it helps.

Regards,
JM

There is a flag on the file system which should work as follows. If the system was shut down properly, when you run chkfsys it sees the flag and does nothing. If the system was not shut down properly chkfsys does its scan. There is a parameter to chkfsys that overrides this behavior and forces it to scan.

Of course if you never shutdown the file system properly, this won’t speed things up.