Page tree
Skip to end of metadata
Go to start of metadata

Product Version: 6.0
Last Modified: 6 Mar 2017

Question

How can a Backup Repository be extended on a Linux Virtual Appliance with NAKIVO Backup & Replication?

Answer

If you are using the Virtual Appliance that originally came with v4.1.x or later, please refer to the Increasing Backup Repository Size on Virtual Appliance topic.

If you are using the Virtual Appliance that originally came with v4.0.x or earlier, please refer to the information below:

Example 1: Extending the Onboard repository by adding a new disk

  1. Log in to vSphere Client and add a new hard drive to the VA.
  2. Log in to Nakivo VA. Default credentials are root/root
  3. df -h -T command shows you the filesystem and mount point of the onboard backup repository, for example:
    /dev/mapper/Volume_Group_Backup_Repository_500GB-Logical_Volume_Backup_Repository_500GB  511G   70M  491G   1% /opt/nakivo/repository

  4. Rescan the SCSI bus for new hardware by executing the following commands:

    1. cat /proc/partitions and note the list of devices. Note that the Onboard backup repository resides on sdb device.
    1. apt-get install scsitools
    2. rescan-scsi-bus
    3. cat /proc/partitions and see what devices were added. For example, sdc device will be found.
  5. Create a partition on the new disk by executing the following commands:
    1. fdisk /dev/<new device>, for example, fdisk /dev/sdc
    2. Command (m for help) – type m to see all options.
    3. Type n for creating a new partition.
    4. Type p for creating a primary type of partition.
    5. Type 1 for creating the 1st partition.
    6. Press Enter for selecting default values for first and last sectors.
    7. Type t for changing partition’s system id.
    8. Hex code (type L to list codes): type 8e that corresponds to the Linux LVM id.
    9. Type w for writing table to disk.
    10. Type the command partprobe to inform the operating system about partition table changes.
    11. Type cat /proc/partitions to make sure  new partition has been created. For example, you have to see sdc1.
  6. Extend the existing LVM structure by executing the following commands:
    1. Type pvcreate /dev/<new partition>. For example, pvcreate /dev/sdc1 for creating a physical volume.
    2. Type pvdisplay to make sure that physical volume has been created.
    3. Type vgextend Volume_Group_Backup_Repository_500GB /dev/sdc1 for extending the volume group called Volume_Group_Backup_Repository_500GB.
    4. Type vgdisplay to make sure that volume group has been extended.
    5. Type lvdisplay to see what logical volumes exist. Note, that the only logical volume called Logical_Volume_Backup_Repository_500GB exists within the VA.
    6. Type lvextend -l+100%FREE /dev/Volume_Group_Backup_Repository_500GB/Logical_Volume_Backup_Repository_500GB for extending the logical volume.
    7. Type resize2fs /dev/mapper/Volume_Group_Backup_Repository_500GB-Logical_Volume_Backup_Repository_500GB for extending the filesystem.
    8. Type df -h -T to make sure that repository size has been increased.

