All of lore.kernel.org
 help / color / mirror / Atom feed
From: yac <yac@blesmrt.net>
To: dm-crypt@saout.de
Subject: [dm-crypt] force luksClose
Date: Sun, 29 Nov 2015 19:42:15 +0100	[thread overview]
Message-ID: <20151129194215.54b4cea5@linux-apw9.site> (raw)

Hello

I believe I have the same problem as described here:
http://comments.gmane.org/gmane.linux.kernel.device-mapper.dm-crypt/6250

Here are the last requested commands:

# dmsetup table dlt
0 4096 crypt aes-xts-plain64 0000000000000000000000000000000000000000000000000000000000000000 0 254:8 4096
# dmsetup info -c dlt
Name             Maj Min Stat Open Targ Event  UUID                                            
dlt              254   9 L--w    1    1      0 CRYPT-LUKS1-731df69c78e94882982899390c71bb3b-dlt
# lsblk 
lsblk: dm-0: failed to get device path
lsblk: dm-0: failed to get device path
NAME                MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda                   8:0    0  1.8T  0 disk  
└─sda1                8:1    0  1.8T  0 part  
sdb                   8:16   0  2.7T  0 disk  
└─sdb1                8:17   0  2.7T  0 part  
sdc                   8:32   0  2.7T  0 disk  
└─sdc1                8:33   0  2.7T  0 part  
sdd                   8:48   0  2.7T  0 disk  
└─sdd1                8:49   0  2.7T  0 part  
sde                   8:64   0  2.7T  0 disk  
└─sde1                8:65   0  2.7T  0 part  
sdf                   8:80   0  1.8T  0 disk  
sdg                   8:96   1  3.8G  0 disk  
└─sdg1                8:97   1  3.8G  0 part  
loop8                 7:8    0   10M  0 loop  
├─lt-lvol0_rmeta_0  254:4    0    4M  0 lvm   
│ └─lt-lvol0        254:8    0    4M  0 lvm   
│   └─dlt           254:9    0    2M  0 crypt /root/lvm-crypt-test/mnt
└─lt-lvol0_rimage_0 254:5    0   12M  0 lvm   
  └─lt-lvol0        254:8    0    4M  0 lvm   
    └─dlt           254:9    0    2M  0 crypt /root/lvm-crypt-test/mnt
loop9                 7:9    0   10M  0 loop  
├─lt-lvol0_rmeta_1  254:6    0    4M  0 lvm   
│ └─lt-lvol0        254:8    0    4M  0 lvm   
│   └─dlt           254:9    0    2M  0 crypt /root/lvm-crypt-test/mnt
└─lt-lvol0_rimage_1 254:7    0   12M  0 lvm   
  └─lt-lvol0        254:8    0    4M  0 lvm   
    └─dlt           254:9    0    2M  0 crypt /root/lvm-crypt-test/mnt
loop10                7:10   0   10M  0 loop  
└─lt-lvol0_rimage_0 254:5    0   12M  0 lvm   
  └─lt-lvol0        254:8    0    4M  0 lvm   
    └─dlt           254:9    0    2M  0 crypt /root/lvm-crypt-test/mnt
loop11                7:11   0   10M  0 loop  
└─lt-lvol0_rimage_1 254:7    0   12M  0 lvm   
  └─lt-lvol0        254:8    0    4M  0 lvm   
    └─dlt           254:9    0    2M  0 crypt /root/lvm-crypt-test/mnt



This happened to me after I was trying out lvm and then crypt on top
lvm. First, let's have a workspace

# cd /root; mkdir lvm-crypt-test; cd lvm-crypt-test

Fake some block devs

# mknod /dev/lta b 7 8
# mknod /dev/ltb b 7 9
# mknod /dev/ltc b 7 10 
# mknod /dev/ltd b 7 11
# for i in a b c d; do fallocate -l 10M sd$i; losetup /dev/lt$i sd$i; done

Make an LVM raid1

# pvcreate /dev/lt{a,b,c,d}
# vgcreate lt /dev/lt{a,b,c,d}
# lvcreate -m1 -l 100%VG lt /dev/lt{a,b}

Encrypt it

# echo "aaa" > key
# cryptsetup luksFormat /dev/lt/lvol0 -d key

Format and mount

# cryptsetup luksOpen /dev/lt/lvol0 -d key dlt
# mkfs.ext4 /dev/mapper/dlt
# mkdir ./mnt; mount /dev/mapper/dlt ./mnt

Now comes the part where I broke it

# lvextend /dev/lt/lvol0 /dev/lt{c,d} -l 100%VG

I tried to umount mnt but it got stuck in uninterruptible sleep. But
umount -l worked for me.

# cat /proc/mounts  | grep dlt
# cat /proc/mounts  | grep mnt
# 

But I am not able to anything about dlt and the underlying devices. Not
even turn the system off normally as that gets stuck on sync().

# ps auxf | grep D
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     15193  0.0  0.0  27488  4436 ?        D    01:03   0:00 lvs
root     15196  0.0  0.0  27472  4432 ?        D    01:04   0:00 lvdisplay
root     15201  0.0  0.0  12612  2300 ?        D    01:04   0:00 umount mnt/
root     15237  0.0  0.0  12564  1740 ?        D    01:06   0:00 shutdown -h 0 w
root     15372  0.0  0.0   5840   748 ?        D    01:12   0:00 sync
root     17287  0.0  0.0   4016   640 ?        D    01:50   0:00 /sbin/reboot -f
root     17296  0.0  0.0  12576  2512 ?        D    01:51   0:00 dmsetup remove -f dlt
root     25471  0.0  0.0  27480  4532 ?        D    02:05   0:00 lvchange -an /dev/lt/lvol0
root     25529  0.0  0.0  24008  5576 ?        D<L  02:15   0:00 cryptsetup luksClose dlt
root     26114  0.0  0.0  24008  5576 ?        D<L  03:21   0:00 cryptsetup loopaesClose dlt

# lsof /root/lvm-crypt-test/mnt/
# fuser /root/lvm-crypt-test/mnt/
# find /proc/ -maxdepth 2 -type l -name cwd -exec readlink {} \; | sort | uniq
/
/proc/26289
/root
/root/lvm-crypt-test
/sys


Luckily I was able to umount and luksClose all the real block devices
there and now it appears my only option is to go pull the plug.

Best regards
Jan Matejka

             reply	other threads:[~2015-11-29 18:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29 18:42 yac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-11-29 13:02 [dm-crypt] force luksClose Benjamin Eberhardt
2012-11-29 13:43 ` Matthias Schniedermeyer
2012-11-29 14:53   ` Milan Broz
2012-12-25 12:17     ` Benjamin Eberhardt
2013-02-21 21:16       ` Benjamin Eberhardt
2013-02-21 22:08         ` Matthias Schniedermeyer
2013-02-21 22:41         ` Milan Broz
2013-02-22  0:17           ` Benjamin Eberhardt
2012-10-23  4:51 [dm-crypt] Force luksClose Dennis Birkholz
2012-10-25 10:01 ` Milan Broz
2012-10-25 14:46   ` Dennis Birkholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151129194215.54b4cea5@linux-apw9.site \
    --to=yac@blesmrt.net \
    --cc=dm-crypt@saout.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.