LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   strange problem, Duplicate /Home dir (http://www.linuxquestions.org/questions/linux-newbie-8/strange-problem-duplicate-home-dir-931117/)

slimsz 02-24-2012 04:05 PM

strange problem, Duplicate /Home dir
 
Hello

i have server running CentOS with cpanel
and recently i installed a backup script to backup account
and the script back's up the account in /home dir
but i noticed that there are no backups created because there are 2 home dir

Code:

root@server [/]# ls -al
total 493K
drwx--x--x  12 root root 4.0K Feb 24 22:56 home
drwx--x--x  3 root root 4.0K Feb  7 20:59 home

and i dont know how to fix this , its not different name so i delete it .

and when i do #cd to the home dir this is what i get

Code:

root@server [/home]# ls -al
total 344K
drwx--x--x 12 root  root  4.0K Feb 24 22:56 .
drwxr-xr-x 24 root  root  4.0K Feb 24 15:26 ..
-rwxr--r--  1 root  root  8.0K Feb 24 16:46 aquota.user
drwxr-xr-x  5 root  root  4.0K Sep 24 13:27 .cpan
drwxr-xr-x  3 root  root  4.0K Feb 24 00:40 .cpanm
drwx------  4 root  root  4.0K Feb 24 00:40 .cpcpan
drwx------  4 root  root  4.0K Feb  8 02:37 cpeasyapache
drwx------  2 root  root    16K Feb  5 23:04 lost+found
lrwxrwxrwx  1 root  root    15 Feb  7 21:00 onmymood -> /home /onmymood

note that onmymood is an account on server (the only one) and in the home dir its showing as symlink , not actual dir !!!


do you guys know what this might be and how can i solve it

additional info: server uses Software RAID, if that helps .

thank you

suicidaleggroll 02-24-2012 04:14 PM

Looks like one of your home directories has a space appended to the name, ie "home" vs "home ". In "home" there's a simlink called onmymood which points to "home /onmymood" (the "home " with the space). I'm not sure why the system is set up like this, who did the install? It should be easy enough to merge the two folders and just keep the regular one (without the space).

slimsz 02-24-2012 04:54 PM

we got the server from datacenter partitioned
and then we installed cpanel and other required softwares

we dont know who caused this

but can you tell me how to merge them

thx

suicidaleggroll 02-24-2012 05:00 PM

First I would call up the people who set up the system and make sure that there's not some special reason they did it that way.

For example, I noticed a "lost+found" directory in /home/. This is typically found in the highest level of a separate filesystem, implying that "/home/" actually lives on a separate disc on your system than everything else (including "/home /"). What is the output of "df -h"?

slimsz 02-24-2012 05:29 PM

here is the output of df command

Code:

root@server [~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3            1016G  623G  342G  65% /
/dev/sda2            508M  47M  437M  10% /boot
/dev/sda5            1.7T  1.5G  1.6T  1% /home
/usr/tmpDSK          485M  200M  260M  44% /tmp
root@server [~]#

and the strange thing it shows that home is using only 1.5G

but look at the output of this command

Code:

root@server [/home/onmymood]# du -ch | grep total
615G    total


suicidaleggroll 02-24-2012 06:03 PM

Yes, because the onmymood in "/home/" is just a symlink pointing to "/home /onmymood" (the "/home /" with the space). So that 615G actually lives on "/home /", not "/home/", so it shows up under the usage for "/".

You now need to decide whether you want the 615GB being used by onmymood's home directory to be located on the 1TB /dev/sda3 partition (where it sits now), or the 1.7TB /dev/sda5 partition (with the rest of /home/). Same goes for anything else you have in /home/, do you want it on the 1TB /dev/sda3, or the 1.7TB /dev/sda5? Whether or not you merge your two "home" directories and where you put the result will depend on how you want your system to be configured when it's all said and done.

slimsz 02-24-2012 06:09 PM

so the "/home /" is a folder inside "/"
and "/home/" is the original home partition ?


so can we do something like
Code:

mv -R /home\/onmymood /home/onmymood
or this will mess up the things ?

suicidaleggroll 02-24-2012 06:14 PM

You're mostly right

"/home /" is a folder inside "/", which lives on /dev/sda3
"/home/" is the normal home folder, and it lives on its very own partition at /dev/sda5 (which is a separate 1.7TB partition on the same 3TB disc as /)

Code:

rm /home/onmymood
mv /home\ /onmymood /home/onmymood

Will move the 615GB onmymood folder from /dev/sda3 onto /dev/sda5 along with everything else that's in /home/. This might not be what you actually want though, that will leave you with a mostly empty 1TB "/", and a 35% full 1.7TB "/home/". Anything that points to the original location of onmymood at "/home /onmymood" will also break when you do this. You should also run an "ls -a /home\ /" to see if that's the only folder located in that directory.


All times are GMT -5. The time now is 02:05 AM.