From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F1746139360 for ; Mon, 9 Aug 2021 13:32:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E585CE0872; Mon, 9 Aug 2021 13:32:11 +0000 (UTC) Received: from EUR06-DB8-obe.outbound.protection.outlook.com (mail-db8eur06olkn2081b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0f::81b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4C68DE081A for ; Mon, 9 Aug 2021 13:32:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fr/ERvYZ/UbDY2TVY93bw1suwiguJhXYGlYpytmXJcpfQla2HppCACCJcfI7Q1iVruaUrNXU3dactaxXxGTHqRuACtFFd/Ck95xJZY6uHCUpfRPfTe4QZJY6SrN3//rEUYr/Wj2xs7MNFZdMF+Nt/N7MGiMmsAjF3am9lBOSv+4SiUlYwT4sEQeCibNrwM6qz0ISVgRxKf8RlGizQBrKF0QxRzvwowPvsB4OmHZvukd9qrG17uMVmW1x0lQSxFcYdjfXciAMQL6KHA+ppc/8pJrXBGvc4sHNpcYXsNFMTmhHWa5Y3Lqn/V8Cm8CO1BzT7gfruxIBGYMlaUREMDqTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bPDHfdyuW9e29bUXKm6xXtTdRG4P/iAGZMUxlroAtJc=; b=FnqTAlORSJH3UZBlPpu1QoQ/hIQGIimuWUO0HxC/pLqqw2D6vify1ZlIV6JWkll+7rfLfxwBHDYE7UPBnjqmYI++vu16djezajJlOeuNQu18zHkM9o+lMwnVsJm1qupjbAFnd29mS0devfthpHjvVtrfOpG6+fGAHpj0PsdC1q5Vtiadn0xsJkVbJTEFjsGRTbdJyGaZnJvs1RSay4/g8RbANcvpUcEjmF8/8c0Mp/Yycql8PBKQHN/VpLg1ERZ9y8SlSwWPcA+QfvamC19+9pXuq9/rH5Gc7+G/mfK9Yjwllj097btwEkN02UQKQc3+xsraMdfr1MmU9sLcLf18HA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VI1EUR06FT050.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::47) by VI1EUR06HT228.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc37::152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Mon, 9 Aug 2021 13:32:09 +0000 Received: from AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:fc37::43) by VI1EUR06FT050.mail.protection.outlook.com (2a01:111:e400:fc37::288) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16 via Frontend Transport; Mon, 9 Aug 2021 13:32:09 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:B138BFDAB254F74A8F3DF9D8BED6928A9AB6428AD86E72576E59E917EDD9F7AA;UpperCasedChecksum:1944BFFE51CCE9AB3767A30F31CC7BBE1EEBDD29EA11C423A24A55F0B4BAE235;SizeAsReceived:9600;Count:45 Received: from AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM ([fe80::429:de52:1152:d88b]) by AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM ([fe80::429:de52:1152:d88b%7]) with mapi id 15.20.4394.023; Mon, 9 Aug 2021 13:32:09 +0000 To: Dale , Gentoo User References: <70a1b488-c49e-6a94-a9a9-37eeb2ff4399@gmail.com> <9c9d5923-dccb-34d5-0f3b-16e07f337009@users.sourceforge.net> <649753f7-5dcd-1842-875d-d637ef754b9f@gmail.com> <3923b557-9d65-825b-e0fd-b1977c8d70c1@gmail.com> <7c279941-291a-5078-a83f-601ff58a6008@gmail.com> <9946c2eb-bb5c-a9c0-ced9-1ac269cd69a0@gmail.com> <6ecbf2d6-2c6f-3f66-5eee-f4766d5e5254@gmail.com> <24805.48814.331408.860941@tux.local> <5483630c-3cd1-bca2-0a6d-62bb85a5adc6@gmail.com> <6cb92a23-ba92-1cc6-5c9c-6d0d3e4b4349@gmail.com> From: Ramon Fischer Subject: Re: [gentoo-user] cryptsetup close and device in use when it is not Message-ID: Date: Mon, 9 Aug 2021 15:38:46 +0200 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) In-Reply-To: <6cb92a23-ba92-1cc6-5c9c-6d0d3e4b4349@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fbyqBb2NRj2eeGY68LwJJRYtZpm0Ui1FD" X-TMN: [Sijai+IV8LcApb47Q3ORyhivk0+e7zkN] X-ClientProxiedBy: AM0P190CA0014.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::24) To AM6PR10MB2440.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:4c::30) X-Microsoft-Original-Message-ID: <0ba11225-124c-5c58-b728-a0bb9ca9c79d@hotmail.de> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.175.95] (46.114.160.239) by AM0P190CA0014.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Mon, 9 Aug 2021 13:32:08 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c6dc9d19-77a2-4667-01a5-08d95b3a15eb X-MS-TrafficTypeDiagnostic: VI1EUR06HT228: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4YWEpT2BQQvjahUjth3I/IOMTRRXGAdVPyYMal4Oc/6AY40XKNrOQLfez/vOYAvBWd0bXgYLiHgQ5QL43+RQmhbW1OeefBghpEip1lAUGcSdPehik80HNE0oQ1gayaFVQBDLSpRZpr72hYwYO2qu0A/7oxPcE89nLDUKrxXgW+rHkZTEekgpzZH7rquT/ER5AFpqjNjS92WC93dSnzDYPmw9J4BWISjNAscYwea6GWP/QCxHRSB1n2lIF3H8M8WbM5OiD9ugRkyxvfebs+XEJeI/M4dQgZU02tUbwjKkszpkxg1un6FPvULsZR4gRJ3RBx8HYwMqErUsLIkKgwRclTdYc+tt93nU1C2q+cPF7xurvdBrmpBNjPKCnEqGaQsK9xy1cnszM+KqyY+FikQdzz5g8CVV8Z31OZaVtxFbr3CsX1AT9ull+3rnlsZkZ8Zb X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7f63FoktwEE8bpilQ4fM2emrn0gsZ/tSZtvsATCJJIrnt9bLuq1tc84X7M1gxsCVxD7fvcuFpc0P0HJZdGseKhq97a9oc2GYGDPEd16g/Xax3W4bOlHXWH42XS3gi+V0CeQ1K4ZFMiAHHJsETJAiZw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6dc9d19-77a2-4667-01a5-08d95b3a15eb X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2021 13:32:09.0505 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR06FT050.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR06HT228 X-Archives-Salt: 038844f2-81b4-4b0e-beb2-f3f8630ecaeb X-Archives-Hash: 1a6826032dada1f6a0a3b913926d0ee8 --fbyqBb2NRj2eeGY68LwJJRYtZpm0Ui1FD Content-Type: multipart/mixed; boundary="iNm8PW1XJT30Da8aLhCEJ3YKNR3iMnkD8"; protected-headers="v1" From: Ramon Fischer To: Dale , Gentoo User Message-ID: <0ba11225-124c-5c58-b728-a0bb9ca9c79d@hotmail.de> Subject: Re: [gentoo-user] cryptsetup close and device in use when it is not References: <70a1b488-c49e-6a94-a9a9-37eeb2ff4399@gmail.com> <9c9d5923-dccb-34d5-0f3b-16e07f337009@users.sourceforge.net> <649753f7-5dcd-1842-875d-d637ef754b9f@gmail.com> <3923b557-9d65-825b-e0fd-b1977c8d70c1@gmail.com> <7c279941-291a-5078-a83f-601ff58a6008@gmail.com> <9946c2eb-bb5c-a9c0-ced9-1ac269cd69a0@gmail.com> <6ecbf2d6-2c6f-3f66-5eee-f4766d5e5254@gmail.com> <24805.48814.331408.860941@tux.local> <5483630c-3cd1-bca2-0a6d-62bb85a5adc6@gmail.com> <6cb92a23-ba92-1cc6-5c9c-6d0d3e4b4349@gmail.com> In-Reply-To: <6cb92a23-ba92-1cc6-5c9c-6d0d3e4b4349@gmail.com> --iNm8PW1XJT30Da8aLhCEJ3YKNR3iMnkD8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US Hi Dale, > So, something says it is busy but eventually > releases it if left alone for a while.=C2=A0 I'd like to know what it i= s and > if it is really in use or not.=C2=A0 Thing is, I can't find a way to kn= ow > what it is that is using it.=C2=A0 The dmsetup command shows it is in u= se but > no way to know what is using it. I could reproduce this issue by killing my desktop process, unmounting=20 the home partition and playing some "kill process" bingo. I could=20 backtrace it to one unkillable process "kcryptd": 1. Kill "awesomewm": + Backspace 2. Kill other processes accessing "/home/" 3. umount /home 4. cryptsetup close crypthome Device crypthome is still in use 5. dmsetup info /dev/mapper/crypthome Name:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 crypthome State:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 ACTIVE Read Ahead:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 256 Tables present:=C2=A0=C2=A0=C2=A0 LIVE Open count:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 Event number:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0 Major, minor:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 253, 1 Number of targets: 1 UUID: CRYPT-LUKS2--crypthome 6. Kill any unnecessary process and try "cryptsetup close crypthome" 7. Search for major, minor: ps aux | grep "253:1" root=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 150=C2=A0 0.2=C2=A0 0.0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0=C2=A0 0 ?=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 I=C2=A0=C2=A0=C2=A0 15:21=C2=A0=C2=A0 0:02 [kworker/u16:5-kcryptd/253:1] 8. Does not work: kill 150 9. Does not work and could be dangerous: kill -9 150 So, there was still one "kcryptd" process left, accessing the hard=20 drive, but I found no way to kill it. Maybe this could be helpful? -Ramon On 02/08/2021 15:33, Dale wrote: > Ramon Fischer wrote: >> OK, if it could be "udev", you might want to try to check the followin= g: >> >> =C2=A0=C2=A0 $ grep -rF "" /etc/udev/rules.d/ >> =C2=A0=C2=A0 $ grep -rF "" /lib/udev/rules.d/ >> =C2=A0=C2=A0 $ grep -rF "" /etc >> >> You could also try to search for the partition device, maybe there >> will be some interesting configuration files. >> >> If you are using "systemd", you might want to check every service unit= >> file as well: >> >> =C2=A0=C2=A0 $ systemctl >> >> Recently, I had a similar issue with "cryptsetup" on Raspbian, where >> the "/etc/crypttab" was faulty, which may be applicable here. It had >> the following entry: >> >> =C2=A0=C2=A0 # # [...] >> =C2=A0=C2=A0 >> =C2=A0=C2=A0 >> >> Therefore, the systemd service unit >> "systemd-cryptsetup@dev-disk-by\x2duuid-# # >> [...]" - if I remember correctly - faile= d. >> It seems, that "systemd-cryptsetup-generator" only searches for >> matching UUIDs in "/etc/crypttab", even, if they are commented and >> creates service units for each match in "/run/systemd/generator/". >> I remember, that I had issues to access the hard drive. Nevertheless, >> I was able to mount it normally, due to the other correct entry(?). >> >> By removing the accidentally pasted UUID from "/etc/crypttab" and >> rebooting, I was able to use the hard drive without issues again. >> >> Maybe this is something, where you could poke around? :) >> >> -Ramon > I'm running openrc here.=C2=A0 I don't recall making any udev rules > recently.=C2=A0 This is a list of what I have. > > > root@fireball / # ls -al /etc/udev/rules.d/ > total 20 > drwxr-xr-x 2 root root 4096 Apr 27 15:07 . > drwxr-xr-x 3 root root 4096 Jul 27 03:17 .. > -rw-r--r-- 1 root root 2064 Apr 27 15:07 69-libmtp.rules > -rw-r--r-- 1 root root 1903 Apr=C2=A0 4=C2=A0 2012 70-persistent-cd.rul= es > -rw-r--r-- 1 root root=C2=A0 814 Jan=C2=A0 1=C2=A0 2008 70-persistent-n= et.rules > -rw-r--r-- 1 root root=C2=A0=C2=A0=C2=A0 0 Mar 22=C2=A0 2015 80-net-nam= e-slot.rules > root@fireball / # > > > One is for CD/DVD stuff.=C2=A0 I wonder if I can remove that now.=C2=A0= Two is for > network cards and top one is something to do with my old Motorola cell > phone, rest in peace. > > All this said, it did it again last night.=C2=A0 I tried a few things a= nd > went to bed while my updates were compiling.=C2=A0 When I got up a bit = ago, > it closed just fine.=C2=A0 So, something says it is busy but eventually= > releases it if left alone for a while.=C2=A0 I'd like to know what it i= s and > if it is really in use or not.=C2=A0 Thing is, I can't find a way to kn= ow > what it is that is using it.=C2=A0 The dmsetup command shows it is in u= se but > no way to know what is using it. > > Dale > > :-)=C2=A0 :-) --=20 GPG public key: 5983 98DA 5F4D A464 38FD CF87 155B E264 13E6 99BF --iNm8PW1XJT30Da8aLhCEJ3YKNR3iMnkD8-- --fbyqBb2NRj2eeGY68LwJJRYtZpm0Ui1FD Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEWYOY2l9NpGQ4/c+HFVviZBPmmb8FAmERL+YFAwAAAAAACgkQFVviZBPmmb+J kg/+IuicFw9ZsfdHXrJy2lnLG9NPHMObHIJmLCbWyMm26Gyg/aJr3f1uE8gtKuCeXeCpihYMnlL2 ZpLRSIiRjQ6Y0luwP3KcGM0qODREslRjWB++ZM4BRruudQ8kD6dg8E5Q7P+O7OEUaFChqAhabfgE yXOOLeCCu3fxrlqYrzBgzNgzged5JyiWcuPAH6wOyQuR6Al1FIEvObpGlzTSNyu06x1BTQYANN/8 tInMeksTcjxd2hbvK69v6sEHuHGYpsMFwkIpbw7ShK+CYqHJhiYIu/IvQVKyDy9oXAskw0Cxm4fx ewQC8nSwOjP9ykeBQr4ITr1VYhwSN5Rs2X/q9HR4Kvuzb4p3Kz0/O27naV6o3ZTiSmPwNUFKpiok RGsnqdO4TyrcxFufnXFL3nkbGltKSH767xNi42m9fDhwQ2k4UVgUvbUxlkUMtjFGQtGIDQ20NRdK xkIb9WlOLNKnrqCpJNHfJ9L0chTahmeEe28VKX5CmWjkTqd7i2X+YMHP3tsRBSWVk8VfcR+CzBsz 25dYrclTGRkl9ZVhpYdBUIlkF8e+bGdjlXb15+QCOUZSleS2t3I4afuBcngpQZq/g5NtkcSg/d8H 4XyikjM3JbikqnT2mU1ChBozHxtdicjIYXpy5skmvIytq0ui0RiVzlosHZH1Jd9anjlSZyNsRdns B/w= =AOwP -----END PGP SIGNATURE----- --fbyqBb2NRj2eeGY68LwJJRYtZpm0Ui1FD--