It is possible that the problem lies with cryptsetup. Even when manually performing the steps
cryptsetup luksOpen /dev/sdb1 luks cryptsetup luksClose luks
I still end up with some "leaked" devices. These can cause the "already setup" error. For example I have
/org/freedesktop/Hal/devices/volume_part_1_size_64000
[prw@pax cryptsetup-1.0.5]$ lshal -l -u /org/freedesktop/Hal/devices/volume_part_1_size_64000 udi = '/org/freedesktop/Hal/devices/volume_part_1_size_64000' block.device = '/dev/mapper/temporary-cryptsetup-24059' (string) block.is_volume = true (bool) block.major = 254 (0xfe) (int) block.minor = 0 (0x0) (int) block.storage_device = '/org/freedesktop/Hal/devices/storage_serial_disgo_disgo_021D93010900B1E0_0_0' (string) info.capabilities = {'volume', 'block'} (string list) info.category = 'volume' (string) info.parent = '/org/freedesktop/Hal/devices/storage_serial_disgo_disgo_021D93010900B1E0_0_0' (string) info.product = 'Volume' (string) info.udi = '/org/freedesktop/Hal/devices/volume_part_1_size_64000' (string) linux.hotplug_type = 3 (0x3) (int) linux.sysfs_path = '/sys/block/dm-0' (string) storage.model = '' (string) volume.block_size = 512 (0x200) (int) volume.crypto_luks.clear.backing_volume = '/org/freedesktop/Hal/devices/volume_uuid_c52cc2c6_8fbd_41b3_a99f_f4a7d3132c9c' (string) volume.fstype = '' (string) volume.fsusage = '' (string) volume.fsversion = '' (string) volume.is_disc = false (bool) volume.is_mounted = false (bool) volume.is_mounted_read_only = false (bool) volume.is_partition = false (bool) volume.label = '' (string) volume.linux.is_device_mapper = true (bool) volume.mount_point = '' (string) volume.num_blocks = 125 (0x7d) (int) volume.size = 64000 (0xfa00) (uint64) volume.uuid = '' (string)
This temporary-cryptsetup-XXXXX device is created by cryptsetup luksOpen, but it was supposed to be freed by clear_mapping().
By the way, my Fedora 7 box does this perfectly. You might want to see what is different with that.
It is possible that the problem lies with cryptsetup. Even when manually performing the steps
cryptsetup luksOpen /dev/sdb1 luks
cryptsetup luksClose luks
I still end up with some "leaked" devices. These can cause the "already setup" error. For example I have
/org/freedeskto p/Hal/devices/ volume_ part_1_ size_64000
[prw@pax cryptsetup-1.0.5]$ lshal -l -u /org/freedeskto p/Hal/devices/ volume_ part_1_ size_64000 op/Hal/ devices/ volume_ part_1_ size_64000' temporary- cryptsetup- 24059' (string) storage_ device = '/org/freedeskt op/Hal/ devices/ storage_ serial_ disgo_disgo_ 021D93010900B1E 0_0_0' (string) op/Hal/ devices/ storage_ serial_ disgo_disgo_ 021D93010900B1E 0_0_0' (string) op/Hal/ devices/ volume_ part_1_ size_64000' (string) hotplug_ type = 3 (0x3) (int) crypto_ luks.clear. backing_ volume = '/org/freedeskt op/Hal/ devices/ volume_ uuid_c52cc2c6_ 8fbd_41b3_ a99f_f4a7d3132c 9c' (string) is_mounted_ read_only = false (bool) is_partition = false (bool) linux.is_ device_ mapper = true (bool) mount_point = '' (string)
udi = '/org/freedeskt
block.device = '/dev/mapper/
block.is_volume = true (bool)
block.major = 254 (0xfe) (int)
block.minor = 0 (0x0) (int)
block.
info.capabilities = {'volume', 'block'} (string list)
info.category = 'volume' (string)
info.parent = '/org/freedeskt
info.product = 'Volume' (string)
info.udi = '/org/freedeskt
linux.
linux.sysfs_path = '/sys/block/dm-0' (string)
storage.model = '' (string)
volume.block_size = 512 (0x200) (int)
volume.
volume.fstype = '' (string)
volume.fsusage = '' (string)
volume.fsversion = '' (string)
volume.is_disc = false (bool)
volume.is_mounted = false (bool)
volume.
volume.
volume.label = '' (string)
volume.
volume.
volume.num_blocks = 125 (0x7d) (int)
volume.size = 64000 (0xfa00) (uint64)
volume.uuid = '' (string)
This temporary- cryptsetup- XXXXX device is created by cryptsetup luksOpen, but it was supposed to be freed by clear_mapping().
By the way, my Fedora 7 box does this perfectly. You might want to see what is different with that.