在从外部 LUKS raid 10 阵列(通过 e-sata 连接)到内部驱动器的 rsync 期间,操作系统冻结。
重新启动后,我无法再访问外部 RAID 10。当我单击它时,我收到以下错误消息:
Error mounting filesystem
Error mounting /dev/dm-0 at /media/marco/EXT_RAID_10: can't read superblock
on /dev/mapper/luks-49aa238c-96bc-4bf6-abeb-1f4b018ccabe (udisks-error-quark, 0)
该系统是带有 Budgie 桌面的 Ubuntu 服务器 18.04.3。所有 4 个驱动灯都亮起,表明它们应该没问题
sudo fdisk -l 的输出:
Disk /dev/nvme0n1: 465.8 GiB, 500107862016 bytes, 976773168 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
Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 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: 0x373d828f
Device Boot Start End Sectors Size Id Type
/dev/sda2 2048 468860927 468858880 223.6G 5 Extended
/dev/sda5 443695104 468860927 25165824 12G 82 Linux swap / Solaris
/dev/sda6 4096 226996223 226992128 108.2G 83 Linux
/dev/sda7 226998272 443693055 216694784 103.3G 83 Linux
Partition table entries are not in disk order.
Disk /dev/sdf: 3.7 TiB, 4000694927360 bytes, 7813857280 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: gpt
Disk identifier: B9829E9E-44BE-4381-BB42-387062B5252D
Device Start End Sectors Size Type
/dev/sdf1 2048 7813855231 7813853184 3.7T unknown
Disk /dev/mapper/luks-49aa238c-96bc-4bf6-abeb-1f4b018ccabe: 3.7 TiB, 4000690733056 bytes, 7813849088 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
sudo fsck.ext4 -v /dev/sdf1 的输出:
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/sdf1
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
/dev/sdf1 contains a crypto_LUKS filesystem
sudo mke2fs -n /dev/sdf1 的输出:
Creating filesystem with 976731648 4k blocks and 244187136 inodes
Filesystem UUID: 11a09e27-4114-4555-8dd3-afcf61deacc4
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544
sudo e2fsck -b 98304 /dev/sdf1 的输出:
e2fsck 1.44.1 (24-Mar-2018)
e2fsck: Bad magic number in super-block while trying to open /dev/sdf1
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
/dev/sdf1 contains a crypto_LUKS filesystem
最后,问题只是驱动器由于中断的 rsync 命令而被锁定(当我中断一个简单的 cp 命令时也发生了)。LUKS 加密使这个简单的锁定变得复杂,给出了神秘的(双关语)错误消息。我通过按照以下说明移除锁解决了这个问题: https ://alvinabad.wordpress.com/2012/09/22/how-to-recover-a-luks-encrypted-disk/
简而言之:
1. Boot from a recovery disk
2. Determine /dev address of locked LUKS partition (in this case /dev/sdh1):
~$ sudo fdisk -l
3. Display LUKS header info:
~$ sudo cryptsetup -v luksDump /dev/sdh1
4. Unlock partition with LUKS passphrase:
~$ sudo cryptsetup -v luksOpen /dev/sdh1 sdh1_crypt
5. Mount drive using Nautilus or manually:
~$ mkdir /tmp/disk
~$ sudo mount /dev/mapper/sdh1_crypt /tmp/disk