SimplerCloud Pte Ltd

×
×

How to make use of data-disk for DirectAdmin?

For DirectAdmin, the best way is to mount the data-disk as /home instead of /data. It's best to do this during initial configuration before you put any sites on it. If you are already running some live sites on the servelet, please schedule a time during off-peak hour to do this due to the downtime involved. When you have already sites and data running, the process will take longer.

This is how you can do it:

1. Firstly, ensure that you have your data-disk mounted as /data, which is the default settings. If the data-disk is not mounted yet, please mount it as /data. If the data-disk is mounted as different folder name, then adjust below commands accordingly. Use df to verify:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_sccentos6464b14-lv_root
                      7.5G  3.3G  3.9G  47% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/vda1             485M  135M  325M  30% /boot
/dev/vdb1              89G  185M   84G   1% /data

The data-disk device is (normally) /dev/vdb1 and based on df result above, you can see that it's mounted as /data, which is the default.

2. Stop the DirectAdmin service.

- For DirectAdmin running on CentOS 7 (newer template):

systemctl stop directadmin.service

- For DirectAdmin running on CentOS 6 (older template):

/etc/init.d/directadmin stop

3. Go to /home folder.

cd /home

4. On default DirectAdmin template setup, you will see 3 folders there: admin, ftp and tmp. Move all the three folders on /home to /data folder.

mv * /data

5. Once the folders have been moved, un-mount /data.

umount /data

6. Open /etc/fstab using your favourite text editor, e.g. nano or vi

nano /etc/fstab

or

vi /etc/fstab

7. On the last line of /etc/fstab, you will see something like this:

UUID=b17605c2-5939-4590-9261-4db4e23e30b8 /data ext4 defaults 1 2

Change "data" to "home" so it will become like this:

UUID=b17605c2-5939-4590-9261-4db4e23e30b8 /home ext4 defaults 1 2

Save the file.

8. Mount back the data-disk.

mount -a

9. Use df to verify that the data-disk is now mounted as /home.

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_sccentos6464b14-lv_root
                      7.5G  3.3G  3.9G  47% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/vda1             485M  135M  325M  30% /boot
/dev/vdb1              89G  185M   84G   1% /home

10. Go to /home folder and verify if you can see all the 3 folders (admin, ftp, tmp) as well as an existing folder on data-disk (lost+found).

[root@directadmin home]# ls -la
total 36
drwxr-xr-x   6 root  root   4096 Jul 30 11:54 .
dr-xr-xr-x. 26 root  root   4096 Jul 30 11:44 ..
drwx--x--x.  7 admin admin  4096 Jul 30 11:52 admin
drwxr-xr-x.  2 root  root   4096 Aug 23  2012 ftp
drwx------   2 root  root  16384 Jul 29 13:18 lost+found
drwxrwxrwt.  2 root  root   4096 Jul 30 00:10 tmp

11. Restart DirectAdmin service

- For DirectAdmin running on CentOS 7 (newer template):

systemctl start directadmin.service

- For DirectAdmin running on CentOS 6 (older template):

/etc/init.d/directadmin start

That's it!

Was this article helpful?
Dislike0 Like0
Views: 1632