LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-01-2005, 08:04 PM   #1
Thanotos
Member
 
Registered: Oct 2005
Location: Nanaimo, BC. ~CANADA~
Posts: 70

Rep: Reputation: 15
Deleted the wrong folders


Hi,

I am a newb to Linux/Slackware and to prove so I deleted two rather important folders.

In a complete newb fashion I dove head first into "the unknown".

While I was 'playing' around with installing programs I inadvertanly decided that since a program was not going in properly I would delete it.

Now I was NOT logged in as root, however I was using root terminal (same thing I guess huh ). Anyway logged in as thanotos, and under 'my desktop' I was in a folder I created called downloads.

Inside 'downloads' there were two folders created when I un-tar'd the program: /usr and /opt.

I tried to delete those, or thought that I did, resulting some how in NOT touching the ones in the 'download' folder but the folders of equal name under ROOT.

So, now I cannot load any XWindow aps, BASH apps or any other programs associated within /usr and /opt folders.

My question now is: Is it possible to copy the /usr and /opt folder from the Slackware 10.2 into ROOT (and how)? Or would it be easier to just reinstall?

I am dual booting Slackware 10.2, Linux 2.4.31 Kernel with Windows XP on a seperate HDD.

Appreciating any suggestions or comments that come across and am not afraid to learn, unfortunately sometimes I learn too slow.
 
Old 11-01-2005, 08:10 PM   #2
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
You actually might be able to recover, but re-installing would probably be easiest.

In the future, what you probably untarred was a slackpack, a file that ends in .tgz This type of file is meant to just be installed on slackware with:
installpkg filename.tgz

Just an fyi

Good luck on the re-install. If you create a backup, after the re-install you could just copy over the directories from your backup and be nearly back to where you were before the 'goof'.

Cool
 
Old 11-01-2005, 09:27 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,966
Blog Entries: 11

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865
If your /usr and /opt didn't contain too many custom things a
recovery should be quite easy ...
You obviously are able to boot the box. Insert the 1st CD-ROM,
mount it, and do
cd /
tar xzf /mnt/cdrom/slackware/a/pkgtools*tgz
Then a
upgradepkg --reinstall /mnt/cdrom/*/*tgz
and the same procedure with the second CD.


Cheers,
Tink
 
Old 11-02-2005, 11:16 AM   #4
Thanotos
Member
 
Registered: Oct 2005
Location: Nanaimo, BC. ~CANADA~
Posts: 70

Original Poster
Rep: Reputation: 15
Tinkster,

Appreciate the info.

Will give it a try and either way post with the results.

Thanks again
 
Old 11-02-2005, 12:13 PM   #5
NGene
Member
 
Registered: Mar 2001
Location: Turku, Finland
Distribution: Ubuntu
Posts: 66

Rep: Reputation: 15
Re: Deleted the wrong folders

Quote:
Originally posted by Thanotos
Inside 'downloads' there were two folders created when I un-tar'd the program: /usr and /opt.

I tried to delete those, or thought that I did, resulting some how in NOT touching the ones in the 'download' folder but the folders of equal name under ROOT.
That very same thing happened to me when I was a very fresh newbie and had installed my very first distro for the very first time... which happened to be Slackware, too!

Sorry, I don't have any additional help, because people already gave you some excellent advice. I just had to comment...
 
Old 11-06-2005, 09:21 PM   #6
Thanotos
Member
 
Registered: Oct 2005
Location: Nanaimo, BC. ~CANADA~
Posts: 70

Original Poster
Rep: Reputation: 15
thanks to everyone - the update of the situtation is:

re-install

there were incomplete errors when trying to recover....

again thanks for the info........(note: always be sure not to be root when deleting)
 
Old 11-07-2005, 02:18 AM   #7
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,604

Rep: Reputation: 47
This seems to be a bit of a linux thing:
that there is no undelete seem to confuse new users

How come libtrash is very rarely mentioned?
http://pages.stern.nyu.edu/~marriaga/software/libtrash/

Just did a LQ search (for last year) and there was only 1 hit
http://www.linuxquestions.org/questi...light=libtrash

I have never used libtrash...
 
Old 11-07-2005, 06:49 AM   #8
Thanotos
Member
 
Registered: Oct 2005
Location: Nanaimo, BC. ~CANADA~
Posts: 70

Original Poster
Rep: Reputation: 15
Emmanuel_uk

Good investigation.

Seems to be a rather 'worthy' app to look into so I don't repeat similar mistakes.

"Fool me once, shame on you. Fool me twice, shame on me."

Quote:
the shared library which, when preloaded, implements a trash can under GNU/Linux. Through the interception of function calls which might lead to accidental data loss libtrash effectively ensures that your data remains protected from your own mistakes.
So, if I was to preload libtrash I would just put a link in /etc/rc.d/rc.local?
As well is any one aware wether it will work with the reiserfs file system
 
Old 11-07-2005, 07:30 AM   #9
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,604

Rep: Reputation: 47
No idea about resierfs

Ext2 has a howto
http://www.ibiblio.org/pub/Linux/doc...2fs-Undeletion

Ext3, well, does not support the recovery tricks from ext2, AFAIK
See "Trying to recover files with ext3 filesystem"
http://www.linuxquestions.org/questi...52#post1940552

Another good point for newbee it to look at immutable file option +i
(man chattr and lsattr )

rc.local might be ok
Lifted frm the doc (maybe not latest version)

<<
To activate libtrash:

5 - So that calls to unlink() are intercepted, you must "preload" this
library. This is done by running the following command whenever you log in:

export LD_PRELOAD=path_of_symlink_to_libtrash

where path_of_symlink_to_libtrash should be substituted with the real path
to that symbolic link (if you didn't modify the INSTLIBDIR variable in the
Makefile, that would be "/usr/local/lib/libtrash.so.0"). This can be
achieved in a painless way by appending that line to a file which gets
executed whenever you log in, such as ~/.profile or ~/.bash_login. If you
wish to activate libtrash for every user on the system, append that line to
/etc/profile instead.
>>

Last edited by Emmanuel_uk; 11-08-2005 at 01:38 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleted the wrong folders Thanotos Slackware 3 11-02-2005 09:48 AM
Folders unable to be deleted? Waerner Linux - Newbie 7 05-27-2005 06:59 PM
deleted linux partition adn the boot loader was deleted also,now i have only gnu grub boris199 Linux - Laptop and Netbook 2 01-29-2005 04:53 PM
retriving deleted files and folders nayabingi Linux - General 2 09-27-2004 10:26 AM
Up %$## creek, deleted wrong files. Passive Linux - Software 2 07-21-2004 02:54 PM


All times are GMT -5. The time now is 09:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration