rsync 凍結後無法讀取 RAID 10 LUKS 陣列上的超級區塊(帶有 Budgie 桌面的 Ubuntu Server 18.04.3)

rsync 凍結後無法讀取 RAID 10 LUKS 陣列上的超級區塊(帶有 Budgie 桌面的 Ubuntu Server 18.04.3)

在從外部 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)

系統是Ubuntu伺服器18.04.3,附Budgie桌面。所有 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

答案1

更換電纜並執行以下操作: 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

答案2

不過,我還沒有 Raid 設置,我自己在 Linux 上也遇到過錯誤。
確保它不是您的 eSATA 電纜。

如何修復 Ubuntu 上的檔案系統錯誤

使用 Ubuntu 安裝 CD 啟動系統,然後選擇測試 Ubuntu。
接下來,打開終端,並使用命令列
   $ sudo fsck.ext3 -f /dev/sdaX
啟動搜尋以查找任何錯誤。所有發現的錯誤都應該被修復。

您可以透過鍵入以下命令讓系統在下次重新啟動時檢查檔案系統
   須藤觸摸/forcefsck

相關內容