56
submitted 11 months ago* (last edited 11 months ago) by jkozaka@lemm.ee to c/linux@lemmy.ml

While I was switching distros, I accidentally broke a partition. I'm almost certain that all the data is there, but it doesn't have a filesystem (I used ext4). Is there anything I can do to fix it, similar to changing the file extension without changing the contents. PS: It's a data partition. I was trying to resize it, accidentally also moved it to the left, found out that it was taking forever to move it, so I cancelled it. Finished the move to the left operation (I think), but it threw up an error about the filesystem. I don't remember what it was, though.

Thanks to everyone who suggested Testdisk. It worked almost perfectly.

you are viewing a single comment's thread
view the rest of the comments
[-] Illecors@lemmy.cafe 12 points 11 months ago

You can try fdisk.

If the partition table is there - create a new partition at the exact same location, of the exact same size.

If the partition table is not there - create *the exact same type (mbr vs gpt) partition table, then do the first if.

Fdisk should tell you that it found a filesystem signature. Do not wipe it.

[-] NeoNachtwaechter@lemmy.world 8 points 11 months ago

there - create a new partition at the exact same location, of the exact same size.

... exact same starting block, size and geometry.

this post was submitted on 26 Nov 2023
56 points (96.7% liked)

Linux

48179 readers
1128 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS