Views: 1034 (Data available since 06.02.2017)

Attention! For operations, described in this lesson, *nix-systems administration knowledge is required. Prior to starting of operations, it is recommended to perform a full «Bitrix Virtual Appliance» backup.

Because the main volume of disk space is consumed by site content and their reserve copies, located in /home/bitrix, as well as by the database, located in /var/lib/mysql, these specific partitions should be placed at separate disks.

Let's review this task with an example, when a folder /home is transferred with site contents and their backup copies to a separate disk.

  • A new disk of required size should be added in the equipment list of the Virtual Appliance settings. All the actions, listed below, are needed to be performed under the root user administrator account:

  • After the disk was added, to initialize it, a server re-load can possibly be required. You can see the new disk and its assigned letter designation via this command:
    fdisk -l

  • Launch the fdisk utility for work with the /dev/sdb disk:
    fdisk /dev/sdb

    Create a new partition via the n command:

    • new (primary partition) - p command and Partition number (1-4): 1;
    • first and the last sectors should be selected by default - this way, a partition will be created, using all the free space on the disk:

  • To save changes on the disk and to exit from the fdisk, enter the w command.

  • After partition table are saved, format new partition and transfer information from /home to it:

    CentOS 6
    mkfs.ext4 /dev/sdb1 
    mount /dev/sdb1 /mnt 
    service httpd stop 
    service nginx stop
    mv -f /home/* /mnt 
    umount /mnt
    
    CentOS 7
    mkfs.ext4 /dev/sdb1 
    mount /dev/sdb1 /mnt 
    systemctl stop httpd.service
    systemctl stop nginx.service
    mv -f /home/* /mnt 
    umount /mnt
    
  • Text step, define UUID for new disk:
    blkid
    /dev/sda1: UUID="99066558-ba04-465c-9962-e827aa2928ec" TYPE="ext4" 
    /dev/sda2: UUID="8ea38ef9-1ee5-423b-a013-15fd603a678e" TYPE="swap" 
    /dev/sda3: UUID="08ec5c65-8fd8-47ac-a998-d81195c8f964" TYPE="ext4" 
    /dev/sdb1: UUID="b2e58731-b621-4bd5-909a-afe3bb5dd8a1" TYPE="ext4"
    

    and add the record (in this example: UUID=b2e58731-b621-4bd5-909a-afe3bb5dd8a1) about it in /etc/fstab (instead of UUID, device name /dev/sdb also can be used):

  • The only thing that is left, is to import a new disk and to launch previously stopped services:

    CentOS 6
    mount /home 
    service httpd start 
    service nginx start 
    
    CentOS 7
    mount /home 
    systemctl start httpd.service
    systemctl start nginx.service
    

Adding disks in other virtualization environment or directly on a physical server is performed in a similar manner.





Courses developed by «Bitrix», Inc.