ubuntu / zsys

ZSys daemon and client for zfs systems
GNU General Public License v3.0
302 stars 43 forks source link

user's datasets are destroyed by zsys when the root of the relevant machine is not / anymore #180

Open ofthesun9 opened 3 years ago

ofthesun9 commented 3 years ago

Describe the bug On my computer, I have three machines. I needed to access the filesystem of another machine than the current one, so I modified its mountpoint to mount it in /mnt. Few seconds later, all its user datasets (in USERDATA) were gone.

To Reproduce

  1. You have several machines:
    olivier@bison:~$ zsysctl list
    ID                        ZSys  Last Used
    --                        ----  ---------
    rpool/ROOT/ubuntu_9d972f  true  current
    rpool/ROOT/ubuntu_mp4z9n  true  2020-12-07 18:56:12
    rpool/ROOT/ubuntu_syn0eg  true  2020-12-07 19:10:40
  2. Modify the mountpoint of one of the machine:
    olivier@bison:~$ sudo zfs set mountpoint=/mnt rpool/ROOT/ubuntu_syn0eg
  3. Check that the datasets have been destroyed:
    
    olivier@bison:~$ sudo zpool history -i rpool
    2020-12-07.19:15:41 [txg:6109908] set rpool/ROOT/ubuntu_syn0eg (3450) mountpoint=/mnt
    2020-12-07.19:15:46 zfs set mountpoint=/mnt rpool/ROOT/ubuntu_syn0eg
    2020-12-07.19:21:13 [txg:6110095] destroy rpool/USERDATA/olivier_syn0eg@autozsys_hu9zed (1512) 
    2020-12-07.19:21:13 ioctl destroy_snaps
    input:
        snaps:
            rpool/USERDATA/olivier_syn0eg@autozsys_hu9zed

2020-12-07.19:21:14 [txg:6110104] destroy rpool/USERDATA/olivier_syn0eg (1380) 2020-12-07.19:21:16 [txg:6110109] destroy rpool/USERDATA/root_syn0eg (774)



**Expected behavior**
I would expect that I can change (temporarily) the mountpoint of a machine without loosing the user data

**Installed versions:**
 - OS: Ubuntu 20.10 (Groovy Gorilla)
- Zsysd running version: 0.5.2