Backup System

Policy

Target

List of directories to obtain the backup.

Method

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

Policy of prune backup

  1. Keep the last seven days of backups
  2. Keep the latest backup on each week, up to 8
  3. Keep the latest backup on each month, up to 36

Check backup status

Restore from backup

  1. Mount disk on k1bck0
  2. Change directory to mounted disk
  3. Start restore
    # borg extract /BACKUP_DIR::ARCHIVE
    This command write backup data to the current directory.

Mount from backup

  1. Mount disk on k1bck0
    $ sudo brog mount /zbackup/BACKUP_DIR::DATE {MOUNT_DIR}
  2. Unmount disk
    $ sudo brog umount {MOUNT_DIR}

Backup Japanese

Maintenance

OS update

# freebsd-update fetch
# freebsd-update install
# pkg upgrade
# reboot

Installation

  1. Install FreeBSD 11
  2. Install packages
    # pkg install tmux py36-borgbackup
  3. Configuration
    1. SSH
      /etc/rc/conf
      sshd_enable="YES"
    2. 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
  4. 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
  5. Reboot
    # reboot

Monitor

EPICS IOC

Script

HDD list

HDD list

device

Serial

for

ada0

system

ada1

1SHW665Z

data

ada2

1SHM8GSZ

ada3

1SHX5YDZ

da0

1SHWVU4Z

da1

1SHWE8JZ

KAGRA/Subgroups/DGS/Projects/Backup (last edited 2023-06-28 13:35:49 by shoichi.oshino)