datto / dattobd

kernel module for taking block-level snapshots and incremental backups of Linux block devices
GNU General Public License v2.0
576 stars 122 forks source link

dbdctl setup-snapshot for other partitions and not allow to remove '/.datto' (Operation not permitted) #385

Closed nonvwvnon closed 2 months ago

nonvwvnon commented 2 months ago

Did a test for a small partition /dev/sda2 is /boot (488M) Create a snapshot $ dbdctl setup-snapshot /dev/sda2 /.datto 0

'dmesg' show following error message [94359920.112538] datto: '/.datto' is not on 'sda2': -22 [94359920.112575] datto: error setting up cow manager: -22 [94359920.112611] datto: error unlinking file: -1 [94359920.112646] datto: error setting up tracer as active snapshot: -22 [94359920.112683] datto: error during setup ioctl handler: -22


On remove of '/.dattto', any idea why it does not allow me to remove the file?(i am root[superuser]) $ rm /.datto rm: remove regular file '/.datto'? y rm: cannot remove '/.datto': Operation not permitted


final question, if /dev/sda3 (/data) is 2.7T size and '739G' usedspace

Will a snapshot create a 739G '/.datto' ?? do i need alot of free space on '/' level? '/' is mount on /dev/sda1 (500G size)

yito24 commented 2 months ago

(1) The following command is correct: # dbdctl setup-snapshot /dev/sda2 /boot/.datto 0

(2) Run command to find the minor number. # cat /proc/datto-info

Destroy the snapshot. # dbdctl destroy \<minor number> # rm -rf \<datto file>

(3) Usually 10% of the partition size is used as the COW file (datto file).

The following command is correct: # dbdctl setup-snapshot /dev/sda3 /data/.datto 1

iamandrii commented 2 months ago

Hi @nonvwvnon! @yito24's comment was absolutely corrent.

I'd like to add, that for further assistance with dbdctl you can type dbdctl help and/or find the docs here.

nonvwvnon commented 2 months ago

your example works! thanks yito24. dattobd should include more of the yito24's example if it involve different partition.