7

I am experiencing the above problem and I have no idea what caused this. Can someone help me figure this out?

1) I have already had my first disk /dev/sda working properly, now I am trying to create another FS on the 2nd disk:

$fdisk /dev/sdb [I pressed n, p, w under fdisk]

2) I took a look at the result of fdisk

$fdisk -l

Disk /dev/sda: 1999.0 GB, 1998998994944 bytes
255 heads, 63 sectors/track, 243031 cylinders, total 3904294912 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a6eb5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048  1953124351   976561152   83  Linux
/dev/sda2      1953126398  2070310911    58592257    5  Extended
/dev/sda5      1953126400  2070310911    58592256   82  Linux swap / Solaris

Disk /dev/sdb: 1999.0 GB, 1998998994944 bytes
31 heads, 7 sectors/track, 17992142 cylinders, total 3904294912 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x49802e7d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3904294911  1952146432   83  Linux

3) I make the following filesystem

$ mkfs.xfs -i size=1024 /dev/sdb

4) Now I see the problem...

$tune2fs -l /dev/sdb1 |grep -i inode
tune2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.

2 Answers 2

9

You need to create the FS on /dev/sdb1, not /dev/sdb.

mkfs.xfs -i size=1024 /dev/sdb1

(Might just be a typo in the question).

More important: tune2fs is meant for ext2/3/4 file systems, not XFS, so this can't work at all. What do you want to do with tune2fs?

1
  • there's a good chance xfs_admin is what they were after
    – Greg
    Aug 8, 2019 at 14:34
0

Try this:

mke2fs -n /dev/sdX

(-n is to not actually write, use --help) you should find superblocks location. Use this info (a number) to restore superblocks:

e2fsck -b 123456 /dev/sdX

to restore superblocks.. You might need to try several of the superblocks from the previous step.

Then try again to mkfs.ext4 /dev/sdX (or whatever filesystem you want)

Just in case someone find this thread and want the right answer.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .