Skip to contentSkip to conversation

How to use dm-cache-target?

DISCUSSION majianpeng 4 participants 6 messages Mar 11, 2013 – Mar 12, 2013 Device mapper

lore
Share & tools
lore

majianpeng

author
#0 lore raw

Hi all,
I am trying to use dm-cache-target on raid5.But i met a question.

Supposed: /dev/sdb1(5GB) is metadata; /dev/sdb2(20GB) is cache;/dev/md0 is raid5.

1:sutup my_cache
dmsetup create my_cache --table '0 41943040 cache /dev/sdb1 /dev/sdb2 /dev/md0 131072 1 writethrough default 0'

2:mkfs.ext4
mkfs.ext4 /dev/mapper/my_cache

3:mount
mount /dev/mapper/my_cache /media

4:the size of ext4 is 20GB,but the /dev/md0 is 4TB.

I think maybe my methods error. If so, how to do use?

BTW, for dm-cache is it support plug-and-play?

Thanks!
Jianpeng Ma

#1 lore raw
Quoted 7 lines · majianpeng

Hi all,
I am trying to use dm-cache-target on raid5.But i met a question.

Supposed: /dev/sdb1(5GB) is metadata; /dev/sdb2(20GB) is cache;/dev/md0 is raid5.

1:sutup my_cache
dmsetup create my_cache --table '0 41943040 cache /dev/sdb1 /dev/sdb2 /dev/md0 131072 1 writethrough default 0'

41943040 - This is 20G, you should use the size of /dev/md0 in sectors

Also I think your block size is way too big, try 2048 rather tha 131072.

Quoted 1 line

BTW, for dm-cache is it support plug-and-play?

No idea what you mean.

- Joe

#2 lore raw
Quoted 9 lines · On Mon, Mar 11, 2013 at 10:31:53AM +0000, [email protected] wrote:
Quoted 7 lines · majianpeng

Hi all,
I am trying to use dm-cache-target on raid5.But i met a question.

Supposed: /dev/sdb1(5GB) is metadata; /dev/sdb2(20GB) is cache;/dev/md0 is raid5.

1:sutup my_cache
dmsetup create my_cache --table '0 41943040 cache /dev/sdb1 /dev/sdb2 /dev/md0 131072 1 writethrough default 0'

Quoted 7 lines

41943040 - This is 20G, you should use the size of /dev/md0 in sectors

Also I think your block size is way too big, try 2048 rather tha 131072.

Quoted 1 line

BTW, for dm-cache is it support plug-and-play?

No idea what you mean.

I suspect the poster's asking if dmcaches will automatically reassemble themselves.

I've been wondering myself what's the status of the lvm-tools integration? :)

--D

Quoted 7 lines

- Joe

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

#3 lore raw

Dne 11.3.2013 18:04, Darrick J. Wong napsal(a):

Quoted 14 lines · On Mon, Mar 11, 2013 at 10:31:53AM +0000, [email protected] wrote:
Quoted 13 lines · majianpeng
Quoted 7 lines

Hi all,
I am trying to use dm-cache-target on raid5.But i met a question.

Supposed: /dev/sdb1(5GB) is metadata; /dev/sdb2(20GB) is cache;/dev/md0 is raid5.

1:sutup my_cache
dmsetup create my_cache --table '0 41943040 cache /dev/sdb1 /dev/sdb2 /dev/md0 131072 1 writethrough default 0'

41943040 - This is 20G, you should use the size of /dev/md0 in sectors

Also I think your block size is way too big, try 2048 rather tha 131072.

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

BTW, for dm-cache is it support plug-and-play?

No idea what you mean.

I suspect the poster's asking if dmcaches will automatically reassemble themselves.

I've been wondering myself what's the status of the lvm-tools integration? :)

On-going - will be integrated within some months.

Zdenek

#4 lore raw
In reply to Darrick J. Wong
Quoted 5 lines · Darrick J. Wong

On Mon, Mar 11, 2013 at 10:31:53AM +0000, [email protected] wrote:
I suspect the poster's asking if dmcaches will automatically reassemble themselves.

I've been wondering myself what's the status of the lvm-tools integration? :)

LVM changes at a glacial pace. Would it be helpful if I knocked up some tools to make it easier for people to play with this stuff?

- Joe

#5 lore raw
Quoted 9 lines · On Tue, Mar 12, 2013 at 01:27:56PM +0000, [email protected] wrote:
Quoted 5 lines · Darrick J. Wong

On Mon, Mar 11, 2013 at 10:31:53AM +0000, [email protected] wrote:
I suspect the poster's asking if dmcaches will automatically reassemble themselves.

I've been wondering myself what's the status of the lvm-tools integration? :)

LVM changes at a glacial pace. Would it be helpful if I knocked up some tools to make it easier for people to play with this stuff?

Well, we could possibly compare notes; here are some scripts that I've been using:
http://djwong.org/docs/dmcache-tools.tar.gz

dm-format-blockdev and dm-load-cache are the key ones. It also comes with udev rules to (I hope) make the cache win any /dev symlink wars, and automount the cache when all component devices are found. They work for me, but beware they might reflash your BIOS with rude poetry also. :)

--D

Quoted 7 lines

- Joe

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel