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 3AF4C139337 for ; Sun, 25 Jul 2021 23:10:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EC73BE0DC6; Sun, 25 Jul 2021 23:10:22 +0000 (UTC) Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) (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 6BDF5E0D65 for ; Sun, 25 Jul 2021 23:10:22 +0000 (UTC) Received: by mail-oi1-x22b.google.com with SMTP id l126so8957840oib.2 for ; Sun, 25 Jul 2021 16:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=j4lz5t1oJo8D0uT9f8cIPXLdtyI2w6DLJ7MYIAFfELE=; b=ad9OCd15+QCAsS+iodlhmyA4kvrA9NKC/tugp3C8ji68PO9sPZNCimqlb0lCb0+M2G eaOpj4ZHGlDSdeBI/bgqWZp0nEu64f65Jtdy6k0gfax+uKB8ID10kaHGYhL9hblW0kJu 5tcXR9Su9hzS9rWbjmKDVT3eIrg1i6WmkG1POuxy5KosUECV3etDne/iHuXKa75oazkv Lt4IQ/uiBA5MsLAX9b/zGrz3Kzi5KaMC5iGyAEQgQNoEJ+8SllBWX2Rv45UGkkk2XTsL AFqt4bQ+pReL1hmK3ecBIq77p2ADixCY46mSYNUYvudH6WmgkvjPwKmybYqz3Utzukw3 cjpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=j4lz5t1oJo8D0uT9f8cIPXLdtyI2w6DLJ7MYIAFfELE=; b=IIiGz1jADxF3d7FJFmrU74Z7iqP02XygcMJ7VM70iv5cBmIvM7OlzoK6nw0GimmbOz FaTZAh830Ug3R1WrMIMmzhud6BWHfDFmT2j6xvgwJATPlyzF9YnQW9n5uS7UX0myQmW2 YNAvX0dbT8YRXLWpWZ/gJMXNYhplHLuUtU7+ceTVw2ZWrJ/O4ud1MJcnXt5w4M2iVbIe ZBKoDA/90X3nOzF0XlSYEzv31NAm5v3gUFPxBUHVhmOmlHTBFGadPbw76bkAwhGxwc0W DNpWa5nug+UM0tGkccfoBFG9RQuqPvD/ooOAtK4amOBe9RjKohse4udT298QEoTS1Yzr 3mqQ== X-Gm-Message-State: AOAM532g9DGu+rF7QYQ4YzA/0IYzdrxEONWekVgbE0YtzLw/DA/LAEMk aZsZI6YDWPoAAe+BYcCn8m0= X-Google-Smtp-Source: ABdhPJzNSaeppjEBRaubJpnsLQIHwPUy8UqjDnqLV8coHcO4Hs9MCLSN8fsUOou1WtxHG0c+dOytdQ== X-Received: by 2002:a54:459a:: with SMTP id z26mr9305931oib.91.1627254621543; Sun, 25 Jul 2021 16:10:21 -0700 (PDT) Received: from [192.168.0.100] (adsl-074-188-240-053.sip.asm.bellsouth.net. [74.188.240.53]) by smtp.gmail.com with ESMTPSA id s25sm4931278oij.33.2021.07.25.16.10.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 25 Jul 2021 16:10:20 -0700 (PDT) Subject: Re: [gentoo-user] cryptsetup close and device in use when it is not To: gentoo-user@lists.gentoo.org References: <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> From: Dale Openpgp: preference=signencrypt Autocrypt: addr=rdalek1967@gmail.com; prefer-encrypt=mutual; keydata= mQINBFxc7MgBEAC+zrgEdqJJiDe/UDAB+ScmferXWfJTVjbVT2T4DQ7jiLrgP9aNUo1HioNF mrU3JPOCR32gvZyTbY1+niO5+VSo/+pSqQ785h6ZDj1klMkrg6tEzGnf2MNBpBj4houZwxQ+ WDKKTg2M9F+lv8wTIdR/JQn+hSviktLMtrghQlyLhpapsLXWLA6gMFebpQYwxUwemvan8ddX lQvJe9FGyFYvBi0dp1gl10F2O+DVZJxvX8xkX+yImVlhVJiC31gXHRcj+Qlo7gprlU7TIieF Uow6/ZvYKJ26pztVdFCg5w0rMJkF/x8Zd4A6wnuptiAPmWaQ1+YKgYDonbDUgwqFSx5/lN5z DGZ4LlioxeUTTPVvZsqBIeDz6jNFA583OYbo1/S26dqrvTFf2DKlsvoDpVfAhNlwJPjoixs0 X3FNqPv+M10n4kq5Iz7Q9E3O4s/nfFIYGocEslVka7zZPkXSaHbsn+KJlY8XV6qxtCEdh0/V XX1+1aU2J74M0JikWhpwxTZ1dP5aOyWSPPEgFFIRW6xwwC02SoRH9a7mggfGYp/YjPlONNaT SCL8sgRfvmq3D0XTbLyTjSbExxkfKDmbePQagawDE3TlI/oivHf1JaAcbwMb3LZuU4TGcOIl 5D+x7q0MUIeCop0ZFOwAnqW3AVVNvsBkv2KN+IHJryWAf0/iMQARAQABtBtEYWxlIDxyZGFs ZWsxOTY3QGdtYWlsLmNvbT6JAk4EEwEIADgWIQTZ7suruPBaS60bCYXvEM/XWu+ZnAUCXFzs yAIbIwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRDvEM/XWu+ZnN+7D/4/1dNG4a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6 Message-ID: <96fc901a-2ce4-0ea0-0ed1-1c529145c0e9@gmail.com> Date: Sun, 25 Jul 2021 18:10:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.8 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 In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 3ceb1c1c-c67c-4d24-a8b7-d650379123a3 X-Archives-Hash: 00026d8e66786da7ae232cfd345d0d15 Frank Steinmetzger wrote: > Am Wed, Jul 07, 2021 at 01:08:55PM -0500 schrieb Dale: > >> root@fireball / # blkid | grep dde669 >> /dev/mapper/8tb: LABEL="8tb-backup" >> UUID="0277ff1b-2d7c-451c-ae94-f20f42dde669" BLOCK_SIZE="4096" TYPE="ext4" >> root@fireball / # ls /dev/disk/by-uuid | grep dde669 >> 0277ff1b-2d7c-451c-ae94-f20f42dde669 >> root@fireball / # > I followed this thread, and couldn’t remember ever having the same issue. > But today I was bitten: It’s a 3 TB external USB drive from Intenso. > > Yesterday I was in the middle of a backup (it’s my main backup drive), but I > had to sleep and so sent the machine into standby. I had to start the PC > again a few minutes later in order to unmount an sshfs of it on another > machine, and sent it right back to sleep. > > Just now I switched the PC back on and the drive was gone and off (USB > enclosures tend to spin down the drive when USB disconnects). So I pulled > the USB cable and plugged it back in for the drive to start and be > rediscovered. That worked and I resumed the backup, but this enclosure has > the nasty habit of sometimes intermittently disconnecting on its own. > > Its device was not gone (it usually disconnects for a tiny moment and then > comes back, probably a USB issue), so I just tried to open it again in > Dolphin, which gave me: > Error unlocking /dev/sdd1: Failed to activate device: File exists > > $ blkid | grep luks > /dev/mapper/luks-6a55a712-773e-4cd8-9776-fc9b6f39a998: LABEL="backup" UUID="50ed9519-cd9c-4d11-b78a-9f057b089362" BLOCK_SIZE="4096" TYPE="ext4" > > $ ls -l /dev/disk/by-uuid/6a55a* > lrwxrwxrwx 10 root 2021-07-25 21:34 /dev/disk/by-uuid/6a55a712-773e-4cd8-9776-fc9b6f39a998 -> ../../sdd1 > > $ lsblk > NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS > […] > sdd 8:48 0 2,7T 0 disk > └─sdd1 8:49 0 2,7T 0 part > > $ mount | grep -E 'luks|sdd' > [nothing] > > $ cryptsetup luksClose luks-6a55a712-773e-4cd8-9776-fc9b6f39a998 > Device luks-6a55a712-773e-4cd8-9776-fc9b6f39a998 is still in use. > > I don’t quite like this bad habit of the enclosure, but a 3 TB drive is a 3 > TB drive. I just looked at smart to see how old it is, because it has only > 350 hours of power-on time, but it must be at least 5 years old. And > smartctl tells me there is a firmware update available! (for Windows, Mac > and—lo and behold—a bootable ISO, let’s hope it works with USB sticks). > > Perhaps this fixes the issue. Dale, maybe you should look for the same. > That's interesting.  I have two different drives, can't recall but may be the same brand.  While using UUID to mount it, it would either fail every time or in the case of the smaller drive, fail on occasion but not every time.  The smaller drive worked most of the time but after a couple failures, I switched to mounting by label.  Since switching both drives to mount by labels, neither has had a single issue.  My backups last time went without a hitch.  I was actually planning to post that after my next backup if nothing failed.  As it is, I think switching to labels has fixed it.  I've tried external drives connected by USB before and hated them.  Slow when they do work and buggy at that.  I've had more drives go bad when using USB enclosures than I've ever had on IDE or (e)SATA.  I've had two drives fail after years of service that were IDE or SATA.  I have three drives that are bricks and all of them were in USB enclosures and far young to die.  I paid more for eSATA external enclosures and have had no problems with drives going dead yet.  All of them have far surpassed the drives in the USB enclosures.  Heck, this 'in use' problem is the first issue I recall having.  Fast too.  The SMR drive not so much but the CMR drive is as fast as what is in my system connected to the mobo itself.  The thing about this, I have no idea why switching to labels works.  The UUID, label and such are nothing but links to the real device.  It should make no difference at all which one is used to mount with.  I'm no guru or anything but it just shouldn't matter.  Bad thing is, I don't use anything Microsoft here.  Can a drive's firmware be updated on Linux?  I think my drives are either Seagate or WD.  I tend to stick with those two, unless it is a really awesome deal.  I've never updated the firmware on a drive before.  I have my mobo and my router but not a drive.  Dale :-)  :-)