datto / dattobd

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

Maximum volume size #279

Closed yito24 closed 2 years ago

yito24 commented 2 years ago

What is the maximum volume size that can be snapshot? For example, the maximum volume size of xfs is 8EiB. Is it possible to take a snapshot of the 8EiB volume?

nickchen-cpu commented 2 years ago

I guess it's limited to single file maximum size (for COW file). There are several size related error code in file_allocate()

For Example

static int file_allocate(struct file *f, uint64_t offset, uint64_t length)
|
-> static int real_fallocate(struct file *f, uint64_t offset, uint64_t length){
   |
   -> if(off + len > inode->i_sb->s_maxbytes || off + len < 0) return -EFBIG;

I remembered that the value of s_maxbytes depends on the filesystem.

cat /sys/fs/ext4/\<dev>/maxbytes

The bitmap header size of the COW file is about 1 / 4096(COW_BLOCK_SIZE) * 8 (uint64_t's size) = 0.2%.

8EiB * 0.2 % = 0.016 EiB might be too large for s_maxbytes.

Best Regards, Nick

yito24 commented 2 years ago

Hi Nick,

Thanks for your comment.