ZFS work with Ldom and zvol REFER size can't reduce
853448Apr 6 2011 — edited Apr 7 2011Anyone can help to take a look following:
I do the zfs simulation below and show below output.
1) Create image file
root@solaris:/a# mkfile 200m img.img
2)Create test pool use img.img file
root@solaris:/a# zpool create -f test /a/img.img
root@solaris:/a# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool1 3.79G 11.8G 92.5K /rpool1
rpool1/ROOT 2.24G 11.8G 31K legacy
rpool1/ROOT/solaris 2.24G 11.8G 2.23G /
rpool1/dump 768M 11.8G 768M -
rpool1/export 89.5K 11.8G 32K /export
rpool1/export/home 57.5K 11.8G 57.5K /export/home
rpool1/swap 817M 12.5G 123M -
test 91K 163M 31K /test
3) Create zvol on the test pool
root@solaris:/a# zfs create -V 100m test/zvol
root@solaris:/a# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool1 3.79G 11.8G 92.5K /rpool1
rpool1/ROOT 2.24G 11.8G 31K legacy
rpool1/ROOT/solaris 2.24G 11.8G 2.23G /
rpool1/dump 768M 11.8G 768M -
rpool1/export 89.5K 11.8G 32K /export
rpool1/export/home 57.5K 11.8G 57.5K /export/home
rpool1/swap 817M 12.5G 123M -
test 155M 7.89M 31K /test
test/zvol 103M 163M 16K -
root@solaris:/a# zpool status
pool: rpool1
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool1 ONLINE 0 0 0
c7t0d0s0 ONLINE 0 0 0
errors: No known data errors
pool: test
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
test ONLINE 0 0 0
/a/img.img ONLINE 0 0 0
errors: No known data errors
4) Use the zvol to create apool
root@solaris:/a# zpool create -f apool /dev/zvol/dsk/test/zvol
root@solaris:/a# zfs list
NAME USED AVAIL REFER MOUNTPOINT
apool 92.5K 63.4M 31K /apool
rpool1 3.79G 11.8G 92.5K /rpool1
rpool1/ROOT 2.24G 11.8G 31K legacy
rpool1/ROOT/solaris 2.24G 11.8G 2.23G /
rpool1/dump 768M 11.8G 768M -
rpool1/export 89.5K 11.8G 32K /export
rpool1/export/home 57.5K 11.8G 57.5K /export/home
rpool1/swap 817M 12.5G 123M -
test 155M 7.88M 31K /test
test/zvol 155M 162M 1.13M -
root@solaris:/a# zpool status
pool: apool
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
apool ONLINE 0 0 0
/dev/zvol/dsk/test/zvol ONLINE 0 0 0
errors: No known data errors
pool: rpool1
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
rpool1 ONLINE 0 0 0
c7t0d0s0 ONLINE 0 0 0
errors: No known data errors
pool: test
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
test ONLINE 0 0 0
/a/img.img ONLINE 0 0 0
errors: No known data errors
5) Make file on the /apool
root@solaris:/apool# mkfile 10m test
root@solaris:/apool# zfs list
NAME USED AVAIL REFER MOUNTPOINT
apool 9.39M 54.1M 9.28M /apool
rpool1 3.79G 11.8G 92.5K /rpool1
rpool1/ROOT 2.24G 11.8G 31K legacy
rpool1/ROOT/solaris 2.24G 11.8G 2.23G /
rpool1/dump 768M 11.8G 768M -
rpool1/export 89.5K 11.8G 32K /export
rpool1/export/home 57.5K 11.8G 57.5K /export/home
rpool1/swap 817M 12.5G 123M -
test 155M 7.55M 31K /test
test/zvol 103M 151M 11.5M -
6) Remove 20m test on the apool
root@solaris:/apool# rm test
root@solaris:/apool# zfs list
NAME USED AVAIL REFER MOUNTPOINT
apool 316K 63.1M 31K /apool
rpool1 3.79G 11.8G 92.5K /rpool1
rpool1/ROOT 2.24G 11.8G 31K legacy
rpool1/ROOT/solaris 2.24G 11.8G 2.23G /
rpool1/dump 768M 11.8G 768M -
rpool1/export 89.5K 11.8G 32K /export
rpool1/export/home 57.5K 11.8G 57.5K /export/home
rpool1/swap 817M 12.5G 123M -
test 155M 7.53M 31K /test
test/zvol 103M 150M 12.9M -
7) Make snapshot on the zvol
root@solaris:/apool# zfs snapshot test/zvol@snap
root@solaris:/# zfs send test/zvol@snap > /tmp/zvol.snap
root@solaris:/tmp# du -sh *
14M zvol.snap
** The snap file and the REFER size are same, but the real size on the apool is 31K, how can I update the zvol REFER size***