LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 04: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 04:59 AM.
 
Old 08-16-2008, 05:25 AM   #2
NMY
Member
 
Registered: Aug 2008
Posts: 34

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

Rep: Reputation: 283Reputation: 283Reputation: 283
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 05:36 AM. Reason: gramma
 
Old 08-16-2008, 05:33 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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 05:35 AM.
 
Old 08-16-2008, 05: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, 05:56 AM   #6
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
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 06:05 AM. Reason: <edit>
 
Old 08-16-2008, 06:34 AM   #7
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Rep: Reputation: 31
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 06:36 AM.
 
Old 08-16-2008, 06:38 AM   #8
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
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, 07:25 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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, 07:36 AM   #10
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
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, 07:36 AM   #11
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
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, 09:04 AM   #12
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
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, 09:11 AM   #13
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
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, 10:08 AM   #14
IndyGunFreak
Senior Member
 
Registered: Aug 2003
Location: Indpls
Distribution: Laptops: Debian Jessie XFCE, NAS: OpenMediaVault 3.0
Posts: 1,355

Rep: Reputation: 70
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 10:10 AM.
 
  


Reply



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 06:14 PM
screwed up apache and now server won't work fidlet Linux - Software 3 08-10-2004 05:42 AM
Newbie screwed up and can't log as root anymore chumley115 Linux - Software 3 03-12-2004 02:20 PM
HELP!!, Can't login anymore because I screwed up network config ern_day Linux - Newbie 5 07-14-2003 01:16 AM
OMG! OMG! i did it!!!!! happy new year baby chingasman Linux - Distributions 2 01-03-2003 08:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:05 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
Open Source Consulting | Domain Registration