All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard Bloch <edi@gmx.de>
To: dm-devel@redhat.com
Subject: Strange data corruption with RW snapshots
Date: Sat, 1 Oct 2005 13:20:09 +0200	[thread overview]
Message-ID: <20051001112009.GC24685@debian> (raw)

Hello people,

I am trying to create a modified KNOPPIX using devmapper RW snapshots
instead of its unionfs solution. The problem is: I get corrupted data
and cannot see where it comes from. The relevant part of setup code
is attached below. The resulting snapshot volume looks ok at the first
glance (dmsetup status) and can be mounted (ext2), the directory tree is
displayed but it returns corruped data on most files. I cannot see the
problem, a simulation with the same setup method in another environment
(kernel 2.6.13) did work as expected. Also Ubuntu uses that method for
their Live CD and there it works as well.

I looked for a good and up-to-date documentation of the snapshot target
but could not find anything. I hope someone can give me a clue, I cannot
see how I could solve the problem now.

# state: KNOPDEV is /dev/cloop, readonly block device and mounted on
# /KNOPPIX, DMSETUP is a static. linked version from devmapper-1.01.04,
# kernel is .2.6.12 (.4 or so)
COW_NAME=COW
CHUNK_SIZE=8
SNAPSHOT_NAME=knop_rw
VOL_SIZE=$(blockdev --getsize $KNOPDEV)

# create space for the cow data and assign it to a free loop device COWDEV
echo | dd bs=1 of=/ramdisk/$COW_NAME seek=`expr 512 \* $VOL_SIZE` count=1 2>/dev/null
for x in /dev/loop* ; do if losetup $x >/dev/null 2>&1 ; then continue ; else COWDEV=$x ; break ; fi ; done
losetup $COWDEV /ramdisk/$COW_NAME

umount /KNOPPIX
# critical part, no /KNOPPIX/* system tools for now
$DMSETUP mknodes
echo "0 $VOL_SIZE linear /dev/cloop 0" | $DMSETUP create knop_ro

# this was expected to be a workaround, mapping the loop device to a
# devmapper volume. It did also fail when using pure $COWDEV
echo "0 $VOL_SIZE linear $COWDEV 0"    | $DMSETUP create cow

echo "0 $VOL_SIZE snapshot /dev/mapper/knop_ro /dev/mapper/cow p $CHUNK_SIZE" | $DMSETUP create $SNAPSHOT_NAME

$DMSETUP mknodes $SNAPSHOT_NAME

#remount
/static/mount /dev/mapper/$SNAPSHOT_NAME /KNOPPIX
# we are back, rewritable
bash
# And this bash command running on /KNOPPIX already fails with obscure
# errors.

Thanks,
Eduard.

-- 
<Getty> LOL die Telefonnummer vom Arbeitsamt Mönchengladbach ist echt 404-0?
<Getty> Soll das nen schlechter Scherz sein?

             reply	other threads:[~2005-10-01 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-01 11:20 Eduard Bloch [this message]
2005-10-05 15:49 ` Strange data corruption with RW snapshots Kevin Corry
2005-10-05 16:16   ` Eduard Bloch
2005-10-06 16:59     ` Eduard Bloch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051001112009.GC24685@debian \
    --to=edi@gmx.de \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.