Change /home directory to new Hard disk drive

activehari

New member
Joined
Oct 18, 2007
Messages
3
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
 

chatwizrd

Verified User
Joined
Jul 3, 2005
Messages
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
 

mimic

Verified User
Joined
Oct 5, 2007
Messages
43
Location
Utrecht, The Netherlands
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 :)
 

mehr1367

New member
Joined
May 16, 2019
Messages
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.
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
14,159
Location
GMT +7.00
Hello,

Will it fix?

Code:
chmod 711 [COLOR=#333333]/home
chown 0:0 [/COLOR][COLOR=#333333]/home
[/COLOR]/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?
 

mehr1367

New member
Joined
May 16, 2019
Messages
4
Hello,

Will it fix?

Code:
chmod 711 [COLOR=#333333]/home
chown 0:0 [/COLOR][COLOR=#333333]/home
[/COLOR]/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.
 
Top