[dm-devel] Proper dm-cache shutdown

Kyle Manna kyle.manna at gmail.com
Wed Jun 19 01:39:48 UTC 2013


Hi,

What is the proper shutdown sequence for dm-cache?  Should I be
disassembling the dm device everytime?

There is a section in Documentation/device-mapper/cache.txt that
suggests that I should:

    The 'dirty' state for a cache block changes far too frequently for us
    to keep updating it on the fly.  So we treat it as a hint.  In normal
    operation it will be written when the dm device is suspended.  If the
    system crashes all cache blocks will be assumed dirty when restarted.

Right now I'm using the following:

    (wait for standard init system to unmount the filesystem)
    dmsetup suspend home-cached
    dmsetup remove home-cached
    dmsetup remove ssd-blocks
    dmsetup remove ssd-metadata

I assume the suspend will accomplish the syncing of the metadata
according to the Docs.  Is tearing down the dm nodes under it of any
value during a shutdown or reboot?

Thanks,
- Kyle




More information about the dm-devel mailing list