0

I'm formatting a new 1TB HDD with a single dos partition; sdb1.

Typing sudo e2fsck -f /dev/sdb1:

$ sudo e2fsck -f /dev/sdb1

e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdb1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

I have a single partition, no extended partitions. I'm not sure what this message refers to. I have tried a variety of suggestions without success.

Is there an error or does this refer only to (nonexistent) extended partitions? Should I ignore this and continue and expand the space using resize2fs?

matigo
  • 20,403
  • 7
  • 43
  • 70
  • Does this answer your question? [Terminal method of formatting storage drive](https://askubuntu.com/questions/517354/terminal-method-of-formatting-storage-drive) - The command you are using does not format hard drives or create partitions. – Nmath Jan 24 '22 at 01:22
  • e2fsck is used to check the ext2/ext3/ext4 family of file systems, key word CHECK not create. – David Jan 25 '22 at 12:22

1 Answers1

1

To format a disk as ext4 (the default for Ubuntu), you could do it like this:

sudo mkfs -t ext4 /dev/sdb1

The e2fsck command is used to check partitions for errors. As there is no valid partition to check, there is technically an error.

matigo
  • 20,403
  • 7
  • 43
  • 70
  • Thank you! I tried to expand the fs space but got... $ sudo resize2fs /dev/sdb resize2fs 1.44.1 (24-Mar-2018) resize2fs: Bad magic number in super-block while trying to open /dev/sdb Couldn't find valid filesystem superblock. – Norm Norton Jan 24 '22 at 01:59
  • But trying your suggestion... mke2fs 1.44.1 Creating filesystem with 244190390 4k blocks and 61054976 inodes Filesystem UUID: 0adb5d57-2325-40b1-8589-f92f70cf4ff4 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848 Allocating group tables: done Writing inode tables: done Creating journal (262144 blocks): done Writing superblocks and filesystem accounting information: done – Norm Norton Jan 24 '22 at 02:07
  • then sudo fdisk --list...and there it is! Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 1953525167 1953523120 931.5G 83 Linux – Norm Norton Jan 24 '22 at 02:09