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

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.