Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
OK, OK, I was doing something a little too quickly....
Do you ever get that feeling when the blood just drains out of your face? Yep. That one.
Here's what happened.
I'm working in a heterogeneous Windows/Linux networked environment. I've had a linux server with Samba loaded on it for quite a while, everything up and running fine, RH 8.0.
Today, I wanted to backup some critical directories onto one of the W2K boxes, the sysadmin gave me a spot, I got hooked up to the shares with smbmount,
setup on /mnt/halbackup.
I started working with cpio, to copy the major user directories over to the W2K box, which worked fine. Logged in as root, got everything over there OK.
Well, I figured I ought to copy /etc over there as well, issuing the following command:
OK, it worked. I had everything backed up on the W2K box. I was setting up a script to handle this automatically, so I could do it all at one shot (user directories, and /etc).
So, I switched directories over to /mnt/halbackup/etc (I made sure I was in the backup location on the W2K box), and did and rm, a big one. I figured I would clear it out, and then re-run the script, recopying /etc back to the W2K box, and all the backups run over there would have my /etc nice and cozy on their global backup.
And then it happened. I tried to cd to /etc, and there was no such directory. I tried to su, and there was no root user.
I think that little -dereference flag to the cpio command somehow got me back to nuking the original /etc directory on my linux box!
Can somebody help me? My machine is still alive, but I'm afraid to touch it, can't reboot it, can't login......help!!!!!
Thanks for your reply. I think I've got a bit of a chicken and egg problem. I don't have the permissions to copy into /etc (or create /etc), because there is no /etc/passwd.
Is it possible to boot from the system CD, recover a vanilla /etc, and setup a new root? I don't want to touch the rest of the disk, just get /etc back, with a root that will help me clean up the mess I've made.
Mounting /proc filesystem
Creating block devices
Creating root device
Mounting root filesystem
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Freeing unused kernel memory: 212k freed
INIT: version 2.84 booting
INIT: No inittab file found
INIT: can't open (/etc/ioctl.save, O_WRONLY): No such file or director
I think you need to boot with a system that can work on it's own eg Knoppix, or any other live distribution. There are some for floppys to. Check if they have support for your filesystems otherwise there's no much use of 'em
Unfortunately, I don't have access to Knoppix. I was hoping to be able to boot off the linux boot floppy, get in with root, and be able to create and populate /etc from the boot floppy.
The problem is, I think it's looking for /etc on the hard drive in order to boot completely. Chickens and eggs chasing one another around....
Anybody know how I can get this to boot from the floppy, and recover /etc?
(RH 8.0). If not, is it possible to do the same thing if I had the system CDs?
welp, i don't know, but i think i'm takin a stab in the dark, but --
do you happen to have a linux cd that's bootable?
or the recovery floppy that you can make during install??
I actually have a recovery cd that i got somewhere that has helped me out before... but usually if i hose my installation, i just blow the thing away and start over.. then copy all my other junk on there.... lol
hmm.. the more i think about it tho, i think that both of those just "boot" the machine and then turn it over to the hard drive..
damn -- i'll check into that when i get to the house..
I would really appreciate any help. I brought the wounded machine home with me to my home network, where I have another working Linux machine (6.2), that I can hook it up to if that will help. I also have the boot CDs for 8.0 that the machine was originally built with.
I just don't know how I'm going to get at the drive when there's no passwd file to validate permissions, etc.
Any help would be greatly appreciated. I have a bunch of really important stuff on this drive, that at a minimum, I need to find some way to get off of there. If I have to rebuild the box after that, well, that's the price of blowing your foot off.
I need to get that other data off of there though.
AFAIK, when you log in as root from a recovery disk, you completely blow by Linux's security measures. You can do anything you want to the box. At least, I can mount my Debian partitions and do whatever the hell I want to them from Slack. And vice versa - I switched my entire /tmp and /var partitions around in Slack from Debian. Dealing with /etc or /home should be no more difficult.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.