All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yathindra <ydev@cs.utah.edu>
To: "Bryn M. Reeves" <bmr@redhat.com>,
	device-mapper development <dm-devel@redhat.com>
Subject: Re: Simulating faulty disk
Date: Sat, 22 Oct 2011 00:16:50 -0600	[thread overview]
Message-ID: <4EA25FD2.8060706@cs.utah.edu> (raw)
In-Reply-To: <4EA18DF3.3000800@redhat.com>

All I want to do is simulate a delay or flakey device. Mount it. And see 
how regular read/write commands
such as cat, echo, vim etc behave.

*  I created a delay device d0 and mounted it on /mnt
*  Copied few files into /mnt
*  Invoked dd command on /dev/mapper/d0 and it was slow
*  Invoked cat command on some file in /mnt but it was not slow

What is wrong here?

Steps I followed are shown below:
==========================================================
root@nodea:/users/ydev# dmsetup remove_all

#Created a delay device d0
root@nodea:/users/ydev# dmsetup create d0 --table="0 `blockdev --getsize 
/dev/sdb` delay /dev/sdb 0 500"

#Put a filesystem on top of d0
root@nodea:/users/ydev# mkfs -t ext3 /dev/mapper/d0
mke2fs 1.41.11 (14-Mar-2010)
Filesystem label=
OS type: Linux
....
....
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
....

#Mounted the device-mapper device on /mnt.
root@nodea:/users/ydev# mount -t ext3 /dev/mapper/d0 /mnt

#Copied some arbitrary files into /mnt
root@nodea:/users/ydev# cp -r stap_tests /mnt

#Invoked a dd command to check if it is slowing down and it did as seen 
below.

root@nodea:/# dd if=/dev/mapper/d0 of=/dev/null bs=400k count=1
1+0 records in
1+0 records out
409600 bytes (410 kB) copied, 1.01523 s, 403 kB/s

#But it did not slow down cat command as seen below.

root@nodea:/mnt/stap_tests# sysctl vm.drop_caches=3
vm.drop_caches = 3

root@nodea:/mnt/stap_tests# time cat 12M > /dev/null

real    0m0.034s
user    0m0.000s
sys     0m0.004s

==========================================================

Thanks,
Yathi



On 10/21/2011 9:21 AM, Bryn M. Reeves wrote:
> On 10/21/2011 04:13 PM, Yathindra wrote:
>> >mount -t ext3 /dev/sdb /mnt
>> Copied some data into /mnt
>> >dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
>> /dev/sdb 0 500"
>> device-mapper: reload ioctl failed: Invalid argument
>> Command failed
>
> You can't create a mapped device on something while it is mounted as 
> device-mapper needs to open it exclusively.
>
>> But as seen from above, dmsetup is failing to create a flakey/delay
>> device when /dev/sdb
>> has a filesystem on top of it. Is there any workaround ?
>
> Set up the file system the way you want it on sdb first. Then unmount 
> it and create the device-mapper devices and mount that.
>
> Regards,
> Bryn.

  parent reply	other threads:[~2011-10-22  6:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-20  3:18 Simulating faulty disk Yathindra
     [not found] ` <20111020044734.GC15211@atlantis.cc.ndsu.nodak.edu>
2011-10-20  7:30   ` Yathindra
2011-10-20  8:43     ` Yathindra
2011-10-20  9:27 ` Bryn M. Reeves
2011-10-20 15:45   ` Yathindra
2011-10-20 15:56     ` Bryn M. Reeves
2011-10-20 15:59       ` Yathindra
2011-10-20 16:46       ` Yathindra
2011-10-20 17:40         ` Bryn M. Reeves
2011-10-20 17:53           ` Yathindra
     [not found]             ` <4EA13A52.60902@redhat.com>
     [not found]               ` <4EA18610.3050900@cs.utah.edu>
2011-10-21 14:56                 ` Bryn M. Reeves
2011-10-21 15:00                   ` Yathindra
2011-10-21 15:13                     ` Yathindra
2011-10-21 15:21                       ` Bryn M. Reeves
2011-10-21 16:33                         ` Yathindra
2011-10-22  6:16                         ` Yathindra [this message]
2011-10-21  4:14           ` Yathindra

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=4EA25FD2.8060706@cs.utah.edu \
    --to=ydev@cs.utah.edu \
    --cc=bmr@redhat.com \
    --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.