From: Andreas Klauer <Andreas.Klauer@metamorpher.de>
To: dm-devel@redhat.com
Subject: kpartx ignores read-only?
Date: Sat, 19 Oct 2013 23:19:13 +0200 [thread overview]
Message-ID: <20131019211913.GA5479@EIS> (raw)
Hi,
on my system I have some read-only device mapper targets. They are
old LVM instances which I made read-only using (lvchange -p r LV)
in order to preserve their contents.
One of them contains a partitioned hard disk image.
# dmsetup info /dev/dm-29
> Name: HDD-OLD--rost--image
> State: ACTIVE (READ-ONLY)
> Read Ahead: 12288
> Tables present: LIVE
> Open count: 1
> Event number: 0
> Major, minor: 253, 29
> Number of targets: 1
> UUID: LVM-PGTIP3IjFCE4UHM9fFGxuVhKR4FmCXO0gwvX8HW6JBs2dfxj6lYyKOmDLyxsDf0B
In order to mount a few partitions of it, I used kpartx to map the partitions.
# kpartx -a /dev/dm-29
This works fine, except the READ-ONLY does not seem to stick.
# dmsetup ls --tree
> [...]
> HDD-OLD--rost--imagep1 (253:30)
> └─HDD-OLD--rost--image (253:29)
> [...]
# dmsetup info /dev/mapper/HDD-OLD--rost--imagep1
> Name: HDD-OLD--rost--imagep1
> State: ACTIVE
> Read Ahead: 256
> Tables present: LIVE
> Open count: 0
> Event number: 0
> Major, minor: 253, 30
> Number of targets: 1
> UUID: part1-LVM-PGTIP3IjFCE4UHM9fFGxuVhKR4FmCXO0gwvX8HW6JBs2dfxj6lYyKOmDLyxsDf0B
And it's completely writable.
I tried to use losetup --partscan as an alternative to kpartx, which kind
of works, except the kernel believes the loop device to be writable and
gives a lot of I/O error messages and the filesystem behaves oddly.
> [ 3136.455451] Buffer I/O error on device loop0p1, logical block 1568
> [ 3136.455454] lost page write due to I/O error on loop0p1
> [ 3136.455466] loop: Write error at byte offset 36003840, length 4096.
> [ 3136.455469] Buffer I/O error on device loop0p1, logical block 8534
> [ 3136.455472] lost page write due to I/O error on loop0p1
> [ 3136.455478] loop: Write error at byte offset 5094449152, length 4096.
> [...]
This doesn't happen for other read-only devices (such as /dev/cdrom).
I can work around it using losetup --read-only, just wondering if this is
expected behaviour at all or not? I never used read-only dm/LV before,
but my expectation was that the read-only property in one place would
also affect all devices that derive from it...
I'm using kernel 3.11.4 if it makes any difference.
Regards
Andreas Klauer
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
reply other threads:[~2013-10-19 21:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20131019211913.GA5479@EIS \
--to=andreas.klauer@metamorpher.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.