Example 2: Extending the Onboard repository by extending the current disk

  1. Log in to vSphere Client and extend the existing disk of the virtual machine.
  2. Log in to Nakivo VA. Default credentials are root/root
  3. df -h -T command will show you the filesystem and mount point of the onboard backup repository, for example:
    /dev/mapper/Volume_Group_Backup_Repository_500GB-Logical_Volume_Backup_Repository_500GB 511G 70M 491G 1% /opt/nakivo/repository
  4. Rescan the SCSI bus for a new hardware by executing the following commands:
    1. cat /proc/partitions and note the list of devices. Note that the Onboard backup repository resides on sdb device.
    2. apt-get install scsitools
    3. rescan-scsi-bus
    4. cat /proc/partitions and see what devices were added. For example, you will see sdb device, sdb1 partition and free space added to sdb device.
      NOTE:
       in case the command rescan-scsi-bus has not identified the free space, run the following commands:

      1. apt-get install lsscsi

      2. lsscsi – the output will be the follwoing:
        [1:0:0:0]    cd/dvd  NECVMWar VMware IDE CDR10 1.00  /dev/sr0
        [2:0:0:0]    disk    VMware   Virtual disk     1.0   /dev/sda
        [2:0:1:0]    disk    VMware   Virtual disk     1.0   /dev/sdb

      3. Rescan sdb device by executing the following command: 

      4. echo 1 > /sys/bus/scsi/devices/2\:0\:1\:0/rescan

      5. Execute dmesg | grep change – for example, the output can be:
        [91503.909069] sdb: detected capacity change from 558345748480 to 590558003200

  5. Create the second partition on the free space added to sdb device by executing the following commands:
    1. fdisk /dev/sdb
    2. Command (m for help) – type m to see all options.
    3. Type n for creating a new partition.
    4. Type p for creating a primary type of partition.
    5. Type 2 for creating the 2nd partition, for example, sdb2.
    6. Press Enter for selecting default values for first and last sectors.
    7. Type t for changing partition’s system id.
    8. Type 2 for choosing the 2nd partition.
    9. Hex code (type L to list codes) – type 8e that corresponds Linux LVM id.
    10. Type w for writing table to disk.
    11. Type the command partprobe to inform the operating system about partition table changes.
    12. Type cat /proc/partitions to see if a new partition has been created, for example, you have to see sdb2.
  6. Extend the existing LVM structure by executing the following commands:
    1. Type pvcreate /dev/<new partition> for example, pvcreate /dev/sdb2 for creating a physical volume.
    2. Type pvdisplay to make sure that physical volume has been created.
    3. Type vgextend Volume_Group_Backup_Repository_500GB /dev/sdb2 for extending the volume group called Volume_Group_Backup_Repository_500GB.
    4. Type vgdisplay to make sure that volume group has been extended.
    5. Type lvdisplay to see what logical volumes exist. Note, that the only logical volume called Logical_Volume_Backup_Repository_500GB exists within the VA.
    6. Type lvextend -l+100%FREE /dev/Volume_Group_Backup_Repository_500GB/Logical_Volume_Backup_Repository_500GB for extending the logical volume.
    7. Type resize2fs /dev/mapper/Volume_Group_Backup_Repository_500GB-Logical_Volume_Backup_Repository_500GB for extending the filesystem.
    8. Type df -h -T to make sure that repository size has been increased.

Example 3: Adding a separate disk and creating another Backup Repository

  1. First of all, you have to remove the onboard backup repository from VA.

  2. Log in to vSphere Client and add a new hard drive disk to a virtual machine

  3. Rescan the SCSI bus for a new hardware by executing the following commands:

    1. cat /proc/partitions and note the list of devices. Note that the Onboard backup repository resides on sdb device.
    1. apt-get install scsitools
    2. rescan-scsi-bus
    3. cat /proc/partitions and see what devices were added. For example, sdc device will be found.
  4. Create a partition on the new disk by executing the following commands:

    1. fdisk /dev/<new device>, for example, fdisk /dev/sdc
    2. Command (m for help) – type m to see all options.
    3. Type n for creating a new partition.
    4. Type p for creating a primary type of partition.
    5. Type 1 for creating the 1st partition.
    6. Press Enter for selecting default values for first and last sectors.
    7. Type t for changing partition’s system id.
    8. Hex code (type L to list codes): type 8e that corresponds to the Linux LVM id.
    9. Type w for writing table to disk.
    10. Type the command partprobe to inform the operating system about partition table changes.
    11. Type cat /proc/partitions to make sure  new partition has been created. For example, you have to see sdc1.
  5. Create new LVM structure on newly created partition by executing the following commands:

    1. pvcreate /dev/sdb1
    2. pvdisplay to make sure that physical volume has been created.
    3. vgcreate Volume_Group_Name /dev/sbd1
    4. vgdisplay to make sure that volume group has been created.
    5. lvcreate -l 100%FREE -n Logical_Volume_Name Volume_Group_Name
    6. lvdisplay to make sure that logical volume has been created.
  6. Create filesystem on the LVM structure:
    mkfs -t ext4 /dev/Volume_Group_Name/Logical_Volume_Name
  7. Create a mount point: 
    cd /mnt, 
    mkdir repository
  8. Mount your LVM to /etc/fstab file

    1. Edit the file fstab:

      nano /etc/fstab
    2. Add the following line:

      /dev/Volume_Group_Name/Logical_Volume_Name/mount_point  ext4 defaults 0 2where mount_point stands for instance /mnt/repository
    3. Execute mount -a that will make LVM bootable
    4. df -h -T command will show you the filesystem and mount point of your backup repository.
    1. chmod -R 770 /mnt/repository
    2. chown -R bhsvc:bhsvc /mnt/repository
  9. Add the backup repository to Nakivo UI using the following path: /mnt/repository

