dm-cache: document zeroing metadata device step
Subsystems (2)
PATCH 1/1 dm-cache: document zeroing metadata device step
Inform dmsetup users to zero the first 4k of the metadata device at cache creation in examples, just as mentioned in thin-provisioning documentation. Instructions to use lvmcache for end users may be added as well.
--- Documentation/admin-guide/device-mapper/cache.rst | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/admin-guide/device-mapper/cache.rst +4 -0
@@ -330,6 +330,10 @@ https://github.com/jthornber/device-mapper-test-suite :: + # When using dmsetup directly instead of volume manager like lvm2, + # the first 4k of the metadata device should be zeroed to indicate + # empty metadata. + dd if=/dev/zero of=/dev/mapper/metadata bs=4k conv=notrunc dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0' dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \
Signature · 1 line
2.26.2
Documentation/admin-guide/device-mapper/cache.rst https://github.com/jthornber/device-mapper-test-suite · line 336
Quoted 4 lines · Austin Chang
Documentation/admin-guide/device-mapper/cache.rst +4
-0+ # When using dmsetup directly instead of volume manager like lvm2, + # the first 4k of the metadata device should be zeroed to indicate + # empty metadata. + dd if=/dev/zero of=/dev/mapper/metadata bs=4k conv=notrunc
... don't you need 'count=1' or you'll zero the entire device?
Quoted 6 lines
dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \
/dev/mapper/ssd/dev/mapper/origin512 1 writeback default 0'
dmsetup createmy_cache--table '0 41943040 cache/dev/mapper/metadata\Signature · 1 line
2.26.2
Quoted 7 lines · Matthew Wilcox
Documentation/admin-guide/device-mapper/cache.rst https://github.com/jthornber/device-mapper-test-suite · line 336
Quoted 4 lines · Austin Chang
Documentation/admin-guide/device-mapper/cache.rst +4
-0+ # When using dmsetup directly instead of volume manager like lvm2, + # the first 4k of the metadata device should be zeroed to indicate + # empty metadata. + dd if=/dev/zero of=/dev/mapper/metadata bs=4k conv=notrunc... don't you need 'count=1' or you'll zero the entire device?
Oops, I copied the command I just used since zeroing the whole metadata device didn't harm. But 'count=1' should match what I've just written. I will send a v2 patch later
PATCH v2 1/1 dm-cache: document zeroing metadata device step
Inform dmsetup users to zero the first 4k of the metadata device at cache creation in examples, just as mentioned in thin-provisioning documentation. Instructions to use lvmcache for end users may be added as well.
---
Changes in v2:
- Correct the dd arguments
Documentation/admin-guide/device-mapper/cache.rst | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/admin-guide/device-mapper/cache.rst +4 -0
@@ -330,6 +330,10 @@ https://github.com/jthornber/device-mapper-test-suite :: + # When using dmsetup directly instead of volume manager like lvm2, + # the first 4k of the metadata device should be zeroed to indicate + # empty metadata. + dd if=/dev/zero of=/dev/mapper/metadata bs=4k count=1 dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \ /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0' dmsetup create my_cache --table '0 41943040 cache /dev/mapper/metadata \
Signature · 1 line
2.26.2