You are not logged in.

#1 2014-12-08 10:48:13

smilinger
Member
Registered: 2014-10-18
Posts: 3

[SOLVED]Grub recognize Windows 7 as Windows Vista

Hi all.
I just installed Arch on my Thinkpad T420, Everything is ok except Grub recognize Windows 7 as Windows Vista.
I have Windows 7 installed on SSD, on another drive I have 2 NTFS partitions and 1 ext4 partition on which Arch is installed, grub is installed to SSD, both system can boot without problem.

I installed Mint before, it recognizes Windows 7 with no problem.
Can I fix this? I googled this and I think this problem should have been fixed long ago, don't know why the grub os-prober think I have Vista installed, I never installed Vista before.

Last edited by smilinger (2014-12-10 12:57:05)

Offline

#2 2014-12-08 11:09:32

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

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

There's no need to "fix" it -- my Windows 7 and my Windows Technical Preview (Windows 10 beta) both show up as "Vista" and they both boot up fine from the GRUB menu.

If it bothers you, just edit the menu line in grub.cfg...

EDIT: Hello & welcome to Arch smile

Last edited by Head_on_a_Stick (2014-12-08 11:11:00)

Offline

#3 2014-12-08 11:26:13

Glennzo
Member
From: Salem, Mass USA
Registered: 2009-09-24
Posts: 13

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

Same thing here, but Fedora 21's grub2 is handling this multi-boot system. I'm running Arch as I type this but the Vista thing is something I noticed when I ran os-prober under Fedora 21 half an hour ago.

And the same thing with Arch's os-prober.


Glenn
Powered by Arch Linux

Offline

#4 2014-12-08 11:43:23

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,163
Website

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

It seems a bit random as to which versions of Windows GRUB recognises things as.

All my systems identify the versions of Windows correctly with GRUB2. When I was using grub-legacy, sometimes I'd get Windows 7 and Windows Vista other times.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#5 2014-12-09 13:11:09

smilinger
Member
Registered: 2014-10-18
Posts: 3

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

Ok then, I can live with that.
Thank you guys.

Offline

#6 2014-12-09 16:14:20

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 391

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

It is just to remind you Windows is trash, with emphasis on Vista ... smile

Last edited by Pyntux (2014-12-09 16:14:32)


I do not speak English, but I understand...

Offline

#7 2014-12-09 16:41:52

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,783
Website

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

There's no need for that, Pyntux.

smilinger, please mark the thread as solved if you are happy with the conclusion.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2014-12-10 05:49:55

Pyntux
Member
From: Serbia
Registered: 2008-12-21
Posts: 391

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

That was just a joke, but OK, I'm sorry... smile


I do not speak English, but I understand...

Offline

#9 2014-12-13 13:49:44

smilinger
Member
Registered: 2014-10-18
Posts: 3

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

I think I figured out why. After some digging I found the code in /usr/lib/os-probes/mounted/20microsoft that has a tiny bug.
The problem is the grep options, maybe in other distributions binary files are treated as text by default or something, but apparently in Archlinux it's not, so any OS that's higher than Vista will be recognized as Vista.
Anyway, I pasted the patch here, it's easy to fix.

--- 20microsoft.old	2014-11-04 23:53:28.000000000 +0800
+++ 20microsoft	2014-12-13 21:39:27.471912583 +0800
@@ -31,19 +31,19 @@
 	for boot in $(item_in_dir boot "$2"); do
 		bcd=$(item_in_dir bcd "$2/$boot")
 		if [ -n "$bcd" ]; then
-			if grep -qs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
+			if grep -aqs "W.i.n.d.o.w.s. .8" "$2/$boot/$bcd"; then
 				long="Windows 8 (loader)"
-			elif grep -qs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
+			elif grep -aqs "W.i.n.d.o.w.s. .7" "$2/$boot/$bcd"; then
 				long="Windows 7 (loader)"
-			elif grep -qs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then
+			elif grep -aqs "W.i.n.d.o.w.s. .V.i.s.t.a" "$2/$boot/$bcd"; then
 				long="Windows Vista (loader)"
-			elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then
+			elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8. .R.2." "$2/$boot/$bcd"; then
 				long="Windows Server 2008 R2 (loader)"
-			elif grep -qs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then
+			elif grep -aqs "W.i.n.d.o.w.s. .S.e.r.v.e.r. .2.0.0.8." "$2/$boot/$bcd"; then
 				long="Windows Server 2008 (loader)"
-			elif grep -qs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
+			elif grep -aqs "W.i.n.d.o.w.s. .R.e.c.o.v.e.r.y. .E.n.v.i.r.o.n.m.e.n.t" "$2/$boot/$bcd"; then
 				long="Windows Recovery Environment (loader)"
-			elif grep -qs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then
+			elif grep -aqs "W.i.n.d.o.w.s. .S.e.t.u.p" "$2/$boot/$bcd"; then
 				long="Windows Recovery Environment (loader)"
 			else
 				long="Windows Vista (loader)"

Last edited by smilinger (2014-12-13 13:55:04)

Offline

#10 2014-12-27 16:09:19

gilmoreja
Member
From: Florida
Registered: 2012-05-28
Posts: 74

Re: [SOLVED]Grub recognize Windows 7 as Windows Vista

Thanks for posting your fix. It solved the same problem I was having with Windows 8.1 being reported as Windows Vista.

I know it may have been a cosmetic menu entry but I still wanted it to be correct.


Time you enjoy wasting isn't wasted time.

Offline

Board footer

Powered by FluxBB