You are not logged in.

#1 2018-01-23 12:04:09

shera10001
Member
Registered: 2018-01-23
Posts: 34

[SOLVED]Windows 7 not detected by GRUB boot menu

My partitions are as follows -
/dev/sda1 *bootable 100mb ntfs (the windows boot partition I think)
/dev/sda2 not bootable 78GB ntfs
/dev/sda3  not bootable 241.2G ntfs
/dev/sda4 *bootable 146.5GB ID - 83 Linux (this is the ext4 root partition, I haven't created home or boot directories separately during install, only did mount /dev/sda4 /mnt). EDIT NOTE : I made this a primary partition on cfdisk when I was creating and formatting the partitions. Not an extended partition, a primary one.

I installed as simply as possible, without creating a swap partition or a home partition. I used cfdisk to make a clean unallocated 146.5GB partition bootable and mkfs'ed it into ext4. Followed the Installation guide perfectly.

For some reason at the point in the Installation guide on the wiki when it asks to install a bootloader (after setting the root password), I was getting the message 'No free space, partition full' even though as you can see I am using a sufficiently big partition for installation of Arch Linux (or something along those lines). I googled around and found a solution here - https://www.ostechnix.com/adjust-size-r … rch-linux/ , here - https://bbs.archlinux.org/viewtopic.php?id=212345, and here - https://bbs.archlinux.org/viewtopic.php?id=205967 . One of them involves changing the filesystem from ntfs to ext4 (the fault of the partition manager I used that left it as ntfs), and the other two mention the command " mount -o remount,size=2G /run/archiso/cowspace " to solve the 'partition full' error. But in the course of finding these solutions I also had to reinstall the whole thing so I deleted the /dev/sda4 partition and reinstalled.

Now here is the relevant part. When I installed os-prober and then ran the " grub-mkconfig -o /boot/grub/grub.cfg " I remember as a result of either of the two, seeing a line in the console 'Windows 7 detected on /dev/sda1' or something like that. But on the second install, when I used the above solutions, I didn't see the line that windows 7 was detected. That set off alarm bells ringing. As expected, when I rebooted for the first time after the install, I could only see Arch Linux in the boot menu of GRUB, and no Windows 7. Even trying to 'Boot existing OS' from the live usb of arch linux (latest ISO at the time of this post) doesn't give me Windows 7 or Arch Linux. It simply brings me back to the main menu of the live usb Arch ISO, from where I just select "Arch Linux" (the live environment) to try to find a solution.

My /etc/fstab in the new installed system has only /dev/sda4 with a lot of text listed. Two entries of /dev/sda4. No boot mentioned as I have seen in some other fstab files of other people. Also while booting up there is a brief message which I can't read fast enough but it says " unable to create mount unit file " (or maybe boot unit file, it does have boot written in the same line somewhere) and then " duplicate fstab entry?".

I am new to here so sorry for the extra and unnecessary information. I have tried to provide anything I thought was relevant. Also in 8 hours my internet connection will be back to normal so I will be able to install a Graphical environment and a browser (right now it is very slow and I only have base package installed, not even base-devel). So in 8 hours I will be able to provide the output of commands and logs which helpers want. Please help me, I don't want to reinstall a third time, and I feel it is a very simple problem, nothing is broken or very wrongly installed as such. Thank you.

EDIT : From wiki I found this - https://wiki.archlinux.org/index.php/GRUB#Dual-booting -
"Note: GRUB supports booting bootmgr directly and chainloading of partition boot sector is no longer required to boot Windows in a BIOS-MBR setup." I am now trying to add the custom code given in the wiki.

EDIT 2 : After typing in the code given for dualbooting windows installed in mbr-mode in the article, here is the code (in the file  /etc/grub.d/40_custom) -
if [ "${grub_platform}" == "pc" ]; then
  menuentry "Microsoft Windows Vista/7/8/8.1/10 BIOS-MBR" {
    insmod part_msdos
    insmod ntfs
    insmod search_fs_uuid
    insmod ntldr     
    search --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 69B235F6749E84CE
    ntldr /bootmgr
  }
fi

I can see the windows option in the boot menu, but pressing enter on it simply brings me back to the boot menu without booting into windows. I wonder which partition's uuid should I use, the one on which Windows is installed (usually C:) or the one which has the boot partition of windows (usually 100mb or 200 mb in size).

EDIT 3 : Used uuids for both the partitions in the code above, the one where windows is installed (/dev/sda3), and the one where the bootmgr for windows is (/dev/sda1). Used lsblk --fs to verify that /dev/sda1 is 'System Reserved' and the partition where the windows boot manager is installed. Both are giving the same result as before, showing a boot menu with Windows written on it, but bringing me back to the boot menu upon selecting it.

EDIT 4 : I have solved one part of the problem. I had not mounted the boot partition of Windows, /dev/sda1, while generating the grub conf. Now os-prober and "grub-mkconfig -o /boot/grub/grub.cfg" also finds Windows /dev/sda1 :chain: or something like that. But still in the boot menu, when I press enter on the Windows option, it brings me back to the boot menu instead of booting into Windows.

EDIT 5 : Installed ntfs-3g which fixed a problem that was sending me to emergency mode after adding the above code, but still hasn't changed the behaviour of the Windows option.

EDIT 6 : SOLVED. What fixed it was changing the line of the code I pasted above in the file  /etc/grub.d/40_custom, the line which says "ntldr /bootmgr", I changed it to "chainloader +1" (without quotes). Not sure why the code from the ArchWiki doesn't work but this does. Someone more experienced might want to look into it and then edit the wiki. I found the solution here, where a person was having the exact same problem as me - https://askubuntu.com/posts/420109/revisions  . Now how do I mark the post as solved because it has a character limit and I am reaching it.

EDIT 7 : Outputs of fdisk -l and lsblk -l -

fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00057d94

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2          206848 163842047 163635200    78G  7 HPFS/NTFS/exFAT
/dev/sda3       471042048 976771071 505729024 241.2G  7 HPFS/NTFS/exFAT
/dev/sda4  *    163842048 471042047 307200000 146.5G 83 Linux

lsblk -l
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda    8:0    0 465.8G  0 disk 
sda1   8:1    0   100M  0 part 
sda2   8:2    0    78G  0 part 
sda3   8:3    0 241.2G  0 part 
sda4   8:4    0 146.5G  0 part /
sr0   11:0    1  67.2M  0 rom  

Last edited by shera10001 (2018-05-18 13:01:39)

Offline

#2 2018-01-23 12:14:37

shera10001
Member
Registered: 2018-01-23
Posts: 34

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

When I boot up the normal fresh arch install (I just did after using the live usb arch iso to regenerate genfstab and reinstall by doing grub-install and os-prober (again windows 7 was not detected) the bootup screen briefly flashes something like "can not mount unit file systemd.generator, duplicate entry in fstab?" or so. In another 8 hours I'll be able to provide logs.

Offline

#3 2018-01-23 12:54:11

shera10001
Member
Registered: 2018-01-23
Posts: 34

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

Also I am dual booting with a BIOS. My booting system is not UEFI if that helps.

Offline

#4 2018-01-23 13:09:10

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

Please don't keep adding new posts.

If no-one else has posted since your last visit you should just edit your last post and add further information.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2018-01-23 13:16:42

shera10001
Member
Registered: 2018-01-23
Posts: 34

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

Sorry about the new posts, I didn't notice that I could edit my old posts. Will do so from now onwards.

Offline

#6 2018-01-23 18:45:03

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,722

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

It is not UEFI?   Is it GPT or MBR?  Where did you install Grub?

Edit:  I just saw your edit saying it is not an extended partition.  Must be MBR

Last edited by ewaller (2018-01-23 18:45:54)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#7 2018-01-23 20:58:14

robg
Member
Registered: 2015-03-05
Posts: 225

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

shera10001 wrote:

EDIT 6 : SOLVED. What fixed it was changing the line of the code I pasted above in the file  /etc/grub.d/40_custom, the line which says "ntldr /bootmgr", I changed it to "chainloader +1" (without quotes). Not sure why the code from the ArchWiki doesn't work but this does. Someone more experienced might want to look into it and then edit the wiki. I found the solution here, where a person was having the exact same problem as me - https://askubuntu.com/posts/420109/revisions  . Now how do I mark the post as solved because it has a character limit and I am reaching it.

Have you informed yourself about the two? Admittedly, the information on `ntldr` seems a bit vague, but see for instance this and this.

If your title has reached the character limit, make it shorter. For example, you don't need the "after fresh install of arch" part.

Also, while you have done a great job at providing as much information as possible, I would suggest the following changes:

- Provide a very brief description of what you are trying to accomplish.
- Search for the command line tools that provide information about your system. For this post, recall `lsblk` and `fdisk`. Post the respective outputs instead of a manual description of your setup.
- In the spirit of the above comment, instead of a lengthy description of what you did, post the sequence of commands you issued along with their outputs.

And btw, welcome to Arch!

Last edited by robg (2018-01-23 20:59:19)

Offline

#8 2018-01-24 00:55:29

shera10001
Member
Registered: 2018-01-23
Posts: 34

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

ewaller wrote:

It is not UEFI?   Is it GPT or MBR?  Where did you install Grub?

Edit:  I just saw your edit saying it is not an extended partition.  Must be MBR

So because you know it is a primary partition you were able to tell that it is an MBR. Yes, it was MBR-BIOS (legacy). How were you able to tell?

Offline

#9 2018-01-24 03:43:07

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED]Windows 7 not detected by GRUB boot menu

I can't speak for ewaller or how he knew, but only an MBR disk has 'primary' and 'extended' partitions.  GPT just has partitions, no distinctions like MBR.

Offline

Board footer

Powered by FluxBB