格式化 ext4+LUKS 后外部硬盘无法访问

格式化 ext4+LUKS 后外部硬盘无法访问

为了尝试备份我的 Arch Linux 安装,我重新格式化了我的 My Passport Ultra 1 TB 硬盘。它之前在 Windows 上使用过,所以我认为文件系统是 NTFS(虽然我不确定)。

我从 gnome 的 GUI 文件浏览器将驱动器重新格式化为 ext4+LUKS。格式化之前,可以从 Files/Dolphin 查看驱动器,但现在它根本不显示在文件浏览器中。我想使用 Areca 备份的 GUI,但无法访问驱动器。

我仍然可以从 Gnome 的 Drives 实用程序中看到该驱动器,并且可以从那里使用我在格式化时设置的密码成功解锁它。尝试再次格式化会产生错误

Error wiping device: Command-line `wipefs -a "/dev/sdb1"' exited with non-zero exit status 1: wipefs: error: /dev/sdb1: probing initialization failed: Device or resource busy
 (udisks-error-quark, 0)

$ fdisk -l给出以下输出:

Disk /dev/sdb: 931.5 GiB, 1000170586112 bytes, 1953458176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xf04b09ff

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1        2048 1953458175 1953456128 931.5G  7 HPFS/NTFS/exFAT

$ partprobe -s /dev/sdb1

Error: Partition(s) 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 on /dev/sdb1 have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.

(我刚刚重新启动,但上述消息是一样的)。

不确定接下来该如何继续。

泰亚

答案1

Disks/udisks 错误意味着设备当前正在使用– 例如,它已被解锁(重新锁定cryptsetup close)或安装(卸载)。

使用lsblkfindmntdmsetup ls检查可能正在使用它的内容。

partprobe 消息表示您使用 partprobe 的方式不正确。它不适用于单个分区 - 它需要提供整个分区磁盘它会从中读取分区表本身。按照您现在的使用方式,它会尝试将 LUKS 标头解释为分区表,从而接收垃圾。

改用partprobe /dev/sda

相关内容