I have resized an ext4 partition using parted, and found online that, to resize it without data loss, I need to run mke2fs -S /dev/sdxx -t ext4 ; fsck.ext4 /dev/sdxx -p
. I took a look at the commands and their man pages, and it seemed fine, since they said they only overwrite the superblock, without touching anything else or discard other blocks.
However, this was the output:
mke2fs 1.45.5 (07-Jan-2020)
/dev/sda1 contains a ext4 file system
last mounted on Mon Oct 11 10:56:46 2021
Proceed anyway? (y,N) y
Discarding device blocks: done
Creating filesystem with 7145382 4k blocks and 1787040 inodes
Filesystem UUID: 55863129-4a43-4b9c-82eb-4432b623e0d0
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: done
/dev/sda1 may be further corrupted by superblock rewrite
Proceed anyway? (y,N)
This was already really concerning, since it said it was "discarding blocks". Then, I ran the fsck command and its output contained
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
Superblock has an invalid journal (inode 8).
Clear<y>? yes
*** journal has been deleted ***
and
Root inode is not a directory. Clear<y>? yes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Root inode not allocated. Allocate<y>? yes
At this point, i pretty much knew the FS was doomed.
I'd really appreciate any advice. The most important documents are ODT files, so technically ZIP archives. I have already tried writing a small program to extract everything with a PK[3,4] header, but this failed because of how the file system's structured.