The system is up and running but I can't use yum or dnf and some other programs.What should I do now. How can I fix it.


You possibly have not lost the files yet; you just basically told the system to treat the files as nonexistant and that it's ok to overwrite them. You can get into the details of exactly how the files are deleted in ext3/4 here (some people should read this).
Before your system overwrites those files, you should try to use testdisk to recover the intact files. You could also just try to use the grep command as is outlined in this guide:

  • 2
    Yes, but OP should immediately switch the computer off and make a bit-by-bit copy of the filesystem before attempting to salvage it. Each second the system keeps running, de-allocated filesystem blocks from /var can be reused and thereby lost. – berndbausch May 18 at 23:36
  • 1
    That phrasing is wrong. The files are actually deleted, but some programs (like testdisk) may be able to recover some of them. If you're quick. And lucky. Note that testdisk does not work on all filesystems - it won't work on btrfs or zfs, for example (but they have snapshot capabilities, so it's easier to recover if there's a recent snapshot). Also note that neither testdisk nor snapshots are a substitute for backups. Data that is not backed up is data that you are willing to risk losing - if you care about your data, make regular backups. – cas May 19 at 8:55
  • 1
    You said "You didn't lose the files, you just basically told the system to quit displaying them". That's what's wrong with your answer. The files have been deleted. They are lost. Some tools may be able to recover some of the files (partially or fully) in some circumstances. Please see r/you'rewrongbutpedanticallyinsistingyou'renot. – cas May 19 at 9:42
  • 1
    OK, both of you please take a step back. Shōgun8 don't SHOUT and instead listen to what people are telling you. Assuming someone's level of knowledge is not polite (and happens to be ludicrously wrong in this particular case). @Cas, ditto, there's no call to accuse the Shōgun8 of general ignorance. Just make your point and walk away. – terdon May 19 at 9:53
  • Well I admit I was somewhat wrong for ext3 or ext4, and that is probably what we are talking about here. Looks like the inodes are effectively 0'd out, but the files do still exist; it is just harder to find where they begin and where they end and what the size fo the files are. But they are still there. – Shōgun8 May 19 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.