自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Linux下恢復EXT3 Superblock的正確方法

運維 系統(tǒng)運維
恢復超級塊(Superblock)的過程其實也是一個有風險的過程.能做備份就做好備份. 如果有其他空閑設備, 用 dd 命令把該設備上的內容備份起來.

Linux Ext3文件系統(tǒng)超級塊(Superblock)錯誤問題.

.... bad superblock on /dev/hda4

一個同事做的恢復, 結果把數(shù)據(jù)都抹掉了. 后來想想, 當時的直接 fsck 的恢復方法不對. 正確的方法應該是這樣的:

1 獲取錯誤的出錯磁盤(或者設備)塊的大小.

有很多種方法可以得到. 比如,

# tune2fs -l /dev/hda4其實大多數(shù)情況下是 1 K.

2 對當前的出錯磁盤備份.

恢復超級塊(Superblock)的過程其實也是一個有風險的過程.能做備份就做好備份. 如果有其他空閑設備, 用 dd 命令把該設備上的內容備份起來.

3 一般來說, 超級塊錯基本上也就是主超級塊錯, 在 Ext2/Ext3 文件系統(tǒng)創(chuàng)建的時候, 會同時在屏幕上提示我們在已經(jīng)在幾個地方備份了超級塊.那么怎么發(fā)現(xiàn)這些超級塊在什么地方呢? 我們看看幫助信息:

-b superblock

Instead of using the normal superblock, use an alternative superblock specified by superblock. This option is normally used when the primary superblock has been corrupted. The locaion of the backup superblock is dependent on the filesystem's blocksize. For filesystems with 1k blocksizes, a backup superblock can be found at block 8193; for filesystems with 2k blocksizes, at block 16384; and for 4k blocksizes, at block 32768.

Additional backup superblocks can be determined by using the mke2fs program using the -n option to print out where the superblocks were created. The -b option to mke2fs, which specifies blocksize of the filesystem must be specified in order for the superblock locations that are printed out to be accurate.

If an alternative superblock is specified and the filesystem is not opened read-only, e2fsck will make sure that the primary superblock is updated appropriately upon completion of the filesystem check.

4 開始恢復.如果文件系統(tǒng)塊大小為1K, 則我們可以用如下命令恢復:

# /sbin/fsck.ext3 -b 8193 /dev/hda4

如果這個備用塊(8193)也有問題,那么 可以嘗試 24577(8192*3 1) ,或者是 40961 (8192*5 1).

可能您也會看出來,超級塊的保存位置是按照 1,3,5,7 這樣的規(guī)律的. 具體的位置在 BlockSize(8192)*N 1. 在超過 500M 的空間上是這樣的規(guī)律.小于 500M 的我不知道.那位知道告訴我一下,謝謝。

【編輯推薦】

  1. 修改Linux系統(tǒng)下22端口的兩種方法
  2. Linux下使用網(wǎng)站主機作為加密代理服務器
  3. Mac和Linux將面臨新的漏洞攻擊
責任編輯:趙寧寧 來源: zzit
相關推薦

2009-06-29 08:52:04

Linux

2009-06-27 21:41:55

Linux

2009-08-04 08:28:10

2010-03-15 16:30:53

Ubuntu Linu

2009-06-10 08:49:05

LinuxExt3恢復

2009-03-26 17:46:53

LinuxExt3Reiserfs

2012-05-08 10:56:15

Linux

2011-04-14 15:12:10

Linux恢復

2009-10-27 12:47:29

linux Ext3文

2009-11-30 09:46:45

Ubuntu文件系統(tǒng)選擇

2009-12-14 14:12:07

Linux文件系統(tǒng)

2017-11-23 09:30:01

Linux文件系統(tǒng)sudo命令

2010-02-03 11:01:26

Linux mount

2012-05-21 09:48:58

Ext4

2010-06-01 09:55:24

ext4文件系統(tǒng)

2010-03-01 13:32:42

Linux常用文件

2009-12-16 17:11:10

Fedora 掛載

2017-02-28 20:00:17

Linux文件系統(tǒng)對比

2009-10-22 12:09:57

linux文件系統(tǒng)

2018-09-12 15:48:35

ext4Linux文件系統(tǒng)
點贊
收藏

51CTO技術棧公眾號