dmsetup fails to delete device

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have Ubuntu 16.04 host with Ubuntu 17.10 guest in KVM (Virtual Machine Manager 1.3.2). This VM has a raw virtual HDD (/dev/vdb) with 10GB capacity.



I use dmsetup util to create 2 extents 5GB each from this disk:



dmsetup create disk0_extent0 --table '0 10485760 linear /dev/vdb 0'



dmsetup create disk0_extent1 --table '0 10485760 linear /dev/vdb 10485760



As a result, an error occurs:



device-mapper: create ioctl on disk0_extent0 failed: Device or resource busy
Command failed



However, disk0_extent0 could not be seen by lsblk before or after the operation. Furthermore, I try deletion and explicit meta deletion:



dmsetup remove -f --retry /dev/mapper/disk0_extent0 (which tells me many times No storage object named disk0_extent0)



dmsetup clear /dev/mapper/disk0_extent0



dmsetup wipe_table /dev/mapper/disk0_extent0



Even though everything looks like we have no device (lsblk still does not show it), dmsetup sees it a different way:



# dmsetup info /dev/mapper/disk0_extent0
Name: disk0_extent0
State: ACTIVE
Read Ahead: 256
Tables present: LIVE
Open count: 1
Event number: 0
Major, minor: 253, 0
Number of targets: 1



My question is: how to fully wipe meta about my dmsetup disc and create a new one with its name? Does virtualization play any role?



UPD: although I do not know where to read its meaning, here is the verbose output:



# dmsetup remove -v -v -f /dev/mapper/disk0_extent0
dm version [ opencount flush ] [16384] (*1)
dm table disk0_extent0 [ opencount flush ] [16384] (*1)
dm reload disk0_extent0 [ opencount flush ] [16384] (*1)
Udev cookie 0xd4d34de (semid 2359297) created
Udev cookie 0xd4d34de (semid 2359297) incremented to 1
Udev cookie 0xd4d34de (semid 2359297) incremented to 2
Udev cookie 0xd4d34de (semid 2359297) assigned to RESUME task(5) with flags DISABLE_LIBRARY_FALLBACK (0x20)
dm resume disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
disk0_extent0: Stacking NODE_ADD (253,0) 0:6 0660 [trust_udev]
Udev cookie 0xd4d34de (semid 2359297) decremented to 1
Udev cookie 0xd4d34de (semid 2359297) waiting for zero
Udev cookie 0xd4d34de (semid 2359297) destroyed
disk0_extent0: Skipping NODE_ADD (253,0) 0:6 0660 [trust_udev]
Udev cookie 0xd4dea65 (semid 2392065) created
Udev cookie 0xd4dea65 (semid 2392065) incremented to 1
Udev cookie 0xd4dea65 (semid 2392065) incremented to 2
Udev cookie 0xd4dea65 (semid 2392065) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK (0x20)
dm remove disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
device-mapper: remove ioctl on disk0_extent0 failed: Device or resource busy
Udev cookie 0xd4dea65 (semid 2392065) decremented to 1
Udev cookie 0xd4dea65 (semid 2392065) decremented to 0
Udev cookie 0xd4dea65 (semid 2392065) waiting for zero
Udev cookie 0xd4dea65 (semid 2392065) destroyed
Command failed
<backtrace>







