Results 1 to 7 of 7

Thread: Change /home directory to new Hard disk drive

  1. #1
    Join Date
    Oct 2007
    Posts
    3

    Change /home directory to new Hard disk drive

    Hello,

    Recently a new HDD with around 150Gb capacity was installed in one our server in addition to 66 gb hardisk which is almost full ,and the new hard disk is ready to be formatted and partitioned.

    How can you move /home directory to this new HDD?

    Below are the details.

    *********************************
    [root@localhost ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda3 66G 60G 2.9G 96% /
    /dev/sda1 99M 29M 66M 31% /boot
    none 1013M 0 1013M 0% /dev/shm
    /usr/tmpMnt 39M 15M 22M 41% /tmp
    /dev/sdb1 147G 93M 140G 1% /home2
    *********************************

    I need all the data from from "/"' (/dev/sda3 66G 60G 2.9G 96% /) to be moved to /home2 (/dev/sdb1 147G 93M 140G 1% /home2)

    Our requirement is that we need to move all the accounts under /home directory to /home 2. Will the old accounts be affected if we migrate from the /home to /home2 and also we need the new users to get added under the /home2. Will this be possible. Please help me out to get resolve this problem.

    Regards
    Raj

  2. #2
    Join Date
    Jul 2005
    Posts
    2,007
    Code:
    cp -rfp /home/* /home2
    rm -rf /home
    ln -s /home2 /home
    If you want you can also edit:

    /etc/default/useradd

    change the HOME= variable to HOME=/home2

  3. #3
    Join Date
    Nov 2006
    Location
    India
    Posts
    345

  4. #4
    Join Date
    Oct 2007
    Location
    Utrecht, The Netherlands
    Posts
    43
    Not very handy though!

    To do it the good way:

    Move all the files to the new disk, umount /home, and mount your new harddrive as /home.

    Then format and mount the other drive as you like

  5. #5
    Join Date
    May 2019
    Posts
    4

    Changing the DirectAdmin /home mount point

    Hi. I had a 2TB SATA RAID array and a 250GB ssd HDD which the centos is intalled on the SSD. I wanted to move the directadmin data to the SATA drive. So i did this (the home is mounted as default on : dev/mapper/centos-home):

    umount home
    mount dev/sdb1 /home

    But now the Apache shows 403 forbidden error when i want to login to directadmin or visit the hosted websites.

  6. #6
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,814
    Hello,

    Will it fix?

    Code:
    chmod 711 /home
    chown 0:0 /home
    /usr/local/directadmin/scripts/set_permissions.sh user_homes
    service httpd restart
    If it does not, then let us know what OS you run there. And what is written in apache error_log for a domain?
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  7. #7
    Join Date
    May 2019
    Posts
    4
    Quote Originally Posted by zEitEr View Post
    Hello,

    Will it fix?

    Code:
    chmod 711 /home
    chown 0:0 /home
    /usr/local/directadmin/scripts/set_permissions.sh user_homes
    service httpd restart
    If it does not, then let us know what OS you run there. And what is written in apache error_log for a domain?
    Thanks! That fixed the error.

Similar Threads

  1. Adding disk space to home directory on Centos
    By DA31387 in forum General Technical Discussion & Troubleshooting
    Replies: 6
    Last Post: 04-22-2013, 02:36 PM
  2. How can I find out the maximum disk space of my hard drive?
    By DA31387 in forum DirectAdmin General Discussion
    Replies: 8
    Last Post: 01-21-2012, 03:40 PM
  3. How to change the home directory where the partition?
    By XaYo in forum Admin-Level Difficulties
    Replies: 2
    Last Post: 11-16-2009, 08:38 PM
  4. Again, Add new drive and change home...
    By GlennH in forum General Technical Discussion & Troubleshooting
    Replies: 2
    Last Post: 07-06-2006, 08:09 AM
  5. 100% Hard drive space used?
    By lnguyen in forum Admin-Level Difficulties
    Replies: 7
    Last Post: 10-16-2004, 07:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •