# Staging space configuration

## General

Storware Backup & Recovery node needs staging space available in the  `/vprotect_data` by default. It is common to use PowerProtect DD for both the staging and backup destination. This will result in instant "store" processing, without the need to copy data from the staging space to the backup destinations. It is common to just attach an empty drive and mount it.

When using separate storage (usually local disks) for the staging space, consider its requirements. Staging space size depends on the number and size of simultaneous backups - as a rule of thumb make it approximately equal to the number of expected simultaneous backup threads multiplied by the size of your biggest VM.

In any case - make sure the staging space is always mounted in the `/vprotect_data` folder, and that the vprotect user is able to have full permissions to this file system.

### Example - Local filesystem

You also can use a plain file system for staging space (and optionally for backup destination). Here are steps assuming you have a local (physical or virtual) disk.

* List all existing disks, and find your dedicated disk (let's say - `/dev/sdb`):

```
[root@vlabs-rta-centos9 scripts]# lsblk 
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   30G  0 disk 
├─sda1        8:1    0  600M  0 part /boot/efi
├─sda2        8:2    0    1G  0 part /boot
└─sda3        8:3    0 28.4G  0 part 
  ├─cs-root 253:0    0 25.4G  0 lvm  /
  └─cs-swap 253:1    0    3G  0 lvm  [SWAP]
sdb           8:16   0  100G  0 disk 
sr0          11:0    1 1024M  0 rom  
```

* If you have a new clean disk prepare a filesystem on it:

```
mkfs.xfs -K /dev/sdb
```

* Add a line to `/etc/fstab` file, to automatically mount new filesystem after reboot:

```
/dev/sdb    /vprotect_data    xfs    defaults 0 0
```

* Create mount point

```
mkdir /vprotect_data
```

* Mount

```
mount -a
```

* Verify if it is mounted

```
[root@vlabs-rta-centos9 scripts]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             4.0M     0  4.0M   0% /dev
tmpfs                5.8G     0  5.8G   0% /dev/shm
tmpfs                2.3G   13M  2.3G   1% /run
efivarfs             256K   32K  220K  13% /sys/firmware/efi/efivars
/dev/mapper/cs-root   26G  4.4G   21G  18% /
/dev/sda2            960M  237M  724M  25% /boot
/dev/sda1            599M  7.1M  592M   2% /boot/efi
tmpfs                1.2G     0  1.2G   0% /run/user/0
/dev/sdb             100G  746M  100G   1% /vprotect_data
```

* Set ownership to `vprotect` user on directory `/vprotect_data`:

```
chown vprotect:vprotect -R /vprotect_data
```

* Confirm with `df` that your `/vprotect_data` is mounted
* Restart your `vprotect-node`service:

```
systemctl restart vprotect-node
```