Example 4: Adding a new HDD which is larger than 2 TB

  1. Log into vSphere Client and add a new hard drive disk to Nakivo VA
  2. Log into Nakivo VA using root/root credentials
  3. Rescan the scsi bus for a new hardware by executing the following commands:
    1. cat /proc/partitions and note the list of devices. Note, that onboard backup repository resides on sdb device
    2. apt-get install scsitools
    3. rescan-scsi-bus
    4. cat /proc/partitions and see what devices got added, for example, you will see a sdc device
  4. Create a partition on the new disk by executing the following commands:
    1. parted /dev/<new device>, for example, sdc
    2. mklabelgpt (type Yes)
    3. unit TB
    4. mkpart primary 0 100% . You will see the warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? You can type Ignore or use sections 1, 2, and 3 of this article.
    5. print
    6. quit 
    7. type cat /proc/partitions to see if a new partition has been created. For example, you will see sdc1
  5. Extend existing LVM structure by executing the following commands:
    1. pvcreate /dev/<new partition>, for example, sdc1 for creating a physical volume
    2. pvdisplay to see that pv has been created
    3. vgextendVolume_Group_Backup_Repository_500GB /dev/sdc1 for extending the volume group called Volume_Group_Backup_Repository_500GB
    4. vgdisplay to see that vg has been extended
    5. lvdisplay to see what logical volumes exist. Note, that only lv called Logical_Volume_Backup_Repository_500GB exists within the VA
    6. lvextend -l +100% FREE /dev/Volume_Group_Backup_Repository_500GB/Logical_Volume_Backup_Repository_500GB for extending the logical volume
    7. resize2fs /dev/mapper/Volume_Group_Backup_Repository_500GB-Logical_Volume_Backup_Repository_500GB for extending the file system ext4
    8. df -h -T to see that repository size has been increased.

Example 5: Removing onboard repository and adding a separate storage larger than 2 TB instead

  1. Remove the onboard backup repository from VA
  2. Log into vSphere Client and add a new hard drive disk to Nakivo VA
  3. Log into Nakivo VA using root/root credentials
  4. Rescan the scsi bus for a new hardware by executing the following commands:
    1. cat /proc/partitions and note the list of devices
    2. apt-get install scsitools
    3. rescan-scsi-bus
    4. cat /proc/partitions and see what devices was added. For example, you will see sdb device
  5. Create a partition on the new disk by executing the following commands:
    1. parted /dev/<new device>, for example, sdb
    2. mklabel gpt (type Yes)
    3. unit TB
    4. mkpart primary 0 100%
      You will see the warning: The resulting partition is not properly aligned for best performance. Ignore/Cancel? You can type Ignore or use sections 1,2 and 3 of this article 
    5. print
    6. quit
    7. type cat /proc/partitions to see if a new partition has been created. For example, you will see sdb1
  6. Create LVM structure on newly created partition by executing the following commands:
    1. pvcreate /dev/sdb1
    2. pvdisplay to see that pv has been created
    3. vgcreate Volume_Group_Name /dev/sbd1
    4. vgdisplay to see that vg has been created
    5. lvcreate -l 100%FREE -n Logical_Volume_Name Volume_Group_Name
    6. lvdisplay to see that lv has been created
  7. Create filesystem on the LVM
    1. mkfs -t ext4 /dev/Volume_Group_Name/Logical_Volume_Name
  8. Mount your LVM to /etc/fstab file
    1. edit the file fstab: nano /etc/fstab
    2. add the following line: /dev/Volume_Group_Name/Logical_Volume_Name/mount_point ext4 defaults 0 2
    3. to create a mount point you have to go to, for example, to mnt  directory (cd /mnt), and create a folder repository: mkdir repository
    4. execute mount -a to make LVM bootable
    5. execute df -h -T to see the file system and mount point of your backup repository
  9. Give proper permissions to the repository folder
    1. chmod -R 775 /mnt/repository
    2. chown -R bhsvc:bhsvc /mnt/repository

Add the backup repository to Nakivo UI using the path /mnt/repository.

 

  • No labels