the image used size becomes 0 after export/import with snapshot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have an image with a snapshot and some changes after snapshot.
```
$ rbd du backup/f0408e1e-06b6-437b-a2b5-70e3751d0a26          
NAME                                                                                PROVISIONED  USED   
f0408e1e-06b6-437b-a2b5-70e3751d0a26@snapshot-eb085877-7557-4620-9c01-c5587b857029       10 GiB  2.4 GiB
f0408e1e-06b6-437b-a2b5-70e3751d0a26                                                     10 GiB  2.4 GiB
<TOTAL>                                                                                  10 GiB  4.8 GiB
```
If there is no changes after snapshot, the image line will show 0 used.

I did export and import.
```
$ rbd export --export-format 2 backup/f0408e1e-06b6-437b-a2b5-70e3751d0a26 - | rbd import --export-format 2 - backup/test
Exporting image: 100% complete...done.
Importing image: 100% complete...done.
```

When check the imported image, the image line shows 0 used.
```
$ rbd du backup/test
NAME                                                PROVISIONED  USED   
test@snapshot-eb085877-7557-4620-9c01-c5587b857029       10 GiB  2.4 GiB
test                                                     10 GiB      0 B
<TOTAL>                                                  10 GiB  2.4 GiB
```
Any clues how that happened? I'd expect the same du as the source.

I tried another quick test. It works fine.
```
$ rbd create backup/test-src --size 10G
$ sudo rbd map backup/test-src
/dev/rbd0
$ echo "hello" | sudo tee /dev/rbd0
hello
$ rbd du backup/test-src
NAME      PROVISIONED  USED 
test-src       10 GiB  4 MiB
$ rbd snap create backup/test-src@snap-1
Creating snap: 100% complete...done.
$ rbd du backup/test-src                                      
NAME             PROVISIONED  USED 
test-src@snap-1       10 GiB  4 MiB
test-src              10 GiB    0 B
<TOTAL>               10 GiB  4 MiB
$ echo "world" | sudo tee /dev/rbd0
world
$ rbd du backup/test-src
NAME             PROVISIONED  USED 
test-src@snap-1       10 GiB  4 MiB
test-src              10 GiB  4 MiB
<TOTAL>               10 GiB  8 MiB
$ rbd export --export-format 2 backup/test-src - | rbd import --export-format 2 - backup/test-dst
Exporting image: 100% complete...done.
Importing image: 100% complete...done.
$ rbd du backup/test-dst
NAME             PROVISIONED  USED 
test-dst@snap-1       10 GiB  4 MiB
test-dst              10 GiB  4 MiB
<TOTAL>               10 GiB  8 MiB
```

Thanks!
Tony
_______________________________________________
ceph-users mailing list -- ceph-users@xxxxxxx
To unsubscribe send an email to ceph-users-leave@xxxxxxx



[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Ceph Dev]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux