#[SOLVED] I fucked up and probably deleted my OS

407 messages · Page 1 of 1 (latest)

eternal ridge
#

Currently i got dual boot with windows10 and Arch. I decided that ill try KDE on a third os so i decided to make another Arch and since i wasnt feeling like doing the entire Arch installation, i just did this with archinstall:

lsblk
cfdisk /dev/nvme0n1
create partitions: 1G [ efi system ] and the rest [ linux filesystem ]
write
lsblk
mkfs.fat -F32 /dev/nvme0n1p7
mkfs.ext4 /dev/nvme0n1p8
lsblk
mount /dev/nvme0n1p7 /mnt
mkdir /mnt/boot
mount /dev/nvme0n1p8 /mnt/boot
archinstall

That gave me an error and now i cant enter to Grub or my original Arch. Im currently in grub rescue, it gives me error: unknown file system.

Here were all my partitions before i fucked it up:

#

ill actually go insane if i lose my hyprland config

#

in windows disk management i still see my arch OS tho so perhaps its still saveable?

forest temple
#

@eternal ridge did you backup your config to git*

eternal ridge
#

nope...

#

im actually gonna kms

shrewd fossil
eternal ridge
#

yea ok

#

@shrewd fossil

#

Original arch is the 630g (nvme0n1p5) and the 1g should be nvme0n1p4

shrewd fossil
#

Execute lsblk -f

eternal ridge
#

ok

shrewd fossil
#

sudo mount -v -t ext4 -o ro /dev/nvme0n1p5 /mnt

#

See if it works

eternal ridge
#

@shrewd fossil

#

sorry its a little blurry

shrewd fossil
#

Cd /mnt

#

Ur files are there

#

Or they should

eternal ridge
#

yea they are

shrewd fossil
#

If u did not reformat the partition

shrewd fossil
eternal ridge
#

well i wanted to fix grub so i could boot in

shrewd fossil
#

Alright

#

First of all do a backup of what u want to save

#

In case u fuck up something or for the future

#

Then send grub.cfg

eternal ridge
#

ok

#

wait

#

could i use timeshift or would that not do anything?

shrewd fossil
#

Never used it honestly

eternal ridge
#

@shrewd fossil

shrewd fossil
#

Thats not grub.cfg

#

Grub cfg is in ur ESP

eternal ridge
#

oh sry

#

nano /boot/grub/grub.cfg ?

#

^ that says the directory doesnt exist, i cant find it lol

#

@shrewd fossil

#

i think my grub uninstalled itself? But then why would i have that /etc/default/grub file?

#

in the boot folder is literally nothing

valid lily
eternal ridge
#

uuuh nope

eternal ridge
#

yea theres grub.cfg now

#

@shrewd fossil

shrewd fossil
#

can u send the exact error grub threw u

#

?

eternal ridge
#

Sorry i went to sleep ill send it as soon as possible

eternal ridge
shrewd fossil
#

Yep if u can send a pic or video trying to boot

eternal ridge
#

Someone said i could run a grub repair script from Ubuntu live iso so im gonna try that

shrewd fossil
#

Well

#

Not that hard i think

#

Ill be online later

eternal ridge
#

ok thank you np

shrewd fossil
#

please

#

mount ur esp into some dir

#

then copy here the files that are present there

#

like their names not the files

eternal ridge
#

ok

#

in /mnt/boot/EFI/ is BOOT and GRUB

eternal ridge
shrewd fossil
#

is that ur boot partition?

#

so then is obvious grub wont find the files needed

#

cause u specified /vmlinuz-linux-zen

#

and there is no such file

eternal ridge
#

the boot partition is the 1g one right?

shrewd fossil
#

yep

eternal ridge
#

yea i have that obe mounted to /mnt/boot

#

one*

shrewd fossil
#

and where is grub installed

#

also there?

eternal ridge
#

yup

#

/mnt/boot/grub

shrewd fossil
#

sudo blkid (boot partition)

#

send its UUID

eternal ridge
#

ok

#

UUID="F684-0879"

shrewd fossil
#

can u paste here the entire grub.cfg?

#

i cant see it well

eternal ridge
#

well i can send a video cuz its long af

shrewd fossil
#

so just paste it then

