艾瑞克的 Hexo 空間

筆記-讓非root 權限的使用者也能用 zfs指令的方法

git clone zfsnap

1
2
git clone https://github.com/zfsnap/zfsnap.git
follow the instructions
test the env
1
2
3
4
cd zfsnap/tests
./run.sh
move the entire zfsnap folder to /usr/local/src/zfsnap
1
2
sudo mv zfsnap /usr/local/src/zfsnap
1
2
ln -s /usr/local/src/zfsnap/sbin/zfsnap.sh /usr/local/bin/zfsnap

change zfs command permission

1
2
sudo 0666 /dev/zfs
permission on /dev/zfs will be reset every reboot , so add a script to change on boot

cat /usr/local/bin/change_zfs_permission

1
2
3
4
#!/bin/bash
chmod 0666 /dev/zfs
an script to backup home directory

cat /usr/local/bin/

```
1
2

#!/bin/bash

/usr/local/sbin/zfsnap snapshot zp/home

```

avatar
雜念-台銀硬幣換紙鈔還是要先分類好啊!

  1. 1. follow the instructions
  2. 2. test the env
  3. 3. move the entire zfsnap folder to /usr/local/src/zfsnap
  4. 4. make a link to run zfsnap
  • change zfs command permission
    1. 1. permission on /dev/zfs will be reset every reboot , so add a script to change on boot
    2. 2. an script to backup home directory