Hi Guys,
I have a new tutorial for you today. I will show you a samba share, how to create a loop device and then mount it and use this as internal backup space!
Advantages compared to a FTP storage:
Testet on: Ubuntu 16.04 (further tests are welcome)
Now to the tutorial:
The tutorial assumes that you are using a FTP storage with samba support. For example, an FTP store by Hetzner.
Installing CIFS support:
# Create directories
# Create cifs-credentials file
# Insert the following
This file is used to protect your password if someone can read the fstab file.
Now you have to enter the following in the fstab:
Now save the file and do the following to mount the samba storage:
Now we create a loop device. To do this, we need an image file that we need to format. Execute the following command:
Now we just need to include the formatted file as a loop device and link it to the /var/lib/psa/dumps folder:
If you do not want to do this after each reboot, we have to add the following in the fstab * not yet tested!
Now you can use the samba storage as a your lokal storage.
As always, test the tutorial before in a virtual environment and to take notes.
I have a new tutorial for you today. I will show you a samba share, how to create a loop device and then mount it and use this as internal backup space!
Advantages compared to a FTP storage:
- Full access rights
- Natural limitation of speed through your connection
- No server lag during creation or restoration
- Memory is used as normal as internal memory
- really fast restore!
Testet on: Ubuntu 16.04 (further tests are welcome)
Now to the tutorial:
The tutorial assumes that you are using a FTP storage with samba support. For example, an FTP store by Hetzner.
Installing CIFS support:
Code:
apt install cifs-utils
# Create directories
Code:
mkdir /mnt/hetzner-backup-space
# Create cifs-credentials file
Code:
nano /mnt/backup-credentials.txt
# Insert the following
Code:
username=your_username
password=your_password
This file is used to protect your password if someone can read the fstab file.
Now you have to enter the following in the fstab:
Code:
//SAMBA_SERVER/backup /mnt/hetzner-backup-space cifs iocharset=utf8,rw,credentials=/mnt/backup-credentials.txt,cache=none,nobrl,file_mode=0660,dir_mode=0770,rsize=65536,wsize=130048,uid=0,gid=0 0 0
Now save the file and do the following to mount the samba storage:
Code:
mount -a
Now we create a loop device. To do this, we need an image file that we need to format. Execute the following command:
Code:
# create 100GB image, fast create for lage file sizes
dd if=/dev/zero of=/mnt/hetzner-backup-space/backup-fs.image bs=1024 count=0 seek=$[1024*1024*100]
# create an ext3 filesystem inside the image
mkfs.ext3 /mnt/hetzner-backup-space/backup-fs.image
Now we just need to include the formatted file as a loop device and link it to the /var/lib/psa/dumps folder:
Code:
mount -o loop /mnt/hetzner-backup-space/backup-fs.image /var/lib/psa/dumps
If you do not want to do this after each reboot, we have to add the following in the fstab * not yet tested!
Code:
# Insert after CIFS-Mount line
/mnt/hetzner-backup-space/backup-fs.image /var/lib/psa/dumps ext3 loop 0 0
Now you can use the samba storage as a your lokal storage.
As always, test the tutorial before in a virtual environment and to take notes.
Last edited: