如何恢复我的超级块?

如何恢复我的超级块?
user@localhost:$ LC_ALL=C sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! 
The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xe4948bbb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1953525167   976762583+  ee  GPT
Partition 1 does not start on physical sector boundary.

尝试dumpe2fs我的 /dev/sda1 :

sudo dumpe2fs /dev/sda1 | grep -i superblock

dumpe2fs: Ongeldig magisch getal in superblok tijdens openen van /dev/sda1

[ dumpe2fs: magic number not valid during opening /dev/sda1 ]

我怎样才能修复我的超级块?

答案1

列出备份超级块:

sudo dumpe2fs /dev/sda1 | grep -i backup

然后使用备份超级块,32768 只是一个例子,尝试几个

sudo fsck -b 32768 /dev/sda1

一个用户无法卸载分区(可能需要 swapoff),但使用了另一个实时发行版

只有 16.04 中较新的 fdisk 才能正确显示 gpt 分区。请使用 parted 或 gdisk。

sudo parted /dev/sda unit s print

sudo gdisk -l /dev/sda

答案2

我遇到了类似的问题,我的 Ubuntu 系统无法启动(在多重启动情况下),并且无法从其他 Linux 系统安装。在实时会话中,gparted 报告了坏超级块。

我已经遵循这个解决方案这里,但第一步对我来说已经足够了。

在实时环境中(或在另一个 Linux 系统中),我做了类似的事情:

sudo fsck.ext4 -v /dev/sda6

结果如下:

e2fsck 1.43.7 (16-Oct-2017)
ext2fs_open2: Superblock checksum does not match superblock
fsck.ext4: Superblock invalid, trying backup blocks...
/dev/sda6 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences:  -3014664 -(3014811--3014813) -(3014840--3014850) -(3014950--3014960) -(3014962--3014965) -3014970 -3014972 -(3014974--3014976) -(3014979--3014980) -(3014983--3014987) -3015043 -(3015053--3015055) -3015089 -(3015105--3015106) -3015121 -(3015179--3015183) -3015208 -3015258 -3015364 -3015392 -(3015470--3015475) -3015489 -(3015536--3015538)
...etc

此时我选择了“a”表示“修复全部”,并得到了很多这样的行:

Directories count wrong for group #272 (0, counted=1544).
Fix? yes

Free inodes count wrong (2362853, counted=2128687).
Fix? yes

最后

Block bitmap differences: Group 0 block bitmap does not match checksum.
FIXED.

/dev/sda6: ***** FILE SYSTEM WAS MODIFIED *****

      234177 inodes used (9.91%, out of 2362864)
         897 non-contiguous files (0.4%)
         165 non-contiguous directories (0.1%)
             # of inodes with ind/dind/tind blocks: 0/0/0
             Extent depth histogram: 210228/56
     5915339 blocks used (62.60%, out of 9449951)
           0 bad blocks
           1 large file

      189841 regular files
       19796 directories
           7 character device files
           0 block device files
           0 fifos
           0 links
       24521 symbolic links (23875 fast symbolic links)
           3 sockets
------------
      234168 files

之后一切都正常了。但在 Windows 7 中再次启动后,我不得不重新执行该过程。

奇怪的是,只有 Ubuntu 18.04 受到影响,Solus 没有受到影响。

对我来说,罪魁祸首是 Windows 程序 ext2fsd-正如所说这里- 删除它即可完全解决问题。

相关内容