LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 08-16-2008, 05:45 AM   #1
NMY
Member
 
Registered: Aug 2008
Posts: 34

Rep: Reputation: 15
OMG I'm screwed. My OS is messed up and doesn't work anymore


I thing I logged su user and did
Quote:
mv /*/*/ $pwd
$pwd was 1 folder...
I didnt think that it would be /root
I needed $pwd/*/* something like this

is thre any help to get it back? I'm on live CD atm.

Kuduntu 8.04.1 KDE 4.1

help help help

- thank you -

Last edited by NMY; 08-16-2008 at 05:59 AM.
 
Old 08-16-2008, 06:25 AM   #2
NMY
Member
 
Registered: Aug 2008
Posts: 34

Original Poster
Rep: Reputation: 15
Please It's Urgent !!!!!!!!!!!!!!!1
 
Old 08-16-2008, 06:32 AM   #3
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Hi.

what was the command supposed to do? Move something to the present working directory, is my guess, but what? everything or only the lowest directory?

I wonder if you could provide some info on your install.

What was the $PWD?

Can you tell me, what is the installed OS(on the HD)?

Did you do it while running the live cd, or is that a fall-back boot?

you could recover the moved files,

either

by date stamp, using ls or du commands (look these up, with man or --help) and even konqueror from a gui.

or If you're prepared to wait, a recovery application, like testdisk and photorec, all you need is a free partition of equal size to the partition being recovered. (this could take a while, depending on the size of the disk and speed of hardware etc.)


I hope this gives you something to work on,

regards, Glenn

Last edited by GlennsPref; 08-16-2008 at 06:36 AM. Reason: gramma
 
Old 08-16-2008, 06:33 AM   #4
GazL
Senior Member
 
Registered: May 2008
Posts: 4,081
Blog Entries: 1

Rep: Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526
Ouch!.. that's a nasty one.

mv /*/*/ $pwd will have moved every second-level directory to one big dumping ground $pwd.
Even ignoring any name collisions (/usr/lib/ , /var/lib/ & /opt/lib will have all been dumped to $pwd/lib and intermixed as an example) you're looking at a pretty big mess and it'll be next to impossible to sort it out.

I'm afraid you're most likely looking at a reinstall/restore from backup.

Last edited by GazL; 08-16-2008 at 06:35 AM.
 
Old 08-16-2008, 06:49 AM   #5
NMY
Member
 
Registered: Aug 2008
Posts: 34

Original Poster
Rep: Reputation: 15
thanks... if only i would do $pwd/*/*/
 
Old 08-16-2008, 06:56 AM   #6
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
lol!

Sorry, I know this is serious, and I wish it could be easily reversed too.

any other info?

Glenn

<edit>
A lesson can be learned from this. Always set up a /home dir on itial(first) install.
That way you can do an easy clean install without having to format the partition that has /home on it.

During installing mandriva, the installer will want to format /root and /usr as a bare minimum.

I have separate partitions for others too, like /var, /var/ftp, /var/www, /boot, /local (local storage) etcetera, because I install and re-install fairly regularly, but not as much as I used too.

Anyhow, I hope you sort it out.

Cheers, Glenn

Last edited by GlennsPref; 08-16-2008 at 07:05 AM. Reason: <edit>
 
Old 08-16-2008, 07:34 AM   #7
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Rep: Reputation: 30
I'm looking at that command I still don't understand how it does what it did.

I don't feel so bad for carefully combing over every detail of tape backing up before executing any actual commands now.

/*/*/ means every second level directory... oh yeah, I see now.

Last edited by davidstvz; 08-16-2008 at 07:36 AM.
 
Old 08-16-2008, 07:38 AM   #8
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,078

Rep: Reputation: 195Reputation: 195
Ouch. Sounds like you're screwed as far as recovering the mess you've created to a working system is concerned. Assuming you are not willing to simply loose all your files I think your best bet is to get hold of a suitably large external harddisk, copy everything on to that, re-install your system then try and go through the files on the external harddisk and find anything you want to keep. Or get a new harddisk, swap it for you current one, install on that and put your current harddisk in an external case so you can look at the files on it.

What was that command supposed to do anyway? What was $pwd supposed to represent? Current working directory is $PWD but I've never seen that used in a mv or cp command because . does the same thing and is much quicker to type.
 
Old 08-16-2008, 08:25 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by NMY View Post
Please It's Urgent !!!!!!!!!!!!!!!1
Apparently not urgent enough to respond to everyone's questions.......

Note that the first post says he is on live CD---that means the files and folders in question may have been just in RAM.
 
Old 08-16-2008, 08:36 AM   #10
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 469Reputation: 469Reputation: 469Reputation: 469Reputation: 469
Quote:
Originally Posted by pixellany View Post
Note that the first post says he is on live CD---that means the files and folders in question may have been just in RAM.
I read that as "since I borked my system I loaded a live CD so I could get to the net and ask for help"
 
Old 08-16-2008, 08:36 AM   #11
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptop: Debian Jessie, NAS: OpenMediaVault
Posts: 1,302

Rep: Reputation: 56
Quote:
Originally Posted by pixellany View Post
Apparently not urgent enough to respond to everyone's questions.......

Note that the first post says he is on live CD---that means the files and folders in question may have been just in RAM.
I think he means he's getting here by a Live CD...

IGF
 
Old 08-16-2008, 10:04 AM   #12
GazL
Senior Member
 
Registered: May 2008
Posts: 4,081
Blog Entries: 1

Rep: Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526Reputation: 1526
Quote:
Originally Posted by IndyGunFreak View Post
I think he means he's getting here by a Live CD...

IGF
That's the way I took it too.
 
Old 08-16-2008, 10:11 AM   #13
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Yep, it looks like a real mess.

Testdisks photorec can recover it though.

Maybe it was urgent because of battery power,
 
Old 08-16-2008, 11:08 AM   #14
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptop: Debian Jessie, NAS: OpenMediaVault
Posts: 1,302

Rep: Reputation: 56
I'm curious, why did you run this command? I'm not sure if /home on a separate partition is the answer(although good advice). I've never ever put home on a separate partition, and have never had a problem. I think the more important thing here is, when you run terminal commands that you know are going to be moving directories, changing their permissions or structure, etc.. make ABSOLUTE SURE, you're running the command right.

IGF

Last edited by IndyGunFreak; 08-16-2008 at 11:10 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
screwed up adding to $PATH--cmds don't work 7stud Linux - Newbie 4 07-07-2007 07:14 PM
screwed up apache and now server won't work fidlet Linux - Software 3 08-10-2004 06:42 AM
Newbie screwed up and can't log as root anymore chumley115 Linux - Software 3 03-12-2004 03:20 PM
HELP!!, Can't login anymore because I screwed up network config ern_day Linux - Newbie 5 07-14-2003 02:16 AM
OMG! OMG! i did it!!!!! happy new year baby chingasman Linux - Distributions 2 01-03-2003 09:52 AM


All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration