Slackware This Forum is for the discussion of Slackware Linux.
|
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
07-07-2007, 01:38 AM
|
#1
|
Member
Registered: Jul 2007
Location: Bucharest, Romania
Distribution: Ubuntu 7.04, Slackware 12
Posts: 87
Rep:
|
Am i done for? Deleted /etc by mistake
Yeah... i know.
I was untaring some app to my /root/stuff directory and it created an /etc dir in there. I couldn't get the thing installed so i wanted to delete that /etc directory. I was in my /root/stuff directory and, like a total idiot, i typed "rm -rf /etc/" instead of "rm -rf /root/stuff/etc".
Now etc is gone obviously.
Is there something i can do to restore it or and i done for and must install slack again from scratch?
|
|
|
07-07-2007, 02:16 AM
|
#2
|
Member
Registered: Oct 2005
Location: Sweden
Distribution: lackware and alpine
Posts: 135
Rep:
|
If you have access to a slackware mirror or the CDs/DVD you could always just grep through /var/log/packages/* for files that belongs to /etc and do some hard work with explodepkg to get your hands on the default files for /etc, and thus avoiding a complete reinstall.
And once you've got it fixed you should tell crond to take a daily backup of /etc ;-)
|
|
|
07-07-2007, 02:37 AM
|
#3
|
Member
Registered: Jul 2007
Location: Bucharest, Romania
Distribution: Ubuntu 7.04, Slackware 12
Posts: 87
Original Poster
Rep:
|
I'm searching for an ext3 data recovery software. Recovered a 200gb NTFS partition witch broke today using a ntfs recovery tool so it shouldn't be that hard to recover the /etc deleted dir...
Last edited by AriciU; 07-07-2007 at 02:39 AM.
|
|
|
07-07-2007, 02:53 AM
|
#4
|
Slackware Contributor
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,560
|
As e5150 stated, definitely start making a regular backup of /etc (and probably /home and /var, and perhaps others, depending on the usage pattern of the box).
That being said, yeah, you're probably hosed. Among other things, the /etc directory contains the startup scripts, the password database, and various other things that are required for proper system function. You *might* be able to recover the original files, but unless it's information that you simply cannot recreate given a bit of time in a new installation, it's probably not worth the time/effort required. e5150's suggestion to explode the packages containing /etc content is a decent one, though, as most of the files aren't modified much from the default in typical usage (that of course depends on how "typical" is defined and what *your* specific usage is). If you elect to go that route, you'll at a minimum have to recreate any user accounts and custom groups, as well as reset the password for root.
If it helps any (and it probably won't) :-) you're not alone on this journey - I've walked that road not once, but twice, in my days on linux...
|
|
|
07-07-2007, 03:06 AM
|
#5
|
Member
Registered: Jul 2007
Distribution: Slackware
Posts: 235
Rep:
|
Instead of exploding the package, you can just run a "upgradepkg --reinstall" with the "etc" package, I'm not sure upgradepkg needs /etc at all.
Then, as explained above, you will need to recreate users, groups, password, but that's less work than a full reinstall.
If you already shut down your system, you still can boot on the Slack CD, copy the "etc" package on your disk, then chroot and run the "upgradepkg" command.
|
|
|
07-07-2007, 03:21 AM
|
#6
|
Member
Registered: Jul 2007
Location: Bucharest, Romania
Distribution: Ubuntu 7.04, Slackware 12
Posts: 87
Original Poster
Rep:
|
Meh, i'm fux0red
Quote:
Q: How can I recover (undelete) deleted files from my ext3 partition?
Actually, you can't! This is what one of the developers, Andreas Dilger, said about it:
In order to ensure that ext3 can safely resume an unlink after a crash, it actually zeros out the block pointers in the inode, whereas
ext2 just marks these blocks as unused in the block bitmaps and marks the inode as "deleted" and leaves the block pointers alone.
|
Should've just set the damn partition to ext2 in the first place... would've recovered everything like a charm.
Anyway, slack was only installed a few hours ago. All i had on it was ntfs-3g, conky and some other smaller stuff.
Any of these linked to /etc ?
I'll copy the /etc dir from the slack dvd and see what happens...
EDIT: where can i find the etc package on the slack dvd?
Last edited by AriciU; 07-07-2007 at 03:24 AM.
|
|
|
07-07-2007, 03:25 AM
|
#7
|
Member
Registered: Jul 2007
Distribution: Slackware
Posts: 235
Rep:
|
I think reinstalling the "etc" package" is better than copying the /etc from the CD. There are probably a lot of things missing in the Cd's /etc.
In any case, I think there are many other packages you'll need to reinstall, as some set their own /etc conf files.
|
|
|
07-07-2007, 03:39 AM
|
#8
|
Member
Registered: Jul 2007
Location: Bucharest, Romania
Distribution: Ubuntu 7.04, Slackware 12
Posts: 87
Original Poster
Rep:
|
I can't copy it anyway. I can't mount the slack partition used by booting the DVD because i can't edit /etc/fstab to set it's mount point and stuff like that.
How would i go about reinstalling /etc ?
Would it just be better to reinstall the whole damn thing (slack 12) all together and forget about it?
|
|
|
07-07-2007, 05:35 AM
|
#9
|
Member
Registered: Jul 2007
Location: Bucharest, Romania
Distribution: Ubuntu 7.04, Slackware 12
Posts: 87
Original Poster
Rep:
|
Reinstalled everything and running normal again. Next is a "rm -rf *" to make it perfect
|
|
|
07-07-2007, 06:04 AM
|
#10
|
Member
Registered: Jul 2007
Distribution: Slackware
Posts: 235
Rep:
|
For the record, you don't need fstab to mount a partition : just run "mount -t <fs_type> <device> <mount point>" works.
Anyway, reinstalling everything is often faster when you don't have too personnalized a system.
|
|
|
07-07-2007, 07:07 AM
|
#11
|
Member
Registered: Jun 2005
Location: The Pudding Isles
Distribution: Slackware
Posts: 573
Rep:
|
Oops, answered wrong question.
Last edited by Eternal_Newbie; 07-07-2007 at 07:08 AM.
Reason: Answered wrong post, irrelevent here
|
|
|
All times are GMT -5. The time now is 04:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|