Error opening origin device & error adding target to table

749 views
Skip to first unread message

awye...@gmail.com

unread,
Jun 15, 2013, 5:46:47 AM6/15/13
to dm-c...@googlegroups.com
Hi,

I'm trying to setup dm-cache with kernel 3.9.6. The system is setup with KVM virtualization for internal use

OS
CentOS 6.4 64bit (kernel 3.9.6)

Hardware
1 x 60GB SSD with 2 partitions (30GB for boot and 25GB for caching)
2 x 1TB HDD in onboard RAID1 mode.


[root@my ~]# pvscan
  PV /dev/sda2      VG cache   lvm2 [20.89 GiB / 20.89 GiB free]   <<<  SSD physical volume for caching
  PV /dev/md127p2   VG vps     lvm2 [927.51 GiB / 867.51 GiB free]  <<<< RAID1 HDD physical volume for VPS
  Total: 2 [948.40 GiB] / in use: 2 [948.40 GiB] / in no VG: 0 [0   ]

 [root@my ~]vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "cache" using metadata type lvm2
  Found volume group "vps" using metadata type lvm2

[root@my ~]# lvscan
  ACTIVE            '/dev/vps/OSTemplate' [60.00 GiB] inherit   <<<  existing LVM to store OS template for KVM VPS



[root@my ~]# fdisk -l

Disk /dev/sda: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000adf0f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        4569    36699468+  83  Linux
/dev/sda2            4570        7297    21912660   83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ce00d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         523     4194304   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sdb2             523      121601   972564480   8e  Linux LVM

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ce00d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1         523     4194304   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sdc2             523      121601   972564480   8e  Linux LVM

Disk /dev/md127: 1000.2 GB, 1000202043392 bytes
2 heads, 4 sectors/track, 244189952 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ce00d

      Device Boot      Start         End      Blocks   Id  System
/dev/md127p1             257     1048832     4194304   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/md127p2         1048833   244189952   972564480   8e  Linux LVM
Partition 2 does not end on cylinder boundary.


I managed to get the kernel work with dm-cache and the module basically loaded. But unfortunately I failed when try to create cache:


[root@my ~]# perl dmcache.pl -o /dev/md127p2 -c /dev/sda2 -n mycache -p
Operator or semicolon missing before &__inline at (eval 104) line 1.
Ambiguous use of & resolved as operator & at (eval 104) line 1.
echo 0 1945128960 cache /dev/md127p2 /dev/sda2 1 | dmsetup create mycache
device-mapper: reload ioctl on mycache failed: No such file or directory
Command failed

[root@my ~]# dmesg | grep device-mapper
device-mapper: cache: Metadata device md127p2 is larger than 33423360 sectors: excess space will not be used.
device-mapper: table: 253:1: cache: Error opening origin device
device-mapper: ioctl: error adding target to table


When I tried to reduce the sectors size to 33423360, I get:

device-mapper: reload ioctl on mycache failed: No such file or directory
Command failed

again, the same log observed:

[root@my ~]# dmesg | grep device-mapper
device-mapper: cache: Metadata device md127p2 is larger than 33423360 sectors: excess space will not be used.
device-mapper: table: 253:1: cache: Error opening origin device
device-mapper: ioctl: error adding target to table

When tried again by change the device to device md127, the following error found:

echo 0 33423360 cache /dev/md127 /dev/sda2 1 | dmsetup create mycache
device-mapper: reload ioctl on mycache failed: Device or resource busy
Command failed

but now the meta device error gone:

[root@my ~]# dmesg | grep device-mapper
device-mapper: table: 253:1: cache: Error opening metadata device
device-mapper: ioctl: error adding target to table


Until this stage I'm still unable to create cache on SSD. I'd appreciate if anyone can point out my mistake to make this ssd caching work. 
Thanks in advance.

Regards,
Aw Yeong

Gregory Jean-baptise

unread,
Jun 18, 2013, 12:05:28 PM6/18/13
to dm-c...@googlegroups.com, awye...@gmail.com
It appears that you may be using the built-in kernel 3.9 dm-cache, which is different from our dm-cache module. If that is the case, try looking into the proper use of the official dm-cache module. If that is not the case, try: 

echo 0 1945128960 cache /dev/md127p2 /dev/sda2 0 | dmsetup create mycache 

Let us know if anything comes up.

awye...@gmail.com

unread,
Jun 18, 2013, 12:09:25 PM6/18/13
to dm-c...@googlegroups.com, awye...@gmail.com
Hi,

Thanks for your reply.
That come up with:

[root@test ~]# echo 0 1945128960 cache /dev/md127p2 /dev/sda2 0 | dmsetup create mycache
device-mapper: reload ioctl on mycache failed: Invalid argument
Command failed

Gregory Jean-baptise

unread,
Jun 18, 2013, 12:45:17 PM6/18/13
to dm-c...@googlegroups.com
Alright. Remove the last 0 I place there, as in:

echo 0 1945128960 cache /dev/md127p2 /dev/sda2 | dmsetup create mycache 

Let me know how that goes.


--
You received this message because you are subscribed to the Google Groups "dm-cache" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dm-cache+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Gregory Jean-Baptiste
Undergraduate Research Assistant @ V.I.S.A
Florida International University
Reply all
Reply to author
Forward
0 new messages