ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    LVM Frozen After Deleting Block Device

    IT Discussion
    2
    12
    1.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • StrongBadS
      StrongBad
      last edited by

      So I accidentally deleted the block device (by using fdisk) that LVM was using. Now if I run an LVM command, like lvs, it just sits there, frozen. I tried using lvremove, vgremove and pvremove but each says that there is no associated device. I'm not sure how to get the association with LVM removed so that the LVM commands will work properly again. Thanks.

      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        Have you tried using dmsetup info? If you use that you will get a "name" for the mapped block devices that LVM would be using. Once you have the DM name of the device that is frozen, you can use dmsetup remove to disconnect the block device. I did a Google search and that is what I found. Give that a try.

        1 Reply Last reply Reply Quote 0
        • StrongBadS
          StrongBad
          last edited by

          I tried that, it removed the device and I rebooted but lvs is still hanging 😞

          1 Reply Last reply Reply Quote 0
          • scottalanmillerS
            scottalanmiller
            last edited by

            I don't suppose that this is of any help?

            http://docs.fedoraproject.org/en-US/Fedora/14/html/Storage_Administration_Guide/troubleshooting.html

            1 Reply Last reply Reply Quote 0
            • StrongBadS
              StrongBad
              last edited by

              I saw that link too but there is no such file.

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller
                last edited by

                What distro are you using?

                StrongBadS 1 Reply Last reply Reply Quote 0
                • StrongBadS
                  StrongBad @scottalanmiller
                  last edited by

                  @scottalanmiller said:

                  What distro are you using?

                  CentOS 5.10

                  1 Reply Last reply Reply Quote 0
                  • StrongBadS
                    StrongBad
                    last edited by

                    No additional ideas? I'm kind of stumped.

                    1 Reply Last reply Reply Quote 0
                    • scottalanmillerS
                      scottalanmiller
                      last edited by

                      What about manually deleting everything bad out of /etc/lvm/cache/.cache

                      Don't worry, if you mess up that file it regenerates itself.

                      1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller
                        last edited by

                        If you see UUID entries in the .cache file and don't know what they are, you can do two things:

                        Look up all UUIDs: ls -l /dev/disk/by-uuid

                        Or look up the UUID of a device as in this example: blkid /dev/sda1

                        1 Reply Last reply Reply Quote 0
                        • StrongBadS
                          StrongBad
                          last edited by

                          Sweet, that worked!

                          Need to:

                          • Use LVM tools to remove the settings.
                          • Use dmsetup to remove the underlying devices.
                          • Manually delete the leftover lines in the cache.

                          No reboot even needed. Thanks!

                          1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller
                            last edited by

                            Awesome. Glad that that worked.

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post