OMG I'm screwed. My OS is messed up and doesn't work anymore
Linux - NewbieThis 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
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.
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
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.
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>
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.