You are not logged in.

#1 2019-03-16 11:04:01

budaria
Member
Registered: 2018-06-28
Posts: 11

Accidentally removed /boot from dual boot system

Hello,
I had windows 10 and arch linux.
I accidentally removed everything in /boot.
I have reinstalled kernel and grub but now grub does not detect windows 10.
I mounted windows partition,
I have ntfs-3g installed
Ran os-prober but still, no windows 10.

Maybe there were some windows boot files on /boot that were deleted? If yes, how do I restore it?

Thanks

buda@x240 ~$ sudo gdisk -l /dev/sda
[sudo] password for buda: 
GPT fdisk (gdisk) version 1.0.4

Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present

Last edited by budaria (2019-03-16 11:06:47)

Offline

#2 2019-03-16 11:07:38

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,791

Re: Accidentally removed /boot from dual boot system

Find a tutorial on how to restore the windows boot loader on an UEFI system.

This isn't an Arch support question, so you should be checking that and ask for support on Windows boards.

Closing. -- For deletion.

Wait is this a BIOS boot? Then that shouldn't be related. Did you rerun grub-mkconfig after installing os-prober and mounting the Windows partition?

Last edited by V1del (2019-03-16 11:11:04)

Online

#3 2019-03-16 13:54:20

budaria
Member
Registered: 2018-06-28
Posts: 11

Re: Accidentally removed /boot from dual boot system

Yes, this is a BIOS boot, and yes, I did, but no luck.

buda@x240 ~$ sudo grub-mkconfig -o /boot/grub/grub.cfg
[sudo] password for buda: 
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
done

What is a condition necessary for grub/os-prober to detect OS?


menuentry “Windows″ {
menuentry "Windows" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
chainloader +1
}

Windows is on /dev/sda2
I also added this entry to /etc/grub.d/40_custom and the new entry appeared in grub menu, but when I select it, windows does not boot.
It says no OS detected.

Last edited by budaria (2019-03-16 14:04:08)

Offline

#4 2019-03-16 17:40:58

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,748
Website

Re: Accidentally removed /boot from dual boot system

budaria wrote:

What is a condition necessary for grub/os-prober to detect OS?

See https://wiki.archlinux.org/index.php/GR … ng_systems

