The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Partitions

Discussion in 'General Discussion' started by ThaMATRiX, Oct 14, 2004.

  1. ThaMATRiX

    ThaMATRiX Well-Known Member

    Joined:
    Feb 1, 2004
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Chicago
    Hi. I currently have two 120gb hard drives in my server, part of the first is at /home, and the whole second hard drive is at /home2

    If I transfer all the accounts from /home2 to /home , it makes a symlink on home2 to the home directory on /home

    If I delete all the symlinks, can I unmount it as /home2 and remount it as /backup for a backup drive?

    Will deleting the symlinks affect anything?
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Check your httpd.conf file for the path to the directories. If it says the accounts are in /home2/username, you will need to change all of those.
     
  3. ThaMATRiX

    ThaMATRiX Well-Known Member

    Joined:
    Feb 1, 2004
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Chicago
    What could I do to make something run through that file and change all /home2 to /home automatically?
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    For myself, I just download the file and use any real text editor to search and replace, then upload and restart apache.

    Make a backup copy first.

    I'm not positive if that's the only file that needs to be changed, but I think it is. I don't recall any other files actually recording the path to the directory.
     
  5. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Just remembered, the path is also in the /etc/proftpd/username files, so you will need to look and see if they also show home2. If so, just download all those files and search/replace "/home2/" with "/home/" in them and the httpd.conf file.
     
  6. ThaMATRiX

    ThaMATRiX Well-Known Member

    Joined:
    Feb 1, 2004
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Chicago
    Is there a command to look through all files for anything containing /home2
    ?
    Thanks.
     
  7. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    There is but I don't remember how at the moment.
     
  8. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    grep is what you want
     
  9. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    38
    man sed :)

    sed 's/home2/home/g' <filename>

    should do it for you.

    I would make a backup copy of whatever file you are going to process first ;)
     
  10. ThaMATRiX

    ThaMATRiX Well-Known Member

    Joined:
    Feb 1, 2004
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Chicago
    does anyone have the needed commands to remove /home2 and add /backups in its place? Thanks.
     
  11. challii

    challii Well-Known Member

    Joined:
    Feb 3, 2004
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    6
    things this will probably break:

    1) any users who have php includes in the form /home/username/www/filename.php
    2) horde / imap (last time we moved accounts from home2 to home it didnt update the /home/etc/passwd file with the new locations of various files

    Just thought i would point that out :)
     
  12. webhostexpert

    webhostexpert Member

    Joined:
    Jan 7, 2005
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Backup the accounts with symlinks on /home2
    mv backups to /home
    terminate the accounts
    rm remove the symlinks on /home2
    restore the backups in /home

    all set all the files should be changed for you.
     

Share This Page