* A small question about Device Mapper
@ 2015-08-23 7:29 Ni, Xun
2015-08-23 15:01 ` Doug Dumitru
2015-08-24 0:22 ` Mike Snitzer
0 siblings, 2 replies; 4+ messages in thread
From: Ni, Xun @ 2015-08-23 7:29 UTC (permalink / raw)
To: dm-devel@redhat.com
[-- Attachment #1.1: Type: text/plain, Size: 644 bytes --]
Hi, all:
I use device mapper to config a thin-provision for a block device, with dmsetup, with the following command:
Dmsetup create pool -table "0 `blockdev -getsize /dev/sdd1` thin-pool /dev/sdd2 /dev/sdd1 128 0"
Dmsetup message /dev/mapper/pool 0 "create_thin 0"
Dmsetup create snap1 -tabe "0 `blockdev -getsize /dev/sdd3` thin /dev/mapper/pool 0 /dev/sdd3"
Everything works well, but when I reboot the system, the block device is gone, I need to create the pool again...
Anyone has idea on how to make this config persistent? I need to boot the kernel , the dm pool device shows after the MD device found.
Thanks,
Xun
[-- Attachment #1.2: Type: text/html, Size: 1631 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A small question about Device Mapper
2015-08-23 7:29 A small question about Device Mapper Ni, Xun
@ 2015-08-23 15:01 ` Doug Dumitru
2015-08-24 0:22 ` Mike Snitzer
1 sibling, 0 replies; 4+ messages in thread
From: Doug Dumitru @ 2015-08-23 15:01 UTC (permalink / raw)
To: device-mapper development
[-- Attachment #1.1: Type: text/plain, Size: 1940 bytes --]
Xun,
This is a little off-topic for this list. Device mapper is the low level
structure to create the devices. Configuration is done in user space and
is more a topic for system startup people (is there a sysinit list?).
Regardless, I will try to help.
Exactly how and where you do this depends a lot of your environment and
when you need the dm device to become available. You basically have to
include your dmsetup command in the startup scripts early enough to meet
your needs.
In some cases, this might be all the way into initramfs (or initrd
depending on your distro). This would start the dm device before even your
root file system mounted.
You might be able to start the device later, which implies a system
"service" that runs as a part of the boot. If you can take the start very
late, you might want to consider just adding it to rc.local (most distros
still support this), which runs last. This would go into
/etc/init.d/rc.local (again, your distro may vary).
Doug
On Sun, Aug 23, 2015 at 12:29 AM, Ni, Xun <xun.ni@intel.com> wrote:
> Hi, all:
>
> I use device mapper to config a thin-provision for a block device, with
> dmsetup, with the following command:
>
> Dmsetup create pool –table “0 `blockdev –getsize /dev/sdd1` thin-pool
> /dev/sdd2 /dev/sdd1 128 0”
> Dmsetup message /dev/mapper/pool 0 “create_thin 0”
> Dmsetup create snap1 –tabe “0 `blockdev –getsize /dev/sdd3` thin
> /dev/mapper/pool 0 /dev/sdd3”
>
> Everything works well, but when I reboot the system, the block device is
> gone, I need to create the pool again…
>
> Anyone has idea on how to make this config persistent? I need to boot the
> kernel , the dm pool device shows after the MD device found.
>
> Thanks,
> Xun
>
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>
--
Doug Dumitru
EasyCo LLC
[-- Attachment #1.2: Type: text/html, Size: 3588 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A small question about Device Mapper
2015-08-23 7:29 A small question about Device Mapper Ni, Xun
2015-08-23 15:01 ` Doug Dumitru
@ 2015-08-24 0:22 ` Mike Snitzer
2015-08-24 3:20 ` Ni, Xun
1 sibling, 1 reply; 4+ messages in thread
From: Mike Snitzer @ 2015-08-24 0:22 UTC (permalink / raw)
To: Ni, Xun; +Cc: dm-devel@redhat.com
On Sun, Aug 23 2015 at 3:29am -0400,
Ni, Xun <xun.ni@intel.com> wrote:
> Hi, all:
>
> I use device mapper to config a thin-provision for a block device, with dmsetup, with the following command:
>
> Dmsetup create pool -table "0 `blockdev -getsize /dev/sdd1` thin-pool /dev/sdd2 /dev/sdd1 128 0"
> Dmsetup message /dev/mapper/pool 0 "create_thin 0"
> Dmsetup create snap1 -tabe "0 `blockdev -getsize /dev/sdd3` thin /dev/mapper/pool 0 /dev/sdd3"
>
> Everything works well, but when I reboot the system, the block device is gone, I need to create the pool again...
>
> Anyone has idea on how to make this config persistent? I need to boot the kernel , the dm pool device shows after the MD device found.
use lvm to create a thinp device that activates on bootup (see lvmthin
manpage).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A small question about Device Mapper
2015-08-24 0:22 ` Mike Snitzer
@ 2015-08-24 3:20 ` Ni, Xun
0 siblings, 0 replies; 4+ messages in thread
From: Ni, Xun @ 2015-08-24 3:20 UTC (permalink / raw)
To: Mike Snitzer; +Cc: dm-devel@redhat.com
Thank you for helping me. I already get it, LVM seems better than dmsetup...
Xun
-----Original Message-----
From: Mike Snitzer [mailto:snitzer@redhat.com]
Sent: Monday, August 24, 2015 8:22 AM
To: Ni, Xun
Cc: dm-devel@redhat.com
Subject: Re: A small question about Device Mapper
On Sun, Aug 23 2015 at 3:29am -0400,
Ni, Xun <xun.ni@intel.com> wrote:
> Hi, all:
>
> I use device mapper to config a thin-provision for a block device, with dmsetup, with the following command:
>
> Dmsetup create pool -table "0 `blockdev -getsize /dev/sdd1` thin-pool /dev/sdd2 /dev/sdd1 128 0"
> Dmsetup message /dev/mapper/pool 0 "create_thin 0"
> Dmsetup create snap1 -tabe "0 `blockdev -getsize /dev/sdd3` thin /dev/mapper/pool 0 /dev/sdd3"
>
> Everything works well, but when I reboot the system, the block device is gone, I need to create the pool again...
>
> Anyone has idea on how to make this config persistent? I need to boot the kernel , the dm pool device shows after the MD device found.
use lvm to create a thinp device that activates on bootup (see lvmthin manpage).
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-24 3:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-23 7:29 A small question about Device Mapper Ni, Xun
2015-08-23 15:01 ` Doug Dumitru
2015-08-24 0:22 ` Mike Snitzer
2015-08-24 3:20 ` Ni, Xun
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.