LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2015, 07:58 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
How to write the grub file to install win7 ?


Code:
fdisk -l 
Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048    206847    204800  100M  7 HPFS/NTFS/exFAT
/dev/sda2          208894 312580095 312371202  149G  f W95 Ext'd (LBA)
/dev/sda5       240011264 306278399  66267136 31.6G  7 HPFS/NTFS/exFAT
/dev/sda6       306280448 312580095   6299648    3G 82 Linux swap / Solaris
/dev/sda7       226002944 240009215  14006272  6.7G 83 Linux
/dev/sda8          208896  49035263  48826368 23.3G 83 Linux
/dev/sda9        49037312 107629108  58591797   28G 83 Linux
/dev/sda10      107630592 226000895 118370304 56.5G 83 Linux
My debian was installed on sda10,now there is a win7.iso was saved on sda5,how to write the grub.cfg file to install win7 ?
 
Old 11-13-2015, 09:07 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You don't normally edit grub.cfg, see https://wiki.debian.org/Grub#Configuring_GRUB_v2. update-grub should recognize Windows automatically.

The Debian instructions at this apURL are a bit thin. Perhaps check the original GNU instructions at https://www.gnu.org/software/grub/gr...mentation.html, or the Arch Linux wiki.
 
Old 11-13-2015, 09:33 PM   #3
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Original Poster
Rep: Reputation: Disabled
The status is :debian8 was installed on sda 10,win7 iso image is saved on sda5.
My target is to set grub.cfg properly to install win7.
The window7 have not been installed ,there is only a win7 iso image in the sda5,i want to make grub.cfg to install the win7 iso image.
Update-grub should recognize Windows automatically after win7 installed,before that how can do?

How to write something in the grub.cfg?
Code:
menuentry 'win7' { 
   
    }

Last edited by luofeiyu; 11-13-2015 at 09:40 PM.
 
Old 11-13-2015, 09:58 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,313
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
Ypu cannot engineer GRUB to install Windows. You use Windows to install Windows.

When you install Windows, Windows will bork your boot loader. Windows is narcissistic. It does not recognize the existence of other operating systems.

Once Windows is installed, you then must fix GRUB to get your multi-boot system back.

This article should help; it refers to Ubuntu, but the process it describes is generic: http://www.howtogeek.com/howto/ubunt...-wipes-it-out/

Warning: Once you install Win7, it will nag you to "upgrade" to Win10. Why bother?

I have box that came with Win7 (I dual-boot it with Mageia) and I'm fighting a continual effort to repel boarding from Win10. If Win10 ever succeeds, I'm blowing the whole thing away and making it Linux-only.

Last edited by frankbell; 11-13-2015 at 10:00 PM.
 
1 members found this post helpful.
Old 11-14-2015, 07:57 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Quote:
there is only a win7 iso image in the sda5,i want to make grub.cfg to install the win7 iso image.
Won't work. It is possible to boot a windows installation DVD that has been extracted (loop mounted) and copied to an ntfs formatted partition which has been marked as active/bootable. I saw the site below and followed the instructions for it on both a flash drive then tested it on a hard drive and the windows install medium booted. It was windows 10 but I doubt that matters. The install started but I never finished it as the only space I had to install was on a usb external drive. The link below is specific to Ubuntu but should be similar Debian.

http://onetransistor.blogspot.ch/201...om-ubuntu.html

As stated above, make sure you have your install medium for your primary system as installing windows is going to overwrite your bootloader and that means no booting any Linux until you get Grub repaired.
 
Old 11-15-2015, 07:50 PM   #6
tomwest
Member
 
Registered: Aug 2013
Distribution: debian
Posts: 63

Rep: Reputation: Disabled
In relation to the link mentioned in post #4, its instruction apply to grub and not grub2. In grub2, the partition numbers begin at 1 and not zero.
 
Old 11-15-2015, 11:31 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:

I have box that came with Win7 (I dual-boot it with Mageia) and I'm fighting a continual effort to repel boarding from Win10. If Win10 ever succeeds, I'm blowing the whole thing away and making it Linux-only.
same here

7 is not on the first drive
i already reinstalled once when a update AUTO installed bypassing the DO NOT INSTALL -- notify only setting
( ms set a update to "windows update" as CRITICAL!!! and auto installed it ANYWAY )

win tried to write files to the MBR on the first drive -- this WAS NOT the microsoft bootloader but a ext4 grub2 partition

win 7 also NEVER checked IF it could write and went on writing to a partition it can not write too
this FUBAR 'ed windows when it tried to reboot into windows ( during the update) , then tried to undo things and reinstall the files it "saved unsuccessfully to a ect4 partition
BUT AFTER
it uninstalled the updates

basically Microsoft shot it's self in the HEAD with a 357


so


when you dual boot if only ONE disk
let MS have the mbr !!!

and put grub on the first LINUX partition


if two or more disks
switch the boot order to boot the MS drive FIRST
and boot into windows

as to keeping Win-10 off the system
there are about 4 KB????? updates you have to keep OFF win7
KB 3065987
KB 2952664
KB 3035583
KB 2976978

then HIDE them from auto update after you set it to NOTIFY ONLY and not auto install

BUT!!! if MS post a update as critical
it WILL INSTALL ANYWAY!!!!!!! BYPASSING YOUR SETTING!~!!!!!!!

so, Windows might AUTO shoot it's self in the head and kill it's self
so be ready to reinstall windows

Last edited by John VV; 11-15-2015 at 11:38 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS write slow from win7 mcadoosf Linux - Server 3 09-19-2013 12:01 PM
Unknown File System, GRUB rescue: Win7 & Ubuntu dual boot problem hoody1601 Linux - Newbie 2 01-06-2013 11:34 AM
Install Win7 HP upgrade to Win XP on dual boot - GRUB problem? RealGomer Linux - Software 2 12-23-2010 02:22 AM
Copy grub boot loader from USB to file to use in Win7 bootloader eventmobile Linux - General 5 12-17-2010 02:48 AM
[SOLVED] No GRUB bootscreen after mint4win install on Win7 Leon14344 Linux Mint 4 09-08-2009 10:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration