World is Welcome To The World of Linux

Journey into the world of linux

Menu
  • About
  • Welcome
Menu

How To Recover A Superblock

Posted on April 9, 2009 by Ganesh Sharma

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

If fsck or mount commands give errors then pretty good chances are there that the superblock is corrupt. The dd command comes to rescue. We know that the superblock resides in 31st block also. So, to recover that we use the following command:

# dd count=1 bs=4k skip=31 seek=1 if=/dev/my_lv  of=/dev/my_lv

count: How many blocks to copy.

bs: Block size(which is taken 4k by default).

skip: Skip number of  blocks.

seek: Get 1st record.

So, the above command will copy the 31st block to the 1st block.

Running fsck command is recommended after restoring the superblock.

Recovering Superblock In Linux

In case of Linux, the superblock is copied to 8193, 32768, 98304, 163840, 229376 and 294912 blocks. So, simply running:

#e2fsck -b 32768 /dev/hda5

Should do the trick. Superblock is started to be backed up at 32768 position in the most current systems. So, 32768 is safe option for almost all systems.

1 thought on “How To Recover A Superblock”

  1. skm says:
    April 4, 2012 at 23:33

    your IF and OF are the same, how will that backup any data that is there?
    Shouldn’t the OF be a place on your hard drive instead of the mount point you are copying from?
    Or am I missing something…

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Date Command Tutorial(Video)
  • grep Command Tutorial – 1(Video)
  • Introduction To ls Command(Video)
  • Chapter 3
  • Set Position Of Poll Module Into Joomla

Recent Comments

  • Kansas City Trailer Proz on Physical Volume In AIX – A Primer
  • Create volume group in AIX | myunixsheet on How To Create Volume Group
  • Restore of AIX backup on other Unix system - TecHub on What is mksysb And What Are Its Components
  • Firewall Unleashed - InfoSec Institute on Packet Filtering Firewall: An Introduction
  • Manwendra on Proxy Firewall and Gateway Firewall: Introduction

Archives

  • January 2019
  • June 2010
  • May 2010
  • February 2010
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008

Categories

  • 30 Days To Joomla WebSite Setup
  • A Journey To The World of Linux System Administration
  • Aix
  • Backups
  • Books
  • Firewalls
  • Introduction
  • Joomla
  • Joomla Backup
  • Joomla Web Technology
  • Linux
  • LPAR and Virtualization
  • LVM
  • Pluggable Authentication Modules
  • section navigator pro
  • Security
  • Security Knowledge Base
  • Tips and Tricks
  • Uncategorized
  • World is Welcome Products

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
©2023 World is Welcome To The World of Linux | WordPress Theme by SuperbThemes