Mount

EXT4硬碟掛載到windows後無法掛載

  • October 2, 2016

我有一個 2TB 的西式外置硬碟。

它的原始文件系統是 NTFS,但我將其格式化為 EXT4。

我在 Linux 上沒有問題;但是今天我ext2fsd在 Windows 盒子中安裝它之後,我不能再在 Linux 中安裝它了!

該驅動器沒有分區,但在 windows mount 後Disk Utility顯示它有一個 1KB 分區和 2TB 未分配空間!!!

我的數據沒有損壞(我仍然可以ext2fsd在 Windows 中查看我的文件!)

嘗試使用掛載mount -t ext4失敗並且 dmesg 說:

EXT4-fs (sdb): VFS: Can't find ext4 filesystem  

fsck給出:

e2fsck 1.41.11 (14-Mar-2010)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
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>

我認為 Western 的內部應用程序是在 Windows 中啟動的,並通過為自己創建分區來破壞 FS。

我該如何解決?


我也嘗試過e2fsck -b 8193 /dev/sdb並得到了相同的結果:

e2fsck 1.41.11 (14-Mar-2010)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
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>

所以我嘗試使用 找到超級備份超級塊testdisk,它給出了:

superblock 0, blocksize=4096 [Ariyan2T]
superblock 32768, blocksize=4096 [Ariyan2T]
superblock 98304, blocksize=4096 [Ariyan2T]
superblock 163840, blocksize=4096 [Ariyan2T]
superblock 229376, blocksize=4096 [Ariyan2T]
superblock 294912, blocksize=4096 [Ariyan2T]
superblock 819200, blocksize=4096 [Ariyan2T]
superblock 884736, blocksize=4096 [Ariyan2T]
superblock 1605632, blocksize=4096 [Ariyan2T]
superblock 2654208, blocksize=4096 [Ariyan2T]

我嘗試使用它來修復它fsck.ext4 -b 32768 -B 4096 /dev/sdb,結果是:

e2fsck 1.41.11 (14-Mar-2010)
fsck.ext4: Bad magic number in super-block while trying to open /dev/sdb

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
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>

fdisk -l /dev/sdb返回:

Warning: invalid flag 0x0000 of partition table 5 will be corrected by w(rite)

Disk /dev/sdb: 2000.4 GB, 2000365289472 bytes
255 heads, 63 sectors/track, 243197 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00021365

  Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      243198  1953480704   85  Linux extended

sudo dd if=/dev/sdb bs=512 count=1 skip=262144 | xxd -a:

1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.42691 s, 1.2 kB/s
0000000: ae61 5cc1 3be6 6d8d ceed 0cc8 293b fa1b  .a\.;.m.....);..
0000010: 5931 fa58 7420 550a b40e 7b1c b0a6 ad60  Y1.Xt U...{....`
0000020: 1f29 dcae af2a a935 7185 f1d9 6b64 7f29  .)...*.5q...kd.)
0000030: fed0 4c79 fc3b 1544 becd bda0 e7a4 836b  ..Ly.;.D.......k
0000040: ea50 1800 0868 89ac 592d 63a2 05e5 116d  .P...h..Y-c....m
0000050: 4654 9870 671a e11d 7ae0 6bdd dd23 bf5a  FT.pg...z.k..#.Z
0000060: 94ac a20d 695b d010 d8f2 4620 5930 561b  ....i[....F Y0V.
0000070: af93 7d8c 06c3 72c7 3757 7815 e955 3278  ..}...r.7Wx..U2x
0000080: 5773 22b3 2908 52b5 f7e9 59ea b618 5830  Ws".).R...Y...X0
0000090: b29f d244 9a72 ead9 5a77 d3ce e83a 8c44  ...D.r..Zw...:.D
00000a0: 96d9 a89f dd82 b72a f624 10a8 0f44 31a5  .......*.$...D1.
00000b0: 29b6 811a f9cd 175a c00b 670a 5051 ce87  )......Z..g.PQ..
00000c0: 5b00 bd80 20d5 c6e5 f0d0 593e f923 005d  [... .....Y>.#.]
00000d0: 1a6f 83ea 7f28 3305 dc72 7d92 4258 cb4e  .o...(3..r}.BX.N
00000e0: 00de 6a6c 4575 d355 3682 28dd f765 e099  ..jlEu.U6.(..e..
00000f0: 1193 d0cc 64ad a841 ecd7 2c24 08e2 96f5  ....d..A..,$....
0000100: 0fb2 e4fd ef04 1914 f63c 30ce 0df9 3470  .........<0...4p
0000110: 166f 080d 7872 dfce a854 ef20 a237 447a  .o..xr...T. .7Dz
0000120: 05b1 653f 109b 52c3 553b 966c 9733 838e  ..e?..R.U;.l.3..
0000130: c2c9 52cd 4b8f 1e85 cd70 abf4 f9b6 c0c5  ..R.K....p......
0000140: 1412 0f2f 8389 9f4b 94af a523 c6c5 6e04  .../...K...#..n.
0000150: 25d4 d049 fde8 cd9d 94bd 608e e08a f6c6  %..I......`.....
0000160: 389a 5571 9182 d642 7680 f905 9fb6 179a  8.Uq...Bv.......
0000170: 9c6c 5290 ec62 a44f 3f05 fa39 f2a1 18c7  .lR..b.O?..9....
0000180: ba96 297f 2d04 a646 8cc8 e50c ee90 76c0  ..).-..F......v.
0000190: f9ae e586 0f89 6227 35bb b390 9477 8720  ......b'5....w. 
00001a0: 2a6c c2b1 9f15 ecdd 8216 523c 2b61 731e  *l........R<+as.
00001b0: 1b1f 0d24 5914 7e8a 7c32 957b 4f24 a464  ...$Y.~.|2.{O$.d
00001c0: ccb4 ecd9 7d1e 967d 9d6b ee20 fa02 9e65  ....}..}.k. ...e
00001d0: 593c 640e fbd2 4f6e e0f8 53b8 4b4a b3fa  Y<d...On..S.KJ..
00001e0: a630 30f1 8170 55a4 dd91 805c d522 9412  .00..pU....\."..
00001f0: 7c0f 1afa ff47 ab23 9721 5a3d f87a 181f  |....G.#.!Z=.z..

sudo dd if=/dev/sdb bs=512 count=1 skip=2 | xxd -a

1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000880215 s, 582 kB/s
0000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
*
00001f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................

一個問題:我可以在mkfs.ext4 -S /dev/sdb不失去數據的情況下修復它嗎?


在位置 0x38 ( ) 處skip=2050有一個 :53ef``sudo dd if=/dev/sdb bs=512 count=1 skip=2050 | xxd -a

1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000688801 s, 743 kB/s
0000000: 0000 4707 00f0 1b1d cc98 7401 769e 2a1a  ..G.......t.v.*.
0000010: 9df7 4607 0000 0000 0200 0000 0200 0000  ..F.............
0000020: 0080 0000 0080 0000 0020 0000 ce17 0750  ......... .....P
0000030: ce17 0750 1a00 2600 53ef 0100 0100 0000  ...P..&.S.......
0000040: a26d 9d4f 004e ed00 0000 0000 0100 0000  .m.O.N..........
0000050: 0000 0000 0b00 0000 0001 0000 3c00 0000  ............<...
0000060: 4202 0000 7b00 0000 8160 9a1f f334 4827  B...{....`...4H'
0000070: b6df 00c2 8981 7b36 4172 6979 616e 3254  ......{6Ariyan2T
0000080: 0000 0000 0000 0000 2f6d 6564 6961 2f41  ......../media/A
0000090: 7269 7961 6e32 5400 4bb7 7001 80fd 39e9  riyan2T.K.p...9.
00000a0: 607c e2c0 8098 6ced 94be 7fed 1529 21c0  `|....l......)!.
00000b0: 6026 a0c5 c280 0000 6026 a0c5 2042 b0c5  `&......`&.. B..
00000c0: 0000 0000 2042 b0c5 0000 0000 0000 8b03  .... B..........
00000d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000e0: 0800 0000 0000 0000 0000 0000 b536 a950  .............6.P
00000f0: 02a9 455e 9fa8 b9a3 0f2b 61b1 0101 0000  ..E^.....+a.....
0000100: 0000 0000 0000 0000 a26d 9d4f 0af3 0200  .........m.O....
0000110: 0400 0000 0000 0000 0000 0000 ff7f 0000  ................
0000120: 0080 880e ff7f 0000 0100 0000 ffff 880e  ................
0000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000140: 0000 0000 0000 0000 0000 0000 0000 0008  ................
0000150: 0000 0000 0000 0000 0000 0000 1c00 1c00  ................
0000160: 0100 0000 0000 0000 0000 0000 0000 0000  ................
0000170: 0000 0000 0400 0000 5962 660c 0000 0000  ........Ybf.....
0000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................
*
00001f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................

mount -t ext4 /dev/sdb1 /media/tmpmp/返回:

mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

file -s /dev/sdb1返回:

/dev/sdb1: data

在沒有分區表的情況下格式化硬碟上的文件系統是很不尋常的。實際上,您之前似乎確實有一個分區表,並且該分區從扇區 2048 開始,這是當今磁碟上第一個分區的通常起始位置。如果您執行fdisk並使用u命令將其單位更改為扇區,然後使用該命令創建一個新分區n,並將起始扇區設置為 2048,然後w保存並退出,那麼一切都應該是 kosher。確保e2fsck -f在分區上。

引用自:https://unix.stackexchange.com/questions/43421