#

use some live iso and put that in a pastebin or something

eternal ridge
#

oh ok

#

can i use an ubuntu live iso?

shrewd fossil
#

there is no boot entry in there

eternal ridge
#

oh shit 💀

shrewd fossil
#

what grub cfg were u looking at

eternal ridge
#

thats the /mnt/boot/grub.cfg

shrewd fossil
#

so there is no linux boot entry

eternal ridge
#

and how can i fix it?

shrewd fossil
#

creating a boot entry lol

shrewd fossil
#

cause here there is a boot entry

eternal ridge
#

thats the same file lol

shrewd fossil
#

bro

#

look at what u pasted here

#

there is no boot entry

#

its not the same lol

eternal ridge
#

ok im a fucking dumbass

#

XD

#

ooooh yeaaa

#

1sec

shrewd fossil
#

alright

#

there is a windows entry but not an arch one

eternal ridge
#

i think in the screenshot it was in the EFI folder

#

but now the EFI folder is empty

shrewd fossil
#

i do not want to be rude but i think u are not being specific

eternal ridge
#

the one i pasted here is /mnt/boot/grub/grub.cfg

shrewd fossil
#

alright so why do u have two grub.cfg

#

is grubinstalled on /mnt/boot/EFI

#

?

eternal ridge
#

right now its not there XD

#

but i swear to god in the screenshot it was from the EFI folder

#

because someone said to mount my EFI partition

#

and then i did

#

checked the folder

#

and there was grub.cfg

shrewd fossil
#

well...

#

u MUST set grubs root into some filesystem, grub does not only support FAT so u can have ur boot files in other filesystem such as ext4

#

if u install grub in /mnt/boot/EFI for example

#

which is the mountpoint for a fat32 fs

#

there must be a grub/grub.cfg

#

but ur boot files can be in other location

#

so

#

if u have in ur grub cfg

#

/vmlinuz-linux-zen and u set root to the ESP (where grub is installed /mnt/boot/EFI)

#

u MUST have that file in /mnt/boot/EFI

#

not /mnt/boot

#

if u want to have the files in /mnt/boot u MUST state it in the grub cfg

#

idk if i explained it well

eternal ridge
#

yea i think i understand

#

well since i have a backup of my home folder i could just reinstall arch tbh...

#

i just hope my hyprland config will stay the same

#

(which it should)

shrewd fossil
#

well obv u can do it but i dont think its necessary, people tend to reinstall arch on every problem they have, i would not recomend this cause to learn u must face problems

#

if this is not a deeper problem and its as simple as i said

#

i would not reinstall honestly

#

but do whatever u want

eternal ridge
#

hmm ok

#

ill keep trying then

#

maybe reinstall grub?

#

idk if that would help

shrewd fossil
#

no need to

#

please

#

boot into grub

#

ill tell u some command

eternal ridge
#

ok

#

give me some minutes ill copy more of my files to backup just to be sure

#

says 20 mins left

shrewd fossil
#

alright

#

for u to know

#

ill guide u on booting up ur system with the command line

#

ill need ur root filesystem (ext4) UUID for this

#

paste it here pls

eternal ridge
#

ok

#

/dev/nvme0n1p5: UUID="6b20a527-ad0b-4689-b08e-771e805ec0f0" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="72ac3d81-dbe8-40a3-b0d1-ae5ec0f71014"

eternal ridge
shrewd fossil
#

alright

#

type set

#

send pic

eternal ridge
#

ok 1sec i gotta go back to grub rescue xd

eternal ridge
shrewd fossil
#

just set

#

not type set

eternal ridge
#

ah ok

shrewd fossil
#

i think i can guess whats the issue is but lets see

#

ls (hd2,gpt5)

eternal ridge
shrewd fossil
#

give me a sec

eternal ridge
#

oki

shrewd fossil
#

insmod ext2

shrewd fossil
eternal ridge
shrewd fossil
#

wait i think i misstyped the module

#

insmod normal

#

does it allow this?

eternal ridge
#

says error unknown file system when i type insmod normal

shrewd fossil
#

i think grub cant find its modules cause they are located in a filesystem it does not recognize

#

its and egg-chicken problem

#

well

#

then go to the arch live iso

#

