Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Ok.. this was a silly mistake but I caught it quickly and stopped it before deleting my entire system. I was having hard drive issues and went into linux rescue mode to try and use fsck. I was following some instructions online in which I created a directory "rootpartition" and I was in the process of mounting my system under this dir. About half way through I remembered that my system was already mounted under "sysimage" so, insted of unmounting all of my partitons from "rootpartition" dir I proceeded to use "rm -rf" to remove the dir and realized within about 5 seconds that I was actually deleting my root partition. I then looked into "sysimage" to see what I deleted it appeared that the "rm -rf" command had only begun deleting files in "/etc" (so I think). When rebooting into linux rescue it could no longer find any linux partitions. As well, I tried reinstalling linux but it did not find any linux distros on my machine. When I use qtparted within the "system rescueCD" it does not recognize my harddrive. Is there anyway to rebuild the system without losing any data?
Is there anyway to rebuild the system without losing any data?
You mean any *more* data ;-p If you run a distro that can verify package contents (md5/sha1sum) and your package database is still complete then yes, you can selectively restore much of the system to a default state. Else you still can but that looks more like a reinstall. What distro do you run (fill in your user profile)?
What distro do you run (fill in your user profile)?
Thanks for the reply. I am currently running Redhat WS4 on this machine. Can this distro verify package contents? and if so How do I go about selectively restoring the system?
Can this distro verify package contents?
Yes. Try "rpm -Va --noscripts 2>&1 > /tmp/rpmva.log".
It may run for a while so either use "screen" or background it.
How do I go about selectively restoring the system?
We'll script that around the output in /tmp/rpmva.log. Best not post that file because it will be HUGE: upload it to a webspace we can browse to to get it. * If you really really can't (free webspace is easy to find) then bzip2 the file. If the bzipped result is LESS than 3000kB you're invited to attach it in an email to me.
You might be able to restore some stuff to it's default state using methods described above, but that's the kicker. "Restore to DEFAULT states." If you have made customizations, and certainly you have (think "/etc/password", etc.), most all of that will be under /etc and that's what you said you determined was wiped out. Unfortunately, /etc is basically your system's "identity" - i.e., what makes it different from every other Linux system out there. That's a bad thing to wipe out.
I'm afraid without backups to restore from, you're in for a large amount of major brain-bashing work that will ultimately end in failure. Maybe you got lucky and you only deleted one or two inconsequential files, but I sure wouldn't count on that. 5 seconds of "rm -rf /" doesn't sound like something that would only hit one or two files to me. I would expect hundreds if not thousands of files and directories to potentially be affected.
I would go for a complete reinstall and reconfiguration of the OS if I were you. And I'd tightly integrate a backup/restore plan into the new installation. It may be a bit late now, but before reinstalling, backup everything you still have left. You may be able to use some of this to reconfigure your OS after the reinstall.
i'm not really sure where to begin any of this. The current issue is that linux rescue does not find any linux partitions, nor does qtparted. When I put disc 1 of the isntallation in the drive it as well does not recognize any linux OS installed. After a few more steps I select to partition manually and I can see the different partitions as they were, but they contain no labels. I am unable to name them accordingly.
Other notes: When attempting to boot normally I get the following:
Uncompressing Linux.. OK, booting the kernel.
Red Hat nash version 22.214.171.124 starting
ata2: disabling port
Reading all physical volumes. This may take awhile...
Found volume goup "VolGroup00" using metadata type lvm2
8 logical volume(s) in volume group "VolGroup00" now active
INIT: version 2.85 booting
INIT: No inittab file found
My keyboard is not recognized so I cannot enter in a runlevel to continue. I just have to shutdown the machine.
The current issue is that linux rescue does not find any linux partitions
It appears I misread your OP where you already said the partitions aren't recognisable which is bad. Before giving in and going with haertig's reinstall advice, have a look at the directions given in the RHEL4 SAG Basic System Recovery because it also handles situations where partitions aren't automagically mounted. Start halfway down the page at "If you selected Skip, you can still try to mount a partition".