budaria wrote:
menuentry “Windows″ {
menuentry "Windows" {
insmod part_msdos
insmod ntfs
set root='(hd0,msdos2)'
chainloader +1
}

Is the first line a typo?

You shouldn't have two lines specifying the menuentry (or an unclosed curly bracket).

Also note that the stanza should be added to the end of the file, the first two lines (the shebang & `exec tail`) are needed for 40_custom to work correctly. But I presume this is the case because you see a new menuentry.

budaria wrote:

I accidentally removed everything in /boot.

How exactly did you do this?

Can we please see the output of

findmnt

Offline

#5 2019-03-16 19:14:36

budaria
Member
Registered: 2018-06-28
Posts: 11

Re: Accidentally removed /boot from dual boot system

Head_on_a_Stick wrote:

[
Is the first line a typo?

Yes, that's a typo. The file is correct (as entry does indeed appear when booting) and isn't missing the other required line you mentioned.

budaria wrote:

I accidentally removed everything in /boot.

How exactly did you do this?

Well, to be honest it wasn't very "accidental",  initially the problem was that I didn't have proper entry for /boot in fstab. So when I did the kernel update /boot wasn't mounted and the system was now broken.
I removed the /boot, reinstalled kernel and grub, and here I am now.

Can we please see the output of

findmnt

Here it is:
https://i.imgur.com/5dCIfwD.png

I tried pasting raw text but was formatted ugly.
Thanks for the url.
I already have os-prober, ntfs-3g, and the windows partition mounted, but it still fails to get detected.

I also disabled secure boot. But it's still the same.



moderator edit -- replaced oversized image with link.
Pasting pictures and code

Last edited by 2ManyDogs (2019-03-16 19:20:03)

Offline

#6 2019-03-16 19:26:31

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,748
Website

Re: Accidentally removed /boot from dual boot system

Why does /boot have fuseblk as the fs_vfstype?

Please post the full content of /etc/fstab (using code tags).

budaria wrote:

I removed the /boot

Yes but how did you remove it, exactly?

Also, I think this community prefers a messily-formatted code tag over an (oversized) image of text, hence the redaction.

Offline

#7 2019-03-16 19:28:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,791

Re: Accidentally removed /boot from dual boot system

You can post text wrapped in [ code ] blocks to preserve formatting. Why is your /boot a fuseblk device? Which filesystem did you choose? Why do you have a separate /boot partition in the first place? If your primary disk is indeed MBR then you are BIOS booting. Did the Windows boot ever work or did it "break" immediately after Arch  install? In the case you actually had an UEFI boot you broke your Windows even worse, you'd have to https://wiki.archlinux.org/index.php/Gd … BR_and_GPT convert back to GPT and then go back to my original proposal of finding a UEFI boot loader restoration guide.

Which resource did you use to install Arch Linux?

Online

#8 2019-03-16 22:12:48

budaria
Member
Registered: 2018-06-28
Posts: 11

Re: Accidentally removed /boot from dual boot system

Head_on_a_Stick wrote:

Why does /boot have fuseblk as the fs_vfstype?

Please post the full content of /etc/fstab (using code tags).

budaria wrote:

I removed the /boot

Yes but how did you remove it, exactly?

Also, I think this community prefers a messily-formatted code tag over an (oversized) image of text, hence the redaction.

I did rm -rf /boot

# Static information about the filesystems.
# See fstab(5) for details.
# <file system> <dir> <type> <options> <dump> <pass>
# /dev/sda3
UUID=59e617c0-b14a-4e30-8e71-ea0ff1a8023e	/         	ext4      	rw,relatime	0 1
#/dev/sda2
UUID=CE74AD2A74AD166D        /media/Windows     ntfs-3g   defaults,nls=utf8,umask=000,dmask=027,fmask=137,uid=1000,gid=1000,windows_names 0 0 
UUID=434A69687FC9372B	/media/Shared     ntfs-3g   defaults,exec,uid=1000,gid=1000


UUID=30C876B8C8767BC2 /boot ntfs-3g defaults 0 1
V1del wrote:

You can post text wrapped in [ code ] blocks to preserve formatting.

Yes, but when I pasted code from terminal it was already messed up.

Initially there was only windows installed, laptop came with it and I believe the /boot was on separate drive.
I shrinked partition, added some other partitions, installed arch linux, followed the wiki, and both windows and linux were working in dual-boot.
I believe I skipped some steps for fstab entry, that's why /boot wasn't mounted when kernel was updated, and the system broke.
Windows was working after that, it only broke only after I did rm -rf /boot and then installed kernel and grub again.

I will try repairing using windows cd and then reinstalling grub.

Offline

#9 2019-03-16 22:18:54

seth
Member
Registered: 2012-09-03
Posts: 51,699

Re: Accidentally removed /boot from dual boot system

I think he meant "what tutorial did you follow"?
In particular to answer the question of "wtf is your boot partition ntfs?" - that's basically never a reasonable choice.

Offline

#10 2019-03-16 22:19:42

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,748
Website

Re: Accidentally removed /boot from dual boot system

budaria wrote:
UUID=30C876B8C8767BC2 /boot ntfs-3g defaults 0 1

Why is /boot declared as an NTFS partition?

How did you create /etc/fstab?

budaria wrote:

Initially there was only windows installed, laptop came with it and I believe the /boot was on separate drive.

So perhaps the drive containing /boot was used by Windows?

budaria wrote:

I will try repairing using windows cd and then reinstalling grub.

Sounds like a good idea.

I don't think you should bother with a separate /boot partition though, just keep the entire Arch system on /dev/sda2

Offline

#11 2019-03-17 03:40:57

mountaineerbr
Banned
Registered: 2018-12-08
Posts: 48

Re: Accidentally removed /boot from dual boot system

Once, I installed Ubuntu in BIOS and Windows in EFI...
I had to manually enter BIOS and choose the appropriate boot config.
Perhaps that is too much of a hassle, but I enjoyed  getting to BIOS every time I had to change boot!
Maybe you can't access Windows without the Boot files..
Good luck, I am sure you will find a way and if your work can have some leisurely patience in solving that "issue"...
If  only had you backed up that folder before changing it....

Offline

Board footer

Powered by FluxBB