Backup System
Contents
Policy
Target
List of directories to obtain the backup.
- k1boot
- /opt
- /diskless/root
- k1nfs0
- /export/apps
- /export/ligo
- /export/kagra
- /export/users
Method
- k1boot
- backup to k1bck0 by using borg
- k1nfs0
- backup to k1bck0 by using borg
- backup to local HDD by using rsync
How to backup
Initialization
# borg init -e none /BACKUP_DIR
Backup from source directory
# borg create /BACKUP_DIR::ARCHIVE /SRC
ARCHIVE is name of archive in this time.
Daily
- Once a day the script is executed by cron.
- The script is located at /root/bin/backup_borg.sh
- This script performs backup and organizing past backups.
Policy of prune backup
- Keep the last seven days of backups
- Keep the latest backup on each week, up to 8
- Keep the latest backup on each month, up to 36
Check backup status
- Assign repository
# borg list /BACKUP_DIR
This command displays the list of archives. - Assign archive
# borg list /BACKUP_DIR::ARCHIVE
This command displays the list of directories and files of this archive.
Restore from backup
- Mount disk on k1bck0
- Change directory to mounted disk
- Start restore
# borg extract /BACKUP_DIR::ARCHIVE
This command write backup data to the current directory.
Mount from backup
- Mount disk on k1bck0
$ sudo brog mount /zbackup/BACKUP_DIR::DATE {MOUNT_DIR}
- Unmount disk
$ sudo brog umount {MOUNT_DIR}
Maintenance
OS update
# freebsd-update fetch # freebsd-update install # pkg upgrade # reboot
Installation
- Install FreeBSD 11
- Install packages
# pkg install tmux py36-borgbackup
- Configuration
- SSH
/etc/rc/conf sshd_enable="YES"
NFS & autofs
/etc/rc.local nfs_client_enable="YES" autofs_enable="YES"
/etc/auto_master /- -noauto
/etc/fstab # NFS k1nfs0:/export/users /export/users nfs ro,noauto 0 0 k1nfs0:/export/ligo /export/ligo nfs ro,noauto 0 0 k1nfs0:/export/apps /export/apps nfs ro,noauto 0 0 k1nfs0:/export/kagra /export/kagra nfs ro,noauto 0 0 k1boot:/opt /export/opt nfs ro,noauto 0 0 k1boot:/diskless/root /export/root nfs ro,noauto 0 0
- SSH
- Create RAID
# zpool create zbackup raidz2 ada1 ada2 ada3 da0 da1 # zpool status pool: zbackup state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM zbackup ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 ada1 ONLINE 0 0 0 ada2 ONLINE 0 0 0 ada3 ONLINE 0 0 0 da0 ONLINE 0 0 0 da1 ONLINE 0 0 0 errors: No known data errors
- Reboot
# reboot
Monitor
EPICS IOC
- Working on k1script1
- Directory: /opt/rtcds/kamioka/k1/target/k1sys/
Script
- /kagra/bin/SYS/backup_status.sh
- Run daily at 9:00 am
HDD list
device |
Serial |
for |
|
|
|
ada0 |
|
system |
ada1 |
1SHW665Z |
data |
ada2 |
1SHM8GSZ |
|
ada3 |
1SHX5YDZ |
|
da0 |
1SHWVU4Z |
|
da1 |
1SHWE8JZ |