share|improve this question


























    up vote
    0
    down vote

    favorite












    I have Ubuntu 16.04 host with Ubuntu 17.10 guest in KVM (Virtual Machine Manager 1.3.2). This VM has a raw virtual HDD (/dev/vdb) with 10GB capacity.



    I use dmsetup util to create 2 extents 5GB each from this disk:



    dmsetup create disk0_extent0 --table '0 10485760 linear /dev/vdb 0'



    dmsetup create disk0_extent1 --table '0 10485760 linear /dev/vdb 10485760



    As a result, an error occurs:



    device-mapper: create ioctl on disk0_extent0 failed: Device or resource busy
    Command failed



    However, disk0_extent0 could not be seen by lsblk before or after the operation. Furthermore, I try deletion and explicit meta deletion:



    dmsetup remove -f --retry /dev/mapper/disk0_extent0 (which tells me many times No storage object named disk0_extent0)



    dmsetup clear /dev/mapper/disk0_extent0



    dmsetup wipe_table /dev/mapper/disk0_extent0



    Even though everything looks like we have no device (lsblk still does not show it), dmsetup sees it a different way:



    # dmsetup info /dev/mapper/disk0_extent0
    Name: disk0_extent0
    State: ACTIVE
    Read Ahead: 256
    Tables present: LIVE
    Open count: 1
    Event number: 0
    Major, minor: 253, 0
    Number of targets: 1



    My question is: how to fully wipe meta about my dmsetup disc and create a new one with its name? Does virtualization play any role?



    UPD: although I do not know where to read its meaning, here is the verbose output:



    # dmsetup remove -v -v -f /dev/mapper/disk0_extent0
    dm version [ opencount flush ] [16384] (*1)
    dm table disk0_extent0 [ opencount flush ] [16384] (*1)
    dm reload disk0_extent0 [ opencount flush ] [16384] (*1)
    Udev cookie 0xd4d34de (semid 2359297) created
    Udev cookie 0xd4d34de (semid 2359297) incremented to 1
    Udev cookie 0xd4d34de (semid 2359297) incremented to 2
    Udev cookie 0xd4d34de (semid 2359297) assigned to RESUME task(5) with flags DISABLE_LIBRARY_FALLBACK (0x20)
    dm resume disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
    disk0_extent0: Stacking NODE_ADD (253,0) 0:6 0660 [trust_udev]
    Udev cookie 0xd4d34de (semid 2359297) decremented to 1
    Udev cookie 0xd4d34de (semid 2359297) waiting for zero
    Udev cookie 0xd4d34de (semid 2359297) destroyed
    disk0_extent0: Skipping NODE_ADD (253,0) 0:6 0660 [trust_udev]
    Udev cookie 0xd4dea65 (semid 2392065) created
    Udev cookie 0xd4dea65 (semid 2392065) incremented to 1
    Udev cookie 0xd4dea65 (semid 2392065) incremented to 2
    Udev cookie 0xd4dea65 (semid 2392065) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK (0x20)
    dm remove disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
    device-mapper: remove ioctl on disk0_extent0 failed: Device or resource busy
    Udev cookie 0xd4dea65 (semid 2392065) decremented to 1
    Udev cookie 0xd4dea65 (semid 2392065) decremented to 0
    Udev cookie 0xd4dea65 (semid 2392065) waiting for zero
    Udev cookie 0xd4dea65 (semid 2392065) destroyed
    Command failed
    <backtrace>







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have Ubuntu 16.04 host with Ubuntu 17.10 guest in KVM (Virtual Machine Manager 1.3.2). This VM has a raw virtual HDD (/dev/vdb) with 10GB capacity.



      I use dmsetup util to create 2 extents 5GB each from this disk:



      dmsetup create disk0_extent0 --table '0 10485760 linear /dev/vdb 0'



      dmsetup create disk0_extent1 --table '0 10485760 linear /dev/vdb 10485760



      As a result, an error occurs:



      device-mapper: create ioctl on disk0_extent0 failed: Device or resource busy
      Command failed



      However, disk0_extent0 could not be seen by lsblk before or after the operation. Furthermore, I try deletion and explicit meta deletion:



      dmsetup remove -f --retry /dev/mapper/disk0_extent0 (which tells me many times No storage object named disk0_extent0)



      dmsetup clear /dev/mapper/disk0_extent0



      dmsetup wipe_table /dev/mapper/disk0_extent0



      Even though everything looks like we have no device (lsblk still does not show it), dmsetup sees it a different way:



      # dmsetup info /dev/mapper/disk0_extent0
      Name: disk0_extent0
      State: ACTIVE
      Read Ahead: 256
      Tables present: LIVE
      Open count: 1
      Event number: 0
      Major, minor: 253, 0
      Number of targets: 1



      My question is: how to fully wipe meta about my dmsetup disc and create a new one with its name? Does virtualization play any role?



      UPD: although I do not know where to read its meaning, here is the verbose output:



      # dmsetup remove -v -v -f /dev/mapper/disk0_extent0
      dm version [ opencount flush ] [16384] (*1)
      dm table disk0_extent0 [ opencount flush ] [16384] (*1)
      dm reload disk0_extent0 [ opencount flush ] [16384] (*1)
      Udev cookie 0xd4d34de (semid 2359297) created
      Udev cookie 0xd4d34de (semid 2359297) incremented to 1
      Udev cookie 0xd4d34de (semid 2359297) incremented to 2
      Udev cookie 0xd4d34de (semid 2359297) assigned to RESUME task(5) with flags DISABLE_LIBRARY_FALLBACK (0x20)
      dm resume disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
      disk0_extent0: Stacking NODE_ADD (253,0) 0:6 0660 [trust_udev]
      Udev cookie 0xd4d34de (semid 2359297) decremented to 1
      Udev cookie 0xd4d34de (semid 2359297) waiting for zero
      Udev cookie 0xd4d34de (semid 2359297) destroyed
      disk0_extent0: Skipping NODE_ADD (253,0) 0:6 0660 [trust_udev]
      Udev cookie 0xd4dea65 (semid 2392065) created
      Udev cookie 0xd4dea65 (semid 2392065) incremented to 1
      Udev cookie 0xd4dea65 (semid 2392065) incremented to 2
      Udev cookie 0xd4dea65 (semid 2392065) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK (0x20)
      dm remove disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
      device-mapper: remove ioctl on disk0_extent0 failed: Device or resource busy
      Udev cookie 0xd4dea65 (semid 2392065) decremented to 1
      Udev cookie 0xd4dea65 (semid 2392065) decremented to 0
      Udev cookie 0xd4dea65 (semid 2392065) waiting for zero
      Udev cookie 0xd4dea65 (semid 2392065) destroyed
      Command failed
      <backtrace>







      share|improve this question














      I have Ubuntu 16.04 host with Ubuntu 17.10 guest in KVM (Virtual Machine Manager 1.3.2). This VM has a raw virtual HDD (/dev/vdb) with 10GB capacity.



      I use dmsetup util to create 2 extents 5GB each from this disk:



      dmsetup create disk0_extent0 --table '0 10485760 linear /dev/vdb 0'



      dmsetup create disk0_extent1 --table '0 10485760 linear /dev/vdb 10485760



      As a result, an error occurs:



      device-mapper: create ioctl on disk0_extent0 failed: Device or resource busy
      Command failed



      However, disk0_extent0 could not be seen by lsblk before or after the operation. Furthermore, I try deletion and explicit meta deletion:



      dmsetup remove -f --retry /dev/mapper/disk0_extent0 (which tells me many times No storage object named disk0_extent0)



      dmsetup clear /dev/mapper/disk0_extent0



      dmsetup wipe_table /dev/mapper/disk0_extent0



      Even though everything looks like we have no device (lsblk still does not show it), dmsetup sees it a different way:



      # dmsetup info /dev/mapper/disk0_extent0
      Name: disk0_extent0
      State: ACTIVE
      Read Ahead: 256
      Tables present: LIVE
      Open count: 1
      Event number: 0
      Major, minor: 253, 0
      Number of targets: 1



      My question is: how to fully wipe meta about my dmsetup disc and create a new one with its name? Does virtualization play any role?



      UPD: although I do not know where to read its meaning, here is the verbose output:



      # dmsetup remove -v -v -f /dev/mapper/disk0_extent0
      dm version [ opencount flush ] [16384] (*1)
      dm table disk0_extent0 [ opencount flush ] [16384] (*1)
      dm reload disk0_extent0 [ opencount flush ] [16384] (*1)
      Udev cookie 0xd4d34de (semid 2359297) created
      Udev cookie 0xd4d34de (semid 2359297) incremented to 1
      Udev cookie 0xd4d34de (semid 2359297) incremented to 2
      Udev cookie 0xd4d34de (semid 2359297) assigned to RESUME task(5) with flags DISABLE_LIBRARY_FALLBACK (0x20)
      dm resume disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
      disk0_extent0: Stacking NODE_ADD (253,0) 0:6 0660 [trust_udev]
      Udev cookie 0xd4d34de (semid 2359297) decremented to 1
      Udev cookie 0xd4d34de (semid 2359297) waiting for zero
      Udev cookie 0xd4d34de (semid 2359297) destroyed
      disk0_extent0: Skipping NODE_ADD (253,0) 0:6 0660 [trust_udev]
      Udev cookie 0xd4dea65 (semid 2392065) created
      Udev cookie 0xd4dea65 (semid 2392065) incremented to 1
      Udev cookie 0xd4dea65 (semid 2392065) incremented to 2
      Udev cookie 0xd4dea65 (semid 2392065) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK (0x20)
      dm remove disk0_extent0 [ opencount noflush skiplockfs ] [16384] (*1)
      device-mapper: remove ioctl on disk0_extent0 failed: Device or resource busy
      Udev cookie 0xd4dea65 (semid 2392065) decremented to 1
      Udev cookie 0xd4dea65 (semid 2392065) decremented to 0
      Udev cookie 0xd4dea65 (semid 2392065) waiting for zero
      Udev cookie 0xd4dea65 (semid 2392065) destroyed
      Command failed
      <backtrace>









      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 16 '17 at 7:16

























      asked Dec 15 '17 at 9:42









      ikudyk

      538




      538

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f411010%2fdmsetup-fails-to-delete-device%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f411010%2fdmsetup-fails-to-delete-device%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?