日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

Linux下恢復(fù)EXT3 Superblock的正確方法

;Linux Ext3文件系統(tǒng)超級塊(Superblock)錯誤問題. .... bad superblock on /dev/hda4 一個同事做的恢復(fù), 結(jié)果把數(shù)據(jù)都抹掉了. 后來想想, 當(dāng)時的直接 fsck 的恢復(fù)方法不對. 正確的方法應(yīng)該是這樣的: 1 獲取錯誤的出錯磁盤(或者設(shè)備)塊的大小. 有很多種方法可以得到. 比如, # tune2fs -l /dev/hda4其實大多數(shù)情況下是 1 K. 2 對當(dāng)前的出錯磁盤備份. 恢復(fù)超級塊(Superblock)的過程其實也是一個有風(fēng)險的過程.能做備份就做好備份. 如果有其他空閑設(shè)備, 用 dd 命令把該設(shè)備上的內(nèi)容備份起來. 3 一般來說, 超級塊錯基本上也就是主超級塊錯, 在 Ext2/Ext3 文件系統(tǒng)創(chuàng)建的時候, 會同時在屏幕上提示我們在已經(jīng)在幾個地方備份了超級塊.那么怎么發(fā)現(xiàn)這些超級塊在什么地方呢? 我們看看幫助信息: -b superblockInstead of using the normal superblock, use an alternativesuperblock specified by superblock. This option is normallyused when the primary superblock has been corrupted. The loca-tion of the backup superblock is dependent on the filesystem"sblocksize. For filesystems with 1k blocksizes, a backupsuperblock can be found at block 8193; for filesystems with 2kblocksizes, at block 16384; and for 4k blocksizes, at block32768.Additional backup superblocks can be determined by using themke2fs program using the -n option to print out where thesuperblocks were created. The -b option to mke2fs, which spec-ifies blocksize of the filesystem must be specified in order forthe superblock locations that are printed out to be accurate.If an alternative superblock is specified and the filesystem isnot opened read-only, e2fsck will make sure that the primarysuperblock is updated appropriately upon completion of thefilesystem check.4 開始恢復(fù).如果文件系統(tǒng)塊大小為1K, 則我們可以用如下命令恢復(fù): # /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 的我不知道.那位知道告訴我一下,謝謝 。

    推薦閱讀