How to find superblock?
5,582
You can also find the superblock with
mkfs.ext4 -n /dev/sda
mkfs.ext2 -n /dev/sda
(pick ext4/ext2 if your system is ext4/ext2; REPLACE sda with your disk). From the manual:
-n
Causes mke2fs to not actually create a filesystem, but display what it would do if it were to create a filesystem. This can be used to determine the location of the backup superblocks for a particular filesystem, so long as the mke2fs parameters that were passed when the filesystem was originally created are used again.
Repairing
fsck -b 11111 /dev/sda
where 11111
is the superblock, and sda the partition (REPLACE both with what you need).
Related videos on Youtube
Author by
Ani
Updated on September 18, 2022Comments
-
Ani almost 2 years
I am trying to find the superblock with
dumpe2fs
command, but with this output there is no information about superblocks.-
guiverc about 6 yearsi don't know what you want; but
man dumpe2fs
says -h "only display the superblock information and not any of the block group..." -
Rinzwind about 6 years@guiverc dumpe2fs can error out and not show the superblock ;) The answer uses the "backup" location for the superblock (dumpe2fs does not use that one).
-
-
Ani about 6 yearstrying with mkfs.ext2 coz my fs is ext2
-
Ani about 6 yearsnot working after mkfs.ext2 command ask for wipe all data from partition
-
Rinzwind about 6 yearsYou did not include the
-n
: "Causes mke2fs to not actually create a filesystem" ? man page for ext2 is the same: linux.die.net/man/8/mkfs.ext2 -
Ani about 6 yearsroot@aniket-VirtualBox:/home/aniket# mkfs.ext2 -n /dev/sda1 mke2fs 1.42.13 (17-May-2015) /dev/sda1 contains a ext2 file system last mounted on /boot on Wed May 9 14:14:10 2018 Proceed anyway? (y,n)
-
Rinzwind about 6 yearsHow is that "ask(ing) for wipe all data from partition"?
-
Ani about 6 yearsi think mkfs is only use for apply fs on block not for checking super-block information
-
Rinzwind about 6 yearsThen explain the "-n" option to me ;-) That options shows the location of the superblock based on the --backup-- it created when making the filesystem. In case tools error out you can use that one since it is saved elsewhere it is likely to be corrupted if your superblock is.
-
Ani about 6 yearsfor this option check man page u will get all information related -n