FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 10-20-2011, 05:53 PM
Yathindra
 
Default Simulating faulty disk

Oh I see. Maybe dm-delay is not enabled in ubuntu either.

Could you please tell me how I could enable it.

Thanks,
Yathi

On 10/20/2011 11:40 AM, Bryn M. Reeves wrote:

On 10/20/2011 05:46 PM, Yathindra wrote:

>dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"
device-mapper: reload ioctl failed: Invalid argument
Command failed

In /var/log/messages I see this,
device-mapper: ioctl: error adding target to table


I don't see this here:

# dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"

# dmsetup info -c d0
Name Maj Min Stat Open Targ Event UUID
d0 253 3 L--w 1 1 0
# dmsetup create f0 --table="0 `blockdev --getsize /dev/mapper/d0`
flakey /dev/mapper/d0 0 9 1"

# dmsetup info -c f0
Name Maj Min Stat Open Targ Event UUID
f0 253 4 L--w 0 1 0

This is using the f15 2.6.40.3 (aka kernel-3.0) with a locally
compiled dm-delay since it's not enabled in the Fedora kernels.


Might want to move this thread over to dm-devel if you're having
trouble with it.


Regards,
Bryn.


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-21-2011, 04:14 AM
Yathindra
 
Default Simulating faulty disk

Hi Bryn,

I compiled a fresh kernel and enabled flakey and delay modules. Now am
able to create disks but

it fails to mount.

dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"
dmsetup create f0 --table="0 `blockdev --getsize /dev/mapper/d0` flakey
/dev/mapper/d0 0 9 1"

mkfs -t ext3 /dev/mapper/f0
...
...
ext2fs_mkdir: Attempt to read block from filesystem resulted in short
read while creating root dir


Can we even mount such a device ?

Thanks,
Yathi



On 10/20/2011 11:40 AM, Bryn M. Reeves wrote:

On 10/20/2011 05:46 PM, Yathindra wrote:

>dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"
device-mapper: reload ioctl failed: Invalid argument
Command failed

In /var/log/messages I see this,
device-mapper: ioctl: error adding target to table


I don't see this here:

# dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"

# dmsetup info -c d0
Name Maj Min Stat Open Targ Event UUID
d0 253 3 L--w 1 1 0
# dmsetup create f0 --table="0 `blockdev --getsize /dev/mapper/d0`
flakey /dev/mapper/d0 0 9 1"

# dmsetup info -c f0
Name Maj Min Stat Open Targ Event UUID
f0 253 4 L--w 0 1 0

This is using the f15 2.6.40.3 (aka kernel-3.0) with a locally
compiled dm-delay since it's not enabled in the Fedora kernels.


Might want to move this thread over to dm-devel if you're having
trouble with it.


Regards,
Bryn.


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-21-2011, 02:56 PM
"Bryn M. Reeves"
 
Default Simulating faulty disk

On 10/21/2011 03:47 PM, Yathindra wrote:

dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"
dmsetup create f0 --table="0 `blockdev --getsize /dev/mapper/d0` flakey
/dev/mapper/d0 0 9 1"
mkfs -t ext3 /dev/mapper/f0
...
...
ext2fs_mkdir: Attempt to read block from filesystem resulted in short
read while creating root dir

Can we even mount such a device ?


It's a flakey device

With that table you'll have a device that is failing write I/Os for 1s
in every ten. If that coincides with mkfs trying to write to the device
it will create a corrupted file system.


Depending on what you are trying to test you may want to put data on the
device first.


Regards,
Bryn.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-21-2011, 03:00 PM
Yathindra
 
Default Simulating faulty disk

Ok Bryn is there a more elaborate document which shows simple examples
to work with device mapper. For a newbie like me it would be really helpful.

Thanks,
Yathi

On 10/21/2011 8:56 AM, Bryn M. Reeves wrote:

On 10/21/2011 03:47 PM, Yathindra wrote:

dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"
dmsetup create f0 --table="0 `blockdev --getsize /dev/mapper/d0` flakey
/dev/mapper/d0 0 9 1"
mkfs -t ext3 /dev/mapper/f0
...
...
ext2fs_mkdir: Attempt to read block from filesystem resulted in short
read while creating root dir

Can we even mount such a device ?


It's a flakey device

With that table you'll have a device that is failing write I/Os for 1s
in every ten. If that coincides with mkfs trying to write to the
device it will create a corrupted file system.


Depending on what you are trying to test you may want to put data on
the device first.


Regards,
Bryn.


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-21-2011, 03:13 PM
Yathindra
 
Default Simulating faulty disk

>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
>umount /mnt
> dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"

Worked.

Basically, am trying to test how regular userspace commands to
read/write files
behave when I/O fails. For this, I need to put a file system and then
carry on testing.


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 ?

Thanks,
Yathi

On 10/21/2011 9:00 AM, Yathindra wrote:
Ok Bryn is there a more elaborate document which shows simple
examples
to work with device mapper. For a newbie like me it would be really
helpful.


Thanks,
Yathi

On 10/21/2011 8:56 AM, Bryn M. Reeves wrote:

On 10/21/2011 03:47 PM, Yathindra wrote:

dmsetup create d0 --table="0 `blockdev --getsize /dev/sdb` delay
/dev/sdb 0 500"
dmsetup create f0 --table="0 `blockdev --getsize /dev/mapper/d0` flakey
/dev/mapper/d0 0 9 1"
mkfs -t ext3 /dev/mapper/f0
...
...
ext2fs_mkdir: Attempt to read block from filesystem resulted in short
read while creating root dir

Can we even mount such a device ?


It's a flakey device

With that table you'll have a device that is failing write I/Os for
1s in every ten. If that coincides with mkfs trying to write to the
device it will create a corrupted file system.


Depending on what you are trying to test you may want to put data on
the device first.


Regards,
Bryn.




--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-21-2011, 03:21 PM
"Bryn M. Reeves"
 
Default Simulating faulty disk

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.

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-21-2011, 04:33 PM
Yathindra
 
Default Simulating faulty disk

Is there any way we can create a regular scsi device and then
dynamically change its personality

to delay or flakey ?
Or
Is there a way to dynamically change the parameters of flakey/delay device.

So we can start with no errors and then we can inject some errors.

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.


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-22-2011, 06:16 AM
Yathindra
 
Default Simulating faulty disk

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.


--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 07:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org