0

In a subdir (/var/www/html/subdir) by error I run as root: mv /* .

It move ALL files under the working directory, commands as ls, mv, cat, not work, inclusive run by ./bin/ls. Keyboard and Mouse was not detected (I did work from ssh).

My OS is Centos 6.2 x86_64, I did restart and was unable boot, I tried with CD and rescue mode, but any linux partition was not found by the rescue.

The OS is installed in 3 DD SAS in RAID 0 (IBM Server).

Is possible rescue the information or the operating system?

ThiefMaster
  • 388
  • 1
  • 4
  • 19
Jose Nobile
  • 461
  • 1
  • 5
  • 14

4 Answers4

2

You can simply boot a rescue system and move back all those folders.

ThiefMaster
  • 388
  • 1
  • 4
  • 19
2

Rescuing the information is easy: It just got moved, not deleted. So you can boot from another medium (e.g. a liveCD) and you can access all the files. Possibly you already have an other copy in a up-to-date backup.

As for recovery, you have two options:

  1. Boot from something else (e.g. pen drive or liveCD) and try to manually move files back. This might work if they just got moved. If permissions got changed then things get interesting
  2. Reinstall the OS. Use your documentation to set the server up as it was originally done, then restore the data from backup.
Hennes
  • 4,842
  • 1
  • 19
  • 29
  • Is not easy, the live CD's or mount or many others options no detect any Linux Partitions. I don't know if the RAID 0 in 3 hard disk is related. – Jose Nobile Jul 26 '12 at 01:29
1

I was contacted by IBM support, and I can repair the RAID 0 (support by phone), I don't know why the RAID0 was damaged, but it failed after move the files.

The rescue mode for detect linux partitions do not work on LVM2 (not work for me).

I restore my system, following the next instructions:

lvm vgscan -v

Activate all volume groups:

lvm vgchange -a y

List logical volumes:

lvm lvs –all

With this information, and the volumes activated, you should be able to mount the volumes:

mount /dev/volumegroup/logicalvolume /mountpoint

next, I did move all files of my subdir to root (/), restart and all ok.

Source: http://jim-zimmerman.com/?p=587

Jose Nobile
  • 461
  • 1
  • 5
  • 14
0

What you just did is not moving everything under the working directory, but moving everything from the root directory somewhere else. I'm very much afraid you're done for if you want to reboot your system.

You can try to recover by moving everything, but I personally doubt this will fix everything. You're much safer with a clean install and restore from backup.

Normally it should find the partition, try a live disk like Ubuntu. Chances are you will be able to rescue some of the info.

However:

  • getting your info back shouldn't be a problem if you have proper backups
  • running a RAID 0 is asking for a disaster to happen
  • always think twice before you run something as root
Lucas Kauffman
  • 16,880
  • 9
  • 58
  • 93