linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dm-cache: document zeroing metadata device step
@ 2020-07-12 19:40 Austin Chang
  2020-07-12 19:59 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Austin Chang @ 2020-07-12 19:40 UTC (permalink / raw)
  To: dm-devel
  Cc: Austin Chang, Alasdair Kergon, Mike Snitzer, Jonathan Corbet,
	linux-doc, linux-kernel

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.

Link: https://www.redhat.com/archives/dm-devel/2013-April/msg00124.html
Signed-off-by: Austin Chang <austin880625@gmail.com>
---
 Documentation/admin-guide/device-mapper/cache.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/admin-guide/device-mapper/cache.rst b/Documentation/admin-guide/device-mapper/cache.rst
index f15e5254d05b..ef9a82d50d19 100644
--- a/Documentation/admin-guide/device-mapper/cache.rst
+++ b/Documentation/admin-guide/device-mapper/cache.rst
@@ -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 \
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] dm-cache: document zeroing metadata device step
  2020-07-12 19:40 [PATCH] dm-cache: document zeroing metadata device step Austin Chang
@ 2020-07-12 19:59 ` Matthew Wilcox
  2020-07-12 21:10   ` Austin Chang
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2020-07-12 19:59 UTC (permalink / raw)
  To: Austin Chang
  Cc: dm-devel, Alasdair Kergon, Mike Snitzer, Jonathan Corbet,
	linux-doc, linux-kernel

On Mon, Jul 13, 2020 at 03:40:39AM +0800, Austin Chang wrote:
> +  # 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?

>    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 \
> -- 
> 2.26.2
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dm-cache: document zeroing metadata device step
  2020-07-12 19:59 ` Matthew Wilcox
@ 2020-07-12 21:10   ` Austin Chang
  2020-07-12 21:47     ` [PATCH v2] " Austin Chang
  0 siblings, 1 reply; 4+ messages in thread
From: Austin Chang @ 2020-07-12 21:10 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: dm-devel, Alasdair Kergon, Mike Snitzer, Jonathan Corbet,
	linux-doc, linux-kernel

On Sun, Jul 12, 2020 at 08:59:32PM +0100, Matthew Wilcox wrote:
> On Mon, Jul 13, 2020 at 03:40:39AM +0800, Austin Chang wrote:
> > +  # 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] dm-cache: document zeroing metadata device step
  2020-07-12 21:10   ` Austin Chang
@ 2020-07-12 21:47     ` Austin Chang
  0 siblings, 0 replies; 4+ messages in thread
From: Austin Chang @ 2020-07-12 21:47 UTC (permalink / raw)
  To: dm-devel
  Cc: Austin Chang, Alasdair Kergon, Mike Snitzer, Jonathan Corbet,
	linux-doc, linux-kernel

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.

Link: https://www.redhat.com/archives/dm-devel/2013-April/msg00124.html
Signed-off-by: Austin Chang <austin880625@gmail.com>
---
Changes in v2:
- Correct the dd arguments

 Documentation/admin-guide/device-mapper/cache.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/admin-guide/device-mapper/cache.rst b/Documentation/admin-guide/device-mapper/cache.rst
index f15e5254d05b..16a1c96946a6 100644
--- a/Documentation/admin-guide/device-mapper/cache.rst
+++ b/Documentation/admin-guide/device-mapper/cache.rst
@@ -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 \
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-12 21:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 19:40 [PATCH] dm-cache: document zeroing metadata device step Austin Chang
2020-07-12 19:59 ` Matthew Wilcox
2020-07-12 21:10   ` Austin Chang
2020-07-12 21:47     ` [PATCH v2] " Austin Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).