All of lore.kernel.org
 help / color / mirror / Atom feed
* creating two device mapper files for an underline blockdevice
@ 2011-11-01  6:08 Sanjana Shari
  2011-11-01  6:10 ` Sanjana Shari
  2011-11-01  8:31 ` Milan Broz
  0 siblings, 2 replies; 7+ messages in thread
From: Sanjana Shari @ 2011-11-01  6:08 UTC (permalink / raw)
  To: dm-devel


[-- Attachment #1.1: Type: text/plain, Size: 1513 bytes --]

Hello,

I am trying to create two device mapper files for an underline blockdevice.
One file( half1) will be mapped to the first half of the block-device. and
the second half (half2) will be mapped to the rest of the space in the same
block device.

1.Using dd command I have created a 100 MB file.

# dd if=/dev/zero of=dm_test bs=512 count=204800

2. associated it with loop device:
# losetup /dev/loop0 /tmp/dm_test

# blockdev --getsize /dev/loop0
204800

using dmsetup to create dm file.
# dmsetup create half --table "0 102400 linear /dev/loop0 0"

[root@bladelinux01 root]# dmsetup table half
0 102400 linear 7:0 0
[root@bladelinux01 root]# dmsetup info half
Name:              half
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 6
Number of targets: 1


[root@bladelinux01 root]# ls -l /dev/mapper/half
lrwxrwxrwx. 1 root root 7 Nov  1 01:44 /dev/mapper/half -> ../dm-6

But if I use the other part of the disk to map. The command is not
successful

[root@bladelinux01 root]#  dmsetup create half1 --table "102401 102399
linear /dev/loop0 102400"
device-mapper: reload ioctl failed: Invalid argument
Command failed

[root@bladelinux01 root]#  dmsetup create half1 --table "102401 102399
linear /dev/loop0 0"
device-mapper: reload ioctl failed: Invalid argument
Command failed

The format used seems to be correct according to the man page of dmsetup.
Please guide me. I am not sure what am I missing.

-- sanjana

[-- Attachment #1.2: Type: text/html, Size: 5387 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: creating two device mapper files for an underline blockdevice
  2011-11-01  6:08 creating two device mapper files for an underline blockdevice Sanjana Shari
@ 2011-11-01  6:10 ` Sanjana Shari
  2011-11-01  8:31 ` Milan Broz
  1 sibling, 0 replies; 7+ messages in thread
From: Sanjana Shari @ 2011-11-01  6:10 UTC (permalink / raw)
  To: dm-devel; +Cc: sanjana.linux


[-- Attachment #1.1: Type: text/plain, Size: 1734 bytes --]

Please do put me in cc list while replying.

On Tue, Nov 1, 2011 at 11:38 AM, Sanjana Shari <sanjana.linux@gmail.com>wrote:

> Hello,
>
> I am trying to create two device mapper files for an underline
> blockdevice. One file( half1) will be mapped to the first half of the
> block-device. and the second half (half2) will be mapped to the rest of the
> space in the same block device.
>
> 1.Using dd command I have created a 100 MB file.
>
> # dd if=/dev/zero of=dm_test bs=512 count=204800
>
> 2. associated it with loop device:
> # losetup /dev/loop0 /tmp/dm_test
>
> # blockdev --getsize /dev/loop0
> 204800
>
> using dmsetup to create dm file.
> # dmsetup create half --table "0 102400 linear /dev/loop0 0"
>
> [root@bladelinux01 root]# dmsetup table half
> 0 102400 linear 7:0 0
> [root@bladelinux01 root]# dmsetup info half
> Name:              half
> State:             ACTIVE
> Read Ahead:        256
> Tables present:    LIVE
> Open count:        0
> Event number:      0
> Major, minor:      253, 6
> Number of targets: 1
>
>
> [root@bladelinux01 root]# ls -l /dev/mapper/half
> lrwxrwxrwx. 1 root root 7 Nov  1 01:44 /dev/mapper/half -> ../dm-6
>
> But if I use the other part of the disk to map. The command is not
> successful
>
> [root@bladelinux01 root]#  dmsetup create half1 --table "102401 102399
> linear /dev/loop0 102400"
> device-mapper: reload ioctl failed: Invalid argument
> Command failed
>
> [root@bladelinux01 root]#  dmsetup create half1 --table "102401 102399
> linear /dev/loop0 0"
> device-mapper: reload ioctl failed: Invalid argument
> Command failed
>
> The format used seems to be correct according to the man page of dmsetup.
> Please guide me. I am not sure what am I missing.
>
> -- sanjana
>
>

[-- Attachment #1.2: Type: text/html, Size: 5667 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: creating two device mapper files for an underline blockdevice
  2011-11-01  6:08 creating two device mapper files for an underline blockdevice Sanjana Shari
  2011-11-01  6:10 ` Sanjana Shari
@ 2011-11-01  8:31 ` Milan Broz
  2011-11-01 16:52   ` Sanjana Shari
  1 sibling, 1 reply; 7+ messages in thread
From: Milan Broz @ 2011-11-01  8:31 UTC (permalink / raw)
  To: device-mapper development; +Cc: Sanjana Shari

On 11/01/2011 07:08 AM, Sanjana Shari wrote:

> But if I use the other part of the disk to map. The command is not successful
> 
> [root@bladelinux01 root]#  dmsetup create half1 --table "102401 102399 linear /dev/loop0 102400"
> device-mapper: reload ioctl failed: Invalid argument
> Command failed

You have to always map the whole table (starting at sector 0).
If you see syslog, you can see why
  device-mapper: table: 254:2: linear: Gap in table
  device-mapper: ioctl: error adding target to table

Anyway, for the info how it works, example how to switch active table:

1. create linear device mapped to /dev/sdb

  # dmsetup create x --table "0 10000 linear /dev/sdb 0"
  # dmsetup table x
  0 10000 linear 8:16 0

2. Remap the first half of device to another target, here "error"

 - load new (yet inactive) table
 # echo -e "0 5000 error\n5000 10000 linear /dev/sdb 5000" | dmsetup load x                                      

 - so now you have one active table and one inactive (prepared for switch)
 # dmsetup table x
 0 10000 linear 8:16 0

 # dmsetup table x --inactive
 0 5000 error 
 5000 10000 linear 8:16 5000

3. switch to new (inactive) table (note that "dmsetup suspend" here is implicit)
  # dmsetup resume x

  # dmsetup table x
  0 5000 error 
  5000 10000 linear 8:16 5000


If you want more info about this low level DM operation, read
http://people.redhat.com/agk/talks/FOSDEM_2005/
http://mbroz.fedorapeople.org/talks/DeviceMapperBasics/
(old, but still useful, I hope :-)

Milan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: creating two device mapper files for an underline blockdevice
  2011-11-01  8:31 ` Milan Broz
@ 2011-11-01 16:52   ` Sanjana Shari
  2011-11-01 17:10     ` Sanjana Shari
  0 siblings, 1 reply; 7+ messages in thread
From: Sanjana Shari @ 2011-11-01 16:52 UTC (permalink / raw)
  To: Milan Broz, device-mapper development; +Cc: sanjana.linux


[-- Attachment #1.1: Type: text/plain, Size: 5762 bytes --]

Hi Milan,

Thanks for the documentation links... it was useful.. one of the link I had
gone through it earlier.

Couple of questions more which I would post here...

Mapping the second half of the first device + the another device to create
a new map. here I ma not mapping the whole of first disk. Or I ma not
mapping the whole table, but still device creation is sucessfull.
[root@bladelinux01 ~]# losetup -a
/dev/loop0: [fd03]:2359319 (/root/dm/dm_test)
/dev/loop1: [fd03]:2359321 (/root/dm/dm_test1)
[root@bladelinux01 ~]# blockdev --getsize /dev/loop0
204800  < ------ 100 M
[root@bladelinux01 ~]# blockdev --getsize /dev/loop1
204800  < ------ 100 M

Using first half of the block device /dev/loop0. Here I have mapped the
table from 0 to 102400 sectors.

[root@bladelinux01 ~]# fdisk -lus /dev/loop0

Disk /dev/loop0: 104 MB, 104857600 bytes
255 heads, 63 sectors/track, 12 cylinders, total 204800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Command is successful.... as expected.

[root@bladelinux01 ~]# dmsetup create firsthalf --table "0 102400 linear
/dev/loop0 0"
[root@bladelinux01 ~]# dmsetup table firsthalf
0 102400 linear 7:0 0
[root@bladelinux01 ~]# dmsetup info firsthalf
Name:              firsthalf
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 6
Number of targets: 1

Now here I am creating a new device named "anotherhalf_plus_otherdisk" by
mapping the remaining first half of the first disk and then the whole of a
second block device /dev/loop1.

Creating table to use with dmsetup.
[root@bladelinux01 ~]# echo 0 102400 linear /dev/loop0 102400 > table
[root@bladelinux01 ~]# cat table
0 102400 linear /dev/loop0 102400
[root@bladelinux01 ~]# echo 102400 204800 linear /dev/loop1 0 >>table
[root@bladelinux01 ~]# cat table
0 102400 linear /dev/loop0 102400
102400 204800 linear /dev/loop1 0
[root@bladelinux01 ~]# dmsetup create anotherhalf_plus_otherdisk table
[root@bladelinux01 ~]# dmsetup table anotherhalf_plus_otherdisk
0 102400 linear 7:0 102400
102400 204800 linear 7:1 0
[root@bladelinux01 ~]# dmsetup info anotherhalf_plus_otherdisk
Name:              anotherhalf_plus_otherdisk
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 7
Number of targets: 2

device created with size as expected. Agian here I haven't used the start
sector as "0" for the second block device,
I have used "102400"th sector to start from, which I believe should be
continuation of the previous logical sector. < --- Please this part.
[root@bladelinux01 ~]# blockdev --getsize
/dev/mapper/anotherhalf_plus_otherdisk
307200

[root@bladelinux01 ~]# fdisk -lus /dev/mapper/anotherhalf_plus_otherdisk

Disk /dev/mapper/anotherhalf_plus_otherdisk: 157 MB, 157286400 bytes
255 heads, 63 sectors/track, 19 cylinders, total 307200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Here I have some doubts which needs to be cleared to get a thorough
understanding.
My questions:

The table format to be used is as follows from man page of dmsetup.
Each line of the table specifies a single target and is of the form:
logical_start_sector    num_sectors    target_type target_args

Here:
"logical_start_sector" start sector should be "0" for the start of any
block device, rather I would say for the start of any new map would e more
appropriate. What do you say...?
"num_sectors" as name suggestes would be the number of sectors, which would
contribute to the size of the end mapped device.

For target type "linear" we use arguments as the following:
destination_device   start_sector   < -------- here which is the start
sector..?
Is it the logical start scetor of the blockdevice or the physical sector of
the blockdevice...? Or how do we define it...? This part is not yet clear
to me.



On Tue, Nov 1, 2011 at 2:01 PM, Milan Broz <mbroz@redhat.com> wrote:

> On 11/01/2011 07:08 AM, Sanjana Shari wrote:
>
> > But if I use the other part of the disk to map. The command is not
> successful
> >
> > [root@bladelinux01 root]#  dmsetup create half1 --table "102401 102399
> linear /dev/loop0 102400"
> > device-mapper: reload ioctl failed: Invalid argument
> > Command failed
>
> You have to always map the whole table (starting at sector 0).
> If you see syslog, you can see why
>  device-mapper: table: 254:2: linear: Gap in table
>  device-mapper: ioctl: error adding target to table
>
> Anyway, for the info how it works, example how to switch active table:
>
> 1. create linear device mapped to /dev/sdb
>
>  # dmsetup create x --table "0 10000 linear /dev/sdb 0"
>  # dmsetup table x
>  0 10000 linear 8:16 0
>
> 2. Remap the first half of device to another target, here "error"
>
>  - load new (yet inactive) table
>  # echo -e "0 5000 error\n5000 10000 linear /dev/sdb 5000" | dmsetup load x
>
>  - so now you have one active table and one inactive (prepared for switch)
>  # dmsetup table x
>  0 10000 linear 8:16 0
>
>  # dmsetup table x --inactive
>  0 5000 error
>  5000 10000 linear 8:16 5000
>
> 3. switch to new (inactive) table (note that "dmsetup suspend" here is
> implicit)
>  # dmsetup resume x
>
>  # dmsetup table x
>  0 5000 error
>  5000 10000 linear 8:16 5000
>
>
> If you want more info about this low level DM operation, read
> http://people.redhat.com/agk/talks/FOSDEM_2005/
> http://mbroz.fedorapeople.org/talks/DeviceMapperBasics/
> (old, but still useful, I hope :-)
>
> Milan
>

[-- Attachment #1.2: Type: text/html, Size: 6854 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: creating two device mapper files for an underline blockdevice
  2011-11-01 16:52   ` Sanjana Shari
@ 2011-11-01 17:10     ` Sanjana Shari
  2011-11-02  7:57       ` Milan Broz
  0 siblings, 1 reply; 7+ messages in thread
From: Sanjana Shari @ 2011-11-01 17:10 UTC (permalink / raw)
  To: Milan Broz, device-mapper development; +Cc: sanjana.linux


[-- Attachment #1.1: Type: text/plain, Size: 7243 bytes --]

Hi,

In an another example:

[root@bladelinux01 ~]# dmsetup table firsthalf
0 102400 linear 7:0 0

Using the remaining of first half of the same blockdevice /dev/loop0. This
seems to work. So I ma confused here how the mapping works..
[root@bladelinux01 ~]# dmsetup create x --table "0 102400 linear /dev/loop0
102400"
[root@bladelinux01 ~]# dmsetup table x
0 102400 linear 7:0 102400
[root@bladelinux01 ~]# dmsetup table firsthalf
0 102400 linear 7:0 0
[root@bladelinux01 ~]# dmsetup table x
0 102400 linear 7:0 102400
[root@bladelinux01 ~]# dmsetup deps x
1 dependencies  : (7, 0)
[root@bladelinux01 ~]# dmsetup deps firsthalf
1 dependencies  : (7, 0)
[root@bladelinux01 ~]# dmsetup info x
Name:              x
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 7
Number of targets: 1

[root@bladelinux01 ~]# dmsetup info firsthalf
Name:              firsthalf
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      0
Major, minor:      253, 6
Number of targets: 1

--sanjana

On Tue, Nov 1, 2011 at 10:22 PM, Sanjana Shari <sanjana.linux@gmail.com>wrote:

> Hi Milan,
>
> Thanks for the documentation links... it was useful.. one of the link I
> had gone through it earlier.
>
> Couple of questions more which I would post here...
>
> Mapping the second half of the first device + the another device to create
> a new map. here I ma not mapping the whole of first disk. Or I ma not
> mapping the whole table, but still device creation is sucessfull.
> [root@bladelinux01 ~]# losetup -a
> /dev/loop0: [fd03]:2359319 (/root/dm/dm_test)
> /dev/loop1: [fd03]:2359321 (/root/dm/dm_test1)
> [root@bladelinux01 ~]# blockdev --getsize /dev/loop0
> 204800  < ------ 100 M
> [root@bladelinux01 ~]# blockdev --getsize /dev/loop1
> 204800  < ------ 100 M
>
> Using first half of the block device /dev/loop0. Here I have mapped the
> table from 0 to 102400 sectors.
>
> [root@bladelinux01 ~]# fdisk -lus /dev/loop0
>
> Disk /dev/loop0: 104 MB, 104857600 bytes
> 255 heads, 63 sectors/track, 12 cylinders, total 204800 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x00000000
>
> Command is successful.... as expected.
>
> [root@bladelinux01 ~]# dmsetup create firsthalf --table "0 102400 linear
> /dev/loop0 0"
> [root@bladelinux01 ~]# dmsetup table firsthalf
>
> 0 102400 linear 7:0 0
> [root@bladelinux01 ~]# dmsetup info firsthalf
> Name:              firsthalf
>
> State:             ACTIVE
> Read Ahead:        256
> Tables present:    LIVE
> Open count:        0
> Event number:      0
> Major, minor:      253, 6
> Number of targets: 1
>
> Now here I am creating a new device named "anotherhalf_plus_otherdisk" by
> mapping the remaining first half of the first disk and then the whole of a
> second block device /dev/loop1.
>
> Creating table to use with dmsetup.
> [root@bladelinux01 ~]# echo 0 102400 linear /dev/loop0 102400 > table
> [root@bladelinux01 ~]# cat table
> 0 102400 linear /dev/loop0 102400
> [root@bladelinux01 ~]# echo 102400 204800 linear /dev/loop1 0 >>table
> [root@bladelinux01 ~]# cat table
> 0 102400 linear /dev/loop0 102400
> 102400 204800 linear /dev/loop1 0
> [root@bladelinux01 ~]# dmsetup create anotherhalf_plus_otherdisk table
> [root@bladelinux01 ~]# dmsetup table anotherhalf_plus_otherdisk
> 0 102400 linear 7:0 102400
> 102400 204800 linear 7:1 0
> [root@bladelinux01 ~]# dmsetup info anotherhalf_plus_otherdisk
> Name:              anotherhalf_plus_otherdisk
>
> State:             ACTIVE
> Read Ahead:        256
> Tables present:    LIVE
> Open count:        0
> Event number:      0
> Major, minor:      253, 7
> Number of targets: 2
>
> device created with size as expected. Agian here I haven't used the start
> sector as "0" for the second block device,
> I have used "102400"th sector to start from, which I believe should be
> continuation of the previous logical sector. < --- Please this part.
> [root@bladelinux01 ~]# blockdev --getsize
> /dev/mapper/anotherhalf_plus_otherdisk
> 307200
>
> [root@bladelinux01 ~]# fdisk -lus /dev/mapper/anotherhalf_plus_otherdisk
>
> Disk /dev/mapper/anotherhalf_plus_otherdisk: 157 MB, 157286400 bytes
> 255 heads, 63 sectors/track, 19 cylinders, total 307200 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x00000000
>
> Here I have some doubts which needs to be cleared to get a thorough
> understanding.
> My questions:
>
> The table format to be used is as follows from man page of dmsetup.
> Each line of the table specifies a single target and is of the form:
> logical_start_sector    num_sectors    target_type target_args
>
> Here:
> "logical_start_sector" start sector should be "0" for the start of any
> block device, rather I would say for the start of any new map would e more
> appropriate. What do you say...?
> "num_sectors" as name suggestes would be the number of sectors, which
> would contribute to the size of the end mapped device.
>
> For target type "linear" we use arguments as the following:
> destination_device   start_sector   < -------- here which is the start
> sector..?
> Is it the logical start scetor of the blockdevice or the physical sector
> of the blockdevice...? Or how do we define it...? This part is not yet
> clear to me.
>
>
>
>
> On Tue, Nov 1, 2011 at 2:01 PM, Milan Broz <mbroz@redhat.com> wrote:
>
>> On 11/01/2011 07:08 AM, Sanjana Shari wrote:
>>
>> > But if I use the other part of the disk to map. The command is not
>> successful
>> >
>> > [root@bladelinux01 root]#  dmsetup create half1 --table "102401 102399
>> linear /dev/loop0 102400"
>> > device-mapper: reload ioctl failed: Invalid argument
>> > Command failed
>>
>> You have to always map the whole table (starting at sector 0).
>> If you see syslog, you can see why
>>  device-mapper: table: 254:2: linear: Gap in table
>>  device-mapper: ioctl: error adding target to table
>>
>> Anyway, for the info how it works, example how to switch active table:
>>
>> 1. create linear device mapped to /dev/sdb
>>
>>  # dmsetup create x --table "0 10000 linear /dev/sdb 0"
>>  # dmsetup table x
>>  0 10000 linear 8:16 0
>>
>> 2. Remap the first half of device to another target, here "error"
>>
>>  - load new (yet inactive) table
>>  # echo -e "0 5000 error\n5000 10000 linear /dev/sdb 5000" | dmsetup load
>> x
>>
>>  - so now you have one active table and one inactive (prepared for switch)
>>  # dmsetup table x
>>  0 10000 linear 8:16 0
>>
>>  # dmsetup table x --inactive
>>  0 5000 error
>>  5000 10000 linear 8:16 5000
>>
>> 3. switch to new (inactive) table (note that "dmsetup suspend" here is
>> implicit)
>>  # dmsetup resume x
>>
>>  # dmsetup table x
>>  0 5000 error
>>  5000 10000 linear 8:16 5000
>>
>>
>> If you want more info about this low level DM operation, read
>> http://people.redhat.com/agk/talks/FOSDEM_2005/
>> http://mbroz.fedorapeople.org/talks/DeviceMapperBasics/
>> (old, but still useful, I hope :-)
>>
>> Milan
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 8584 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: creating two device mapper files for an underline blockdevice
  2011-11-01 17:10     ` Sanjana Shari
@ 2011-11-02  7:57       ` Milan Broz
  2011-11-02 12:32         ` Sanjana
  0 siblings, 1 reply; 7+ messages in thread
From: Milan Broz @ 2011-11-02  7:57 UTC (permalink / raw)
  To: device-mapper development; +Cc: Sanjana Shari

On 11/01/2011 06:10 PM, Sanjana Shari wrote:
> Using the remaining of first half of the same blockdevice /dev/loop0.
> This seems to work. So I ma confused here how the mapping works..

There is no magic for linear mapping.
Imagine you have this mapping table

0 8 linear /dev/sdb 1000
8 8 linear /dev/sdc 500

It means you created 16 sectors device consisting of two segments.

First half (sectors 0-7) is mapped to /dev/sdb starting at sector 10000.
(IOW sectors 0-7 of newly mapped device is mapped to sectors 10000-10007 of /dev/sdb)

Second half (sectors 8-15) is mapped to /dev/sdc starting at sector 500.

See dmsetup man page, where linear mapping is described.
Just do not confuse source and destination device offset.

Milan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: creating two device mapper files for an underline blockdevice
  2011-11-02  7:57       ` Milan Broz
@ 2011-11-02 12:32         ` Sanjana
  0 siblings, 0 replies; 7+ messages in thread
From: Sanjana @ 2011-11-02 12:32 UTC (permalink / raw)
  To: Milan Broz; +Cc: device-mapper development


[-- Attachment #1.1: Type: text/plain, Size: 926 bytes --]

Thanks Milan,

That clears my confusion.. need to read more doc... :)

--sanjana

On Wed, Nov 2, 2011 at 1:27 PM, Milan Broz <mbroz@redhat.com> wrote:

> On 11/01/2011 06:10 PM, Sanjana Shari wrote:
> > Using the remaining of first half of the same blockdevice /dev/loop0.
> > This seems to work. So I ma confused here how the mapping works..
>
> There is no magic for linear mapping.
> Imagine you have this mapping table
>
> 0 8 linear /dev/sdb 1000
> 8 8 linear /dev/sdc 500
>
> It means you created 16 sectors device consisting of two segments.
>
> First half (sectors 0-7) is mapped to /dev/sdb starting at sector 10000.
> (IOW sectors 0-7 of newly mapped device is mapped to sectors 10000-10007
> of /dev/sdb)
>
> Second half (sectors 8-15) is mapped to /dev/sdc starting at sector 500.
>
> See dmsetup man page, where linear mapping is described.
> Just do not confuse source and destination device offset.
>
> Milan
>

[-- Attachment #1.2: Type: text/html, Size: 1319 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-02 12:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01  6:08 creating two device mapper files for an underline blockdevice Sanjana Shari
2011-11-01  6:10 ` Sanjana Shari
2011-11-01  8:31 ` Milan Broz
2011-11-01 16:52   ` Sanjana Shari
2011-11-01 17:10     ` Sanjana Shari
2011-11-02  7:57       ` Milan Broz
2011-11-02 12:32         ` Sanjana

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.