<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Xun,<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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?).<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Regardless, I will try to help.<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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.<br><br>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.<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">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).<br><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Doug<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 23, 2015 at 12:29 AM, Ni, Xun <span dir="ltr"><<a href="mailto:xun.ni@intel.com" target="_blank">xun.ni@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">






<div>
<font face="Calibri" size="2"><span style="font-size:11pt">
<div>Hi, all:</div>
<div> </div>
<div style="text-indent:9.6pt">I use device mapper to config a thin-provision for a block device, with dmsetup, with the following command:</div>
<div style="text-indent:9.6pt"> </div>
<div style="text-indent:9.6pt">Dmsetup create pool –table “0 `blockdev –getsize /dev/sdd1` thin-pool /dev/sdd2 /dev/sdd1 128 0”</div>
<div style="text-indent:9.6pt">Dmsetup message /dev/mapper/pool 0 “create_thin 0”</div>
<div style="text-indent:9.6pt">Dmsetup create snap1 –tabe “0 `blockdev –getsize /dev/sdd3` thin /dev/mapper/pool 0 /dev/sdd3”</div>
<div style="text-indent:9.6pt"> </div>
<div style="text-indent:9.6pt">Everything works well, but when I reboot the system, the block device is gone, I need to create the pool again…</div>
<div style="text-indent:9.6pt"> </div>
<div style="text-indent:9.6pt">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.</div>
<div><font face="Times New Roman"> </font></div>
<div>Thanks,</div>
<div>Xun </div>
<div><font face="Times New Roman"> </font></div>
</span></font>
</div>

<br>--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Doug Dumitru<br>EasyCo LLC<br></div>
</div>