New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
Reinstall and restore from backups and if you don't have backups, sucks to be you.
mv ../* /root/
Is this really fixable? I'd guess not and restore from backup is required.
SSH service is down, all commands are not recognized either.
I'll try to contact my provider first.
Is there anything else I can do?
Which folder did you run this command in?
Is that command even possible. Doesn't "/" refer to the root vps directory. I don't think there is anything beyond root directory.
translates to move everything in / to one directory back from $PWD, which will work.
https://unix.stackexchange.com/questions/17428/moved-bin-and-other-folders-how-to-get-them-back
If your ssh doesnt work and have no backups you've fucked up.
Next time create some backups and be fine, it's easy to automate this.
Does it mean the files can be restored?
What folder did you enter the command in?
If it is a VPS and if it does not have encrypted FS provider can help, if he wishes to.
Disk image can be mounted and accesed from outside, and if it is simfs/openvz it is even simplier.
Boot the vps in to sysrescue run testdisk or gparted find the data, backup what you need, restore.
If it is OpenVZ.. ask your host for help
If you really need the data and have no idea how to recover it and would rather wait until Wednesday than lose it give me a shout I will try and recover it for you.
As @AnthonySmith clarified, if this is OpenVZ, best to ask the host for help. The files aren't lost - they're just in the wrong place and so your VPS can't be used "directly". Most probably "vzctl enter" will also fail as it will not be able to find bash/sh in the VM in the correct location but that can easily be fixed by the host.
You should probably also tell your host WHERE you ran the command (assuming you remember, because relative to that folder is where the mv has moved the files).
For KVM it's easier and self-doable. Use any rescue disk (or live cd) and just mount your disk/root fs and rerun the mv to move things back to the correct location and you should be all set. Again, you'll need to know/find out where you ran the command to know the new location of all the files.
The original command probably failed at some point because of either the pseudo fs's or some other related errors - so you may well find that only some of the original / paths were moved.
Hope this helps and good luck.
If you really need the data you might be able to slide the host a tenner for the VPS image file.
Tenner? I was going to offer them a fiver and A FAKING SHOEY MATE
if your VPS provider has a recovery mode try that as a last resort, see if anything is still on the disk
If it's KVM, mount a recovery ISO and move everything back.
He used an absolute path for the source, but a relative path for the destination:
mv /* ../
So "move all root entries to the directory about me".
If you did...
...then this might recoverable but I'm guessing the parent directory is either above his root fs (does OvZ really allow this!?!? Isn't that a massive security hole?) or somewhere else inconvenient.
Also, @jarland I am amazed that this conversation with all of its slashes and paths is not CloudFlare'd.
@AnthonySmith
I'll try to solve this together with my hoster first, I'll definitely contact you if he can't solve this.
@raindog308
Unfortunately, the SSH is also down (together with the "bin" folder) and atm no serial console can be used. I guess the only way is I have to ask for a help to my host and yes it is OpenVZ.
Thanks guys for all your help.
Use fewer slashes/ slashes.
On a more serious note, using a file manager (e.g., mc) can help to prevent such mistakes.
yep, I can't help remotely if it is openvz sorry, but the good news is it should be incredibly simple for your host to recover.
...at least if his knowledge goes beyond installing WHMCS and SolusVM on a rented dedi.
It's not quite summer yet so hopefully it will be fine
Hopefully he is able to do that. He is a well known LET hoster here.
Hi,
@AnthonySmith
@raindog308
My host has put back all the files into a folder in /home/user/*
There are all files and folders, including bin, etc, opt, home folder etc.
They also put similar folder in "/" (root) directory so that my box is able to run again.
The question is, can I just move all the files in /home/user/* and overwrite all folders in the root folder ("/")?
Many thanks
I suggest you check using rsync with the "-n" option to see if anything is missing and only sync those as opposed to a blind mv.
Here's a rough rsync command (see man for more details/other options for your needs):
rsync -niavPHXASc /home/user/ / --exclude /home/user/ --exclude /dev --exclude /proc --exclude /sys
the
--delete
option may also be handy.The
c
option may be a bit heavy CPU wise and you may also benefit by using options like--no-time
and/or--numeric-ids
Also beware about files in /etc (like interfaces).
Playing around a bit with the rsync options will give you a very good idea if anything has changed and then you can decide what you want to do about it.
Hope this helps.
My recommendation would be:
("/")?
Take a backup before rsync because if any thing happen wrong all the things will mess up
Hi,
Will that rSync the file permission too?
I got weird result,
rsync: connection unexpectedly closed (201608 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
Some updates: