Topic: Accidentally moved system files! |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: f(x) |
posted 09-29-2007 02:17
I was in my server under root and did a simple move and forgot the dot before the forward slash. This gave me undesired results, very undesired results. Please look at the following: code: root@fusion [/home/smallcm/public_html]# ls -l total 16 drwxr-x--- 4 smallcm nobody 4096 Sep 28 18:51 ./ drwx--x--x 7 smallcm smallcm 4096 Sep 28 18:37 ../ drwxr-xr-x 2 smallcm smallcm 4096 Sep 28 18:23 cgi-bin/ drwxr-sr-x 9 27743 27744 4096 Jul 26 15:25 drupal-5.2/ root@fusion [/home/smallcm/public_html]# mv /drupal-5.2/* /* mv: cannot stat `/drupal-5.2/*': No such file or directory mv: cannot move `/lib' to `/var/lib': Directory not empty mv: cannot move `/proc' to `/var/proc': Device or resource busy mv: cannot move `/tmp' to `/var/tmp': Directory not empty root@fusion [/home/smallcm/public_html]# mv ./drupal-5.2/* ./* bash: /bin/mv: No such file or directory root@fusion [/home/smallcm/public_html]#
|
Paranoid (IV) Inmate From: f(x) |
posted 09-29-2007 04:06
Solved! (I believe...) code: root@fusion [/]# cd /var root@fusion [/var]# /var/bin/mv -t / bin boot dev etc home lib media mnt opt root sbin selinux srv sys tmp usr /var/bin/mv: cannot move `lib' to `/lib': Directory not empty /var/bin/mv: cannot move `tmp' to `/tmp': Directory not empty root@fusion [/var]#
code: root@fusion [/]# /var/bin/ls -l total 12 drwxr-xr-x 12 0 0 4096 Sep 20 09:43 lib dr-xr-xr-x 4100 0 0 0 Jun 7 04:34 proc drwxrwxrwt 5 0 0 4096 Sep 28 22:51 tmp drwxr-xr-x 37 0 0 4096 Sep 28 22:53 var code: root@fusion [/var]# /var/bin/ls -l total 172 lrwxrwxrwx 1 0 0 39 Sep 28 22:23 aquota.group -> /proc/vz/vzaquota/00000094/aquota.group lrwxrwxrwx 1 0 0 38 Sep 28 22:23 aquota.user -> /proc/vz/vzaquota/00000094/aquota.user drwxr-xr-x 2 0 0 4096 Sep 20 09:43 bin drwxr-xr-x 2 0 0 4096 Oct 10 2006 boot drwxr-xr-x 8 0 0 4096 Jun 7 04:48 cache drwx--x--x 42 0 0 4096 Sep 28 22:25 cpanel drwxr-xr-x 3 0 0 4096 May 30 07:14 db drwxr-xr-x 4 0 0 4096 Jun 7 05:10 dev drwxr-xr-x 3 0 0 4096 May 30 07:14 empty drwxr-xr-x 72 0 0 12288 Sep 28 22:28 etc drwxr-xr-x 2 0 0 4096 Oct 10 2006 games drwx--x--x 23 0 0 4096 Sep 28 22:23 home drwxr-xr-x 8 0 0 4096 Jun 7 04:50 installd drwxr-xr-x 13 0 0 4096 Jun 7 04:52 lib drwxr-xr-x 2 0 0 4096 Oct 10 2006 local drwxrwxr-x 3 0 54 4096 May 30 07:11 lock drwxr-xr-x 8 0 0 12288 Sep 29 01:24 log lrwxrwxrwx 1 0 0 10 May 30 07:11 mail -> spool/mail drwxr-xr-x 2 0 0 4096 Oct 10 2006 media drwxr-xr-x 2 0 0 4096 Oct 10 2006 mnt drwxr-xr-x 5 0 25 4096 Sep 28 22:23 named drwxr-xr-x 2 0 0 4096 Oct 10 2006 nis drwxr-xr-x 2 0 0 4096 Oct 10 2006 opt drwxr-xr-x 2 0 0 4096 Jul 6 17:25 perl drwx------ 2 0 0 4096 Jan 30 2002 portsentry drwxr-xr-x 2 0 0 4096 Oct 10 2006 preserve drwxr-x--- 11 0 0 4096 Sep 28 22:24 root drwxr-xr-x 16 0 0 4096 Sep 28 09:41 run drwxr-xr-x 2 0 0 4096 Sep 26 09:40 sbin drwxr-xr-x 5 0 0 20480 Sep 28 09:39 scripts drwxr-xr-x 2 0 0 4096 Oct 10 2006 selinux drwxr-xr-x 13 0 0 4096 Sep 12 09:40 spool drwxr-xr-x 2 0 0 4096 Oct 10 2006 srv drwxr-xr-x 2 0 0 4096 Oct 10 2006 sys drwxrwxrwt 2 0 0 4096 Sep 26 09:41 tmp drwxr-xr-x 16 0 0 4096 Jun 7 05:34 usr drwxr-xr-x 6 0 0 4096 May 30 07:14 www drwxr-xr-x 2 0 0 4096 Oct 10 2006 yp
code: root@fusion [/]# ls -l total 112 drwxr-xr-x 22 root root 4096 Sep 28 23:25 ./ drwxr-xr-x 22 root root 4096 Sep 28 23:25 ../ -rw-r--r-- 1 root root 0 Jun 7 00:34 .autofsck -rw-r--r-- 1 root root 0 May 30 10:00 .autorelabel drwx------ 2 root root 4096 Jun 7 00:44 .gnupg/ -rw------- 1 root root 1024 Jun 7 01:18 .rnd lrwxrwxrwx 1 root root 39 Sep 28 18:23 aquota.group -> /proc/vz/vzaquota/00000094/aquota.group lrwxrwxrwx 1 root root 38 Sep 28 18:23 aquota.user -> /proc/vz/vzaquota/00000094/aquota.user drwxr-xr-x 2 root root 4096 Sep 20 05:43 bin/ drwxr-xr-x 2 root root 4096 Oct 10 2006 boot/ drwxr-xr-x 4 root root 4096 Jun 7 01:10 dev/ drwxr-xr-x 72 root root 12288 Sep 28 23:25 etc/ drwx--x--x 23 root root 4096 Sep 28 18:23 home/ drwxr-xr-x 12 root root 4096 Sep 20 05:43 lib/ drwxr-xr-x 2 root root 4096 Oct 10 2006 media/ drwxr-xr-x 2 root root 4096 Oct 10 2006 mnt/ drwxr-xr-x 2 root root 4096 Oct 10 2006 opt/ dr-xr-xr-x 4089 root root 0 Jun 7 00:34 proc/ drwxr-x--- 11 root root 4096 Sep 28 23:02 root/ drwxr-xr-x 2 root root 4096 Sep 26 05:40 sbin/ drwxr-xr-x 5 root root 20480 Sep 28 05:39 scripts/ drwxr-xr-x 2 root root 4096 Oct 10 2006 selinux/ drwxr-xr-x 2 root root 4096 Oct 10 2006 srv/ drwxr-xr-x 2 root root 4096 Oct 10 2006 sys/ drwxrwxrwt 5 root root 4096 Sep 28 23:24 tmp/ drwxr-xr-x 16 root root 4096 Jun 7 01:34 usr/ drwxr-xr-x 22 root root 4096 Sep 28 23:25 var/ code: root@fusion [/var]# ls -l total 96 drwxr-xr-x 22 root root 4096 Sep 28 23:25 ./ drwxr-xr-x 22 root root 4096 Sep 28 23:25 ../ drwxr-xr-x 8 root root 4096 Jun 7 00:48 cache/ drwx--x--x 42 root root 4096 Sep 28 23:34 cpanel/ drwxr-xr-x 3 root root 4096 May 30 03:14 db/ drwxr-xr-x 3 root root 4096 May 30 03:14 empty/ drwxr-xr-x 2 root root 4096 Oct 10 2006 games/ drwxr-xr-x 8 root root 4096 Jun 7 00:50 installd/ drwxr-xr-x 13 root root 4096 Jun 7 00:52 lib/ drwxr-xr-x 2 root root 4096 Oct 10 2006 local/ drwxrwxr-x 3 root lock 4096 May 30 03:11 lock/ drwxr-xr-x 8 root root 12288 Sep 28 23:38 log/ lrwxrwxrwx 1 root root 10 May 30 03:11 mail -> spool/mail/ drwxr-xr-x 5 root named 4096 Sep 28 18:23 named/ drwxr-xr-x 2 root root 4096 Oct 10 2006 nis/ drwxr-xr-x 2 root root 4096 Jul 6 13:25 perl/ drwx------ 2 root root 4096 Jan 29 2002 portsentry/ drwxr-xr-x 2 root root 4096 Oct 10 2006 preserve/ drwxr-xr-x 16 root root 4096 Sep 28 05:41 run/ drwxr-xr-x 13 root root 4096 Sep 12 05:40 spool/ drwxrwxrwt 2 root root 4096 Sep 26 05:41 tmp/ drwxr-xr-x 6 root root 4096 May 30 03:14 www/ drwxr-xr-x 2 root root 4096 Oct 10 2006 yp/
|
Maniac (V) Mad Scientist with Finglongers From: Germany |
posted 09-29-2007 12:04
That's what you get by working as root! |