kpartx: read error when removing mapping

4.2k views Asked by At

I have a backup procedure that uses kpartx to read from a partitioned lvm volume. Seldomly it happens that the device cannot be unmapped.

Right now when I try to remove the mapping I get the following:

# kpartx -d /dev/loop7
read error, sector 0
read error, sector 1
read error, sector 29

I tried dmsetup clean loop7p1 but nothing changed. How can I free the partition without rebooting the server? thanks

1

There are 1 answers

0
user2051456 On

You can use 'dmsetup remove_all' to remove this mapping. You shouldn't need to use -f (force), but if you do, it may remove mappings that are in use.