Bug 984078
| Summary: | cryptsetup remove: Command failed with code 16: Device luks-UUID is still in use. | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Philipp Dreimann <philipp> |
| Component: | cryptsetup | Assignee: | Milan Broz <gmazyland> |
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 19 | CC: | agk, gmazyland, okozina, philipp |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-02-17 16:06:50 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Philipp Dreimann
2013-07-12 17:17:46 UTC
cryptsetup can remove device if underlying device disappeared. But it cannot remove device which is still in use (here perhaps mounted). As you already found, dmsetup remove -f can detach underlying device by replacing it with "error" device but it cannot remove device itslef from system. Can you please paste output of lsblk and mount? If you see luks device still mounted, just umount -f and releat luks removal. It should work. (and udisks should do this automatically btw...) I found a simpler way of getting my system in the problematic state: Keeping a terminal open on the luks partition, and then pulling the cable of the hdd.
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 119,2G 0 disk
├─sda1 8:1 0 600M 0 part /boot
├─sda3 8:3 0 1G 0 part [SWAP]
└─sda4 8:4 0 117,7G 0 part /home
$ mount |grep -i luks
<empty>
$ lsof luks-UUID
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
$ fuser -m luks-UUID
<empty>
Now, if I close the shell in question, of which I need to be aware, I can unmount the device using cryptsetup but only from the console.
Nautilus show while accessing the still visible mount point:
Error mounting /dev/dm-0 at /run/media/user/NAME: Command-line `mount -t "ext4" -o "uhelper=udisks2,nodev,nosuid" "/dev/dm-0" "/run/media/user/NAME"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/mapper/luks-UUID,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
Besides, I could mount or format the device using nautilus. (dmesg shows many errors, but that's about it.) How can I find out which process needs to be killed and, maybe, have that process killed automatically?
Hm. This seems to be problem with lazy umount (see man umount -l). lsof should help (any file open on the mounted fs over luks etc). You can see open count using "dmsetup info -c". If device has open count > 0, then removal will fail as you described. $ dmsetup info -c Name Maj Min Stat Open Targ Event UUID luks-UUID 253 0 L--w 1 1 0 CRYPT-LUKS1-UUID-luks-UUID ..works as expected, before and after unplugging. lsof yields interesting results: While the hdd is connected: $ lsof |grep $PID_OF_BASH |grep cwd bash $PID_OF_BASH user cwd DIR 253,0 4096 2 /run/media/user/mountpoint After unplugging: $ lsof |grep $PID_OF_BASH |grep cwd bash $PID_OF_BASH user cwd DIR 253,0 4096 2 / Grepping for luks or dm-0 does not yield any useful information either... This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |