Ok, I added a new disk (well old actually, but new for the machine) to my Oracle VM server. It discovered it (or do it manually) and I wanted to create a new repository on it. Unfortunately it came with the following error:
Server error: 'The backing device /dev/mapper/3500a075109146bee is not allowed to contain partitions'
Hmmm… yes, ok, it came from another machine and it did contain a partition. With `fdisk` I found the device and mapper: [/dev/sda1] and [/dev/mapper/3500a075109146beep1].
[root@ovs1 ~]# fdisk -l Device Boot Start End Blocks Id System /dev/sda1 1 38913 251623264+ 7 HPFS/NTFS (...) Disk /dev/mapper/3500a075109146bee: 256.1 GB, 256060514304 bytes
Ok, so I removed (only) the [/dev/sda1] partition with `fdisk` like you do normally, but still the error was there when I wanted to create the repository. You can not remove the partition from the mapper with `fdisk`. So, the [/dev/sda1] was gone, but the [/dev/mapper/3500a075109146beep1] was still there. I did not want to reboot the machine, but I wanted to remove the partition from the mapper.
Of course that was easy:
[root@ovs1 ~]# dmsetup remove /dev/mapper/3500a075109146beep1
Done, and I could create that repo!