Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    166
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ThaMATRiX

    ThaMATRiX Well-Known Member

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

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. ThaMATRiX

    ThaMATRiX Well-Known Member

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

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    Location:
    ON, Canada
    There is but I don't remember how at the moment.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    4
    Trophy Points:
    343
    Location:
    ON, Canada
    grep is what you want
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. SarcNBit

    SarcNBit Well-Known Member

    Joined:
    Oct 14, 2003
    Messages:
    1,010
    Likes Received:
    3
    Trophy Points:
    168
    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:
    166
    Location:
    Chicago
    does anyone have the needed commands to remove /home2 and add /backups in its place? Thanks.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. challii

    challii Well-Known Member

    Joined:
    Feb 3, 2004
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    156
    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:
    151
    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.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice