Find out the device name of the damaged partition.
sudo parted -l
If the device has multiple partitions, you it can be helpful cross reference this with lsblk, example output below:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 232.9G 0 disk
└─sda1 8:1 0 232.9G 0 part /mnt/gns3
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 931.5G 0 part
└─sdb2 8:18 0 931.5G 0 part
sdc 8:32 0 1T 0 disk
└─sdc1 8:33 0 1024G 0 part /mnt/OSImages
nvme0n1 259:0 0 1.9T 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
├─nvme0n1p2 259:2 0 8G 0 part [SWAP]
├─nvme0n1p3 259:3 0 200G 0 part /
├─nvme0n1p4 259:4 0 654.3G 0 part /home
├─nvme0n1p5 259:5 0 100M 0 part
├─nvme0n1p6 259:6 0 16M 0 part
└─nvme0n1p7 259:7 0 244.2G 0 part
Determine the location of the backup superblocks.
sudo mke2fs -n /dev/xxx
For example, the device name of my HDD partition is /dev/sdb1, so I run
sudo mke2fs -n /dev/sdb1
It will tell you that the partition contains an ext4 file system, press y to continue. Don’t worry the -n option tells mke2fs not to create a file system.
mke2fs 1.45.5 (07-Jan-2020)
/dev/sdb1 contains a ext4 file system labelled 'DataStoreLin'
last mounted on /mnt/DataStoreLin on Thu Jan 28 02:43:43 2021
Proceed anyway? (y,N) y
Creating filesystem with 7864320 4k blocks and 1966080 inodes
Filesystem UUID: fcae3dc8-ee11-412c-97f0-27106601314e
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
At the bottom, you can see the location of backup superblocks. Next, restore the superblock from the first backup copy.
sudo e2fsck -b 32768 /dev/xxx
Now you should be able to mount your ext4 partition.
sudo mount -a
This will attempt to mount all unmounted file systems in the
fstabfile
or
sudo mount /dev/xxx /mnt/point
This will attempt to mount a specific file system to a specific mount mount