* [BUG REPORT] ENOTBLK on create cache if metadata device not zeroed (3.9.0-rc7)
@ 2013-04-22 16:47 Mears, Morgan
2013-04-22 18:09 ` Mike Snitzer
0 siblings, 1 reply; 2+ messages in thread
From: Mears, Morgan @ 2013-04-22 16:47 UTC (permalink / raw)
To: dm-devel@redhat.com
[-- Attachment #1.1: Type: text/plain, Size: 1103 bytes --]
Hi,
I was setting up for some dm-cache testing this weekend (using 3.9.0-rc7 x86_64) and ran into the following:
# dmsetup create cache --table '0 41943040 cache /dev/mapper/metadata /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0'
device-mapper: reload ioctl on cache failed: Block device required
Command failed
#
After this error, /var/log/messages contains:
[75376.089354] device-mapper: cache metadata: sb_check failed: blocknr 18446744073709551615: wanted 0
[75376.089362] device-mapper: block manager: superblock validator check failed for block 0
[75376.089364] device-mapper: cache metadata: couldn't read lock superblock
[75376.095173] device-mapper: table: 253:5: cache: Error creating metadata object
[75376.095180] device-mapper: ioctl: error adding target to table
This comes from sb_check() in drivers/md/dm-cache-metadata.c and drivers/md/dm-thin-metadata.c, and it motivated me to try:
# dd if=/dev/zero of=/dev/mapper/metadata bs=4k conv=notrunc
Afterwards, I tried "dmsetup create cache" again and it worked fine.
Regards,
Morgan Mears
[-- Attachment #1.2: Type: text/html, Size: 5134 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [BUG REPORT] ENOTBLK on create cache if metadata device not zeroed (3.9.0-rc7)
2013-04-22 16:47 [BUG REPORT] ENOTBLK on create cache if metadata device not zeroed (3.9.0-rc7) Mears, Morgan
@ 2013-04-22 18:09 ` Mike Snitzer
0 siblings, 0 replies; 2+ messages in thread
From: Mike Snitzer @ 2013-04-22 18:09 UTC (permalink / raw)
To: Mears, Morgan; +Cc: dm-devel@redhat.com
On Mon, Apr 22 2013 at 12:47pm -0400,
Mears, Morgan <Morgan.Mears@netapp.com> wrote:
> Hi,
>
> I was setting up for some dm-cache testing this weekend (using 3.9.0-rc7 x86_64) and ran into the following:
>
> # dmsetup create cache --table '0 41943040 cache /dev/mapper/metadata /dev/mapper/ssd /dev/mapper/origin 512 1 writeback default 0'
> device-mapper: reload ioctl on cache failed: Block device required
> Command failed
> #
>
> After this error, /var/log/messages contains:
>
> [75376.089354] device-mapper: cache metadata: sb_check failed: blocknr 18446744073709551615: wanted 0
> [75376.089362] device-mapper: block manager: superblock validator check failed for block 0
> [75376.089364] device-mapper: cache metadata: couldn't read lock superblock
> [75376.095173] device-mapper: table: 253:5: cache: Error creating metadata object
> [75376.095180] device-mapper: ioctl: error adding target to table
>
> This comes from sb_check() in drivers/md/dm-cache-metadata.c and drivers/md/dm-thin-metadata.c, and it motivated me to try:
>
> # dd if=/dev/zero of=/dev/mapper/metadata bs=4k conv=notrunc
>
> Afterwards, I tried "dmsetup create cache" again and it worked fine.
Right, we check if the superblock is all zeroes, and if so we know this
is the initial cache creation with the specified metadata device.
It should be noted that when lvm2's support for dm-cache is added it
will take care of zeroing the metadata device for you for the initial
create.
I thought we documented the need to zero the start of the metadata device
but it is clearly missing from Documentation/device-mapper/cache.txt. I
must've been thinking of Documentation/device-mapper/thin-provisioning.txt
(which has the same metadata and data device split as the cache target):
Setting up a fresh pool device
------------------------------
Setting up a pool device requires a valid metadata device, and a
data device. If you do not have an existing metadata device you can
make one by zeroing the first 4k to indicate empty metadata.
dd if=/dev/zero of=$metadata_dev bs=4096 count=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-22 18:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22 16:47 [BUG REPORT] ENOTBLK on create cache if metadata device not zeroed (3.9.0-rc7) Mears, Morgan
2013-04-22 18:09 ` Mike Snitzer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.