You tried to install grub to /dev/dm-0, which is a logical volume. It must be installed to a physical disk, such as /dev/sda.
You tried to install grub to /dev/dm-0, which is a logical volume. It must be installed to a physical disk, such as /dev/sda.