Reformatted LMDE partition, booting to Grub CLI

Questions about Grub, the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ovisx5
Level 1
Level 1
Posts: 6
Joined: Sun Aug 21, 2022 1:19 pm

Reformatted LMDE partition, booting to Grub CLI

Post by ovisx5 »

Bit of a panic right now... in the process of trying to make a bootable usb I accidentally reformatted the partition of my drive containing LMDE and my whole main system... oh boy

I was dual booting with Win10 and LM on the same drive with each on a separate partition I manually split. Inside of Win10 I reformatted the partition containing LM inside of the file manager and it now appears as an empty D drive. I tried looking at TestDisk and I identified the location of the reformatted partition but I didn't know where to go from there.

How should I proceed from here? I was just about to install a new drive with a fresh install of Win10 so I'm in no rush to access my old system, I can just replace the drive in the meantime and continue to use my computer from there. Though if I needed to boot into my old Win10 partition how can I access it from grub cli?
Last edited by LockBot on Fri Jun 30, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Reformatted LMDE partition, booting to Grub CLI

Post by Termy »

Something I wish I'd known years ago: as soon as there is a mistake like this or otherwise a loss of data, the most immediate concern is avoiding further data loss, which in this case can be done by mounting the filesystem(s) as read-only. With every write, you risk data loss. In all likelihood, you're largely screwed, but it might be possible to recover some things, perhaps everything, if you're super lucky.

Do note write anything to any filesystems on that disk and don't mount any filesystems stored on it unless it's in read-only mode. If you need to know how to do this, look online, especially for how to mount a (presumably EXT4?) filesystem as readonly in Linux. Results showing Ubuntu, Linux Mint, and other Ubuntu-based distributions will likely serve you well, and as usual, try to find up-to-date information. Use caution, critical thinking, and refer to reliable sources, as always. There's probably lot of Testdisk threads on this site alone.

I would help properly, but there's not much I can or am willing to do unless I were sat at the machine. The best thing you can do is learn how to use Testdisk, before attempting anything. YouTube might be the most helpful, if you're a visual learner. Unless of course you get someone here who is willing and able to explain everything and walk you through everything, step-by-step, with screenshots, or possible remote access. From memory, there's an option to recover files and I believe filesystems, which I think is shown at the bottom of the Testdisk window. What would help is if you sent us screenshots of Testdisk, such as after the scan, what it found, pointing out what you want restored, etc. The problem is, it's quite variable.

Actually, if you have something like Discord and are willing to share your screen in a video chat with someone else who has the same client, that would probably be a great way to address this problem, because visual feedback is IMO crucial, especially if that data is important and/or you need this sorted in a timely manner.

Lastly, it's important you start backing up your data. Nobody wants to hear or read this after the fact, but everyone must.
I'm also Terminalforlife on GitHub.
ovisx5
Level 1
Level 1
Posts: 6
Joined: Sun Aug 21, 2022 1:19 pm

Re: Reformatted LMDE partition, booting to Grub CLI

Post by ovisx5 »

Thanks for the reply, as far as I'm aware most of the critical data I had on that partition already exists on my other devices or is already stored on the cloud (such as my password database, media, and documents). I might be missing some minor things I can't think of right now but as far as I know I have everything I need already off of that drive and I should be able to take some time to learn how to do things properly.

Yeah, I'm probably screwed as for recovering the whole partition. Windows already listed about 100mb being written onto the drive out of 256gb, I imagine that could've corrupted some core system files. For the time being I'm going to start fresh by physically replacing the affected drive and booting from a new install. The affected drive is a nvme SSD, a 970 Evo Plus, which I believe shouldn't suffer any major data loss stored away for a few weeks or months maximum while I find the time to figure this all out.

I'll look more into TestDisk and see how to troubleshoot further. Once I do start using it on the affected drive though I'll be sure to set it to read only to not further compromise data. Thank you for the support, I'll probably open a new thread once I feel I might be confident enough to try accessing the old drive.
User avatar
Termy
Level 12
Level 12
Posts: 4248
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Reformatted LMDE partition, booting to Grub CLI

Post by Termy »

ovisx5 wrote: Fri Dec 30, 2022 6:45 pm [...]
I once made a stupid mistake with a command-line tool called dd(1), something I've since trivially used a million times, but this was back when I barely knew my arse from my elbow in Linux, and I was following a questionable blog post. I lost almost 1T of data, much of which was important. Ironically, I lost that data while trying to back it up. I learned a few valuable lessons that day. In your case, the lesson is to have a good backup system in place — I use CloneZilla, primarily.

Best of luck to you.
Last edited by Termy on Sun Jan 01, 2023 9:31 pm, edited 2 times in total.
I'm also Terminalforlife on GitHub.
User avatar
MLED4
Level 2
Level 2
Posts: 88
Joined: Thu Oct 25, 2018 12:31 am

Re: Reformatted LMDE partition, booting to Grub CLI

Post by MLED4 »

I did this once but had data on a second partition, just dd'ed fatdog64 over my root partition and boot sector etc.
Rather than reboot, I googled the situation, and noticed I could access my data and copy it to disk, so that's what I did.

After about 3 months of suspending but never rebooting, it didn't come out of suspend one day, and booted into fatdog. This is when I decided to freshly install lmde, not before taking a second backup of all that data.
Locked

Return to “Installation & Boot”