mount ur root and ur boot

#

tell me when ready

eternal ridge
#

okay

eternal ridge
shrewd fossil
#

ur boot partition was 5 or 4?

eternal ridge
#

4

#

1g one?

#

yea 4

shrewd fossil
#

where is it mounted

eternal ridge
#

/mnt/boot

shrewd fossil
#

ls /mnt/boot

eternal ridge
shrewd fossil
#

ls /mnt/boot/grub

#

do u have there a dir called x86_64

#

and grub.cfg?

eternal ridge
eternal ridge
shrewd fossil
#

list that dir please

#

see if u have bunch of modules there

eternal ridge
#

yup i do

#

tons

shrewd fossil
#

great

#

so im quite sure ur problem is that u have a bad prefix

#

let me take a look at ur grub.cfg

eternal ridge
#

empty

#

lol is that supposed to be empty?

shrewd fossil
#

it cant be empty u sent it to me before

eternal ridge
#

it is empty XD

shrewd fossil
#

so where is the grub.cfg with content

eternal ridge
shrewd fossil
#

that does not answer my question lol

shrewd fossil
#

so thats the file u are checking

#

u told me that file is /mnt/boot/grub/grub.cfg

#

now u are saying its empty

#

??????

eternal ridge
#

uuuuh

#

no fkin way i cut the content of the file when i pasted it here

shrewd fossil
#

lol

#

anyways u wont need it for now

#

boot intro grub

#

then

eternal ridge
#

ok

shrewd fossil
#

set prefix=(hd2,gpt4)/grub

#

insmod normal

#

see if that works

eternal ridge
#

seems to work

shrewd fossil
#

great

#

now type normal

eternal ridge
#

OMG

#

OMG

shrewd fossil
#

worked?

eternal ridge
shrewd fossil
#

exactly

eternal ridge
#

ur an actual hero

shrewd fossil
#

so the issue is ur grub prefix

eternal ridge
#

can i boot to Arch now and edit files from there?

shrewd fossil
#

grub is searching for the config and modules where it does not have to

shrewd fossil
eternal ridge
#

ok

#

im in

#

so what should i edit?

#

cuz i noticed the grub resolution was totally fucked

shrewd fossil
#

go to /boot

eternal ridge
#

grub.cfg now has code

#

ill send it here

#

thats /boot/grub/grub.cfg

shrewd fossil
#

good

#

try this pleaso

#

grub-mkconfig -o ~/grub.bak

#

then send ~/grub.bak

eternal ridge
#

and wheres the grub.bak?

#

nvm i found it

#

how can i copy from nano again? lol

shrewd fossil
#

u dont need to copy

#

send that file in discord

#

dont u have it installed on arch?

eternal ridge
#

bruh

#

infinite processing -_-

#

cant open in VSCode either aaaaaaaaaa

shrewd fossil
#

ok no worry

#

i would try the following

#

maybe not the cleanest fix

#

but can fix it

#

the cleanest should be regenerating the grub.cfg but since u have themes, windows entries etc this may not be the best

#

so

#

just open /boot/grub/grub.cfg

#

and at the top

#

even before # DO NOT EDIT ....

eternal ridge
shrewd fossil
#

then after this in the next line

eternal ridge
#

ok

#

like this

shrewd fossil
shrewd fossil
#

reboot and see if it works

eternal ridge
#

ok

#

so like this

#

just to be sure

shrewd fossil
#

but in different lines

#

not in the same one

#

lol

eternal ridge
#

oh ok

#

third times the charm

shrewd fossil
#

yeah

#

see if it works

eternal ridge
#

Booted me to windows lol

#

I think i need to change the boot order

shrewd fossil
#

maybe

#

or just use the boot menu

eternal ridge
#

Didnt work

#

Grub rescue again

#

Also didnt see grub in boot menu

shrewd fossil
#

just one thing cause i saw it before

#

ur boot partition has a dir called "System Volume Information"

#

this dir is created auto by windows

#

but windows do not mount ESPs

#

so

#

whats the partition type of ur ESP

#

cause if it is not ESP type UEFI wont detect it as a boot option

#

it will only boot that partition when a boot entry is present in the NVRAM

eternal ridge
#

how can i check

shrewd fossil
#

later we will check

eternal ridge
#

now boot into Arch again with the commands?

shrewd fossil
#

for now the issue is, without being quite sure since i do not know what u did exactly, that ur grub has a built-in prefix that is not correct

#

so u must change it manually or recreate the grub core

shrewd fossil
eternal ridge
#

ok

#

aight im in

shrewd fossil
#

ok

#

i think ik why it didnt work

#

i had misstype

#

open the file again

eternal ridge
#

got it

#

also the system volume information folder is empty

shrewd fossil
#

the set prefix line must be set prefix=($root)'/grub'

#

also in the nextline add:

eternal ridge
#

so the same but with 2 's

shrewd fossil
#

configfile /grub/grub.cfg

eternal ridge
#

ok

shrewd fossil
eternal ridge
#

so like this

shrewd fossil
#

im not quite sure cause it isnt well documented

#

and i am doing this without knowing ur disk condition

#

but it should be like that i think

#

anyways we fixed ur main issue

eternal ridge
#

aight ill reboot

#

also should grub be automatically at top of boot order ?

#

cuz i think it does it automatically

shrewd fossil
#

that depends on ur preference

#

it does not need to

eternal ridge
#

hmm ok ill check to be sure

shrewd fossil
#

the boot entries can be at any other

#

grub does not care about that since its out from his capability

#

if this does not work i think ull need to reinstall grub cause the prefix cant be changed manually cause it wont find the grub.cfg auto to change it

#

do u understand?

#

its an egg-chicken problem

eternal ridge
#

umm

#

it didnt work

#

and now

#

the commands to boot also dont work

shrewd fossil
#

they must work lol

eternal ridge
#

it just gives me a black screen

#

ill try once more

shrewd fossil
#

set prefix=(hd2,gpt5)/grub

eternal ridge
#

oh i did gpt4

shrewd fossil
#

so the solution here is simple

#

use these commands in grub rescue or regenerate the grub core for a permanent fix

eternal ridge
shrewd fossil
#

oh but ur partition boot was 4 or 5

eternal ridge
#

4

shrewd fossil
#

maybe i misstyped mb

#

so then its 4

#

set prefix=(hd2,gpt4)/grub

eternal ridge
#

yea but it gives me a black screen

shrewd fossil
#

maybe caused by the lines we wrote earlier

#

just remove them

eternal ridge
#

set prefix=(hd2,gpt4)/grub
insmod normal
normal

#

ok so ill go to arch iso again

shrewd fossil
#

great

eternal ridge
#

its /mnt/boot/grub/grub.cfg ?

#

yea it is

eternal ridge
#

wait maybe it didnt work cuz we didnt generate new grub config?

shrewd fossil
#

the first three lines we added

shrewd fossil
eternal ridge
#

true

#

aight deleted them

#

works now

forest temple
#

... solved

restive talonBOT
#

#9742 📣 If there is nothing else that we can do for you, please close this thread by adding "[SOLVED]" to the title.

  • You can do this on desktop by clicking the three dots on the top right of the page, and pressing "Edit Post".
  • You can also do this on Android / iOS by long tapping your post in the text channel list, and tapping "Edit Post".

Your title should be like so: https://cdn.discordapp.com/attachments/503224329191030787/1039841700417384498/image.png
Thank you

shrewd fossil
eternal ridge
#

not solved lol grub menu still doesnt appear

shrewd fossil
#

u said it worked now

eternal ridge
#

i meant that i can boot to arch

#

from the rescue

shrewd fossil
#

so ur main issue is solved, i told u how to fix this the beautiful way

#

just reinstall grub core

eternal ridge
#

aight will do that

shrewd fossil
#

great so as @forest temple said, please mark this is as solved

#

... solved

restive talonBOT
#

#9742 📣 If there is nothing else that we can do for you, please close this thread by adding "[SOLVED]" to the title.

  • You can do this on desktop by clicking the three dots on the top right of the page, and pressing "Edit Post".
  • You can also do this on Android / iOS by long tapping your post in the text channel list, and tapping "Edit Post".

Your title should be like so: https://cdn.discordapp.com/attachments/503224329191030787/1039841700417384498/image.png
Thank you

eternal ridge
#

oki