You are not logged in.

#1 2007-08-18 20:54:33

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Must I use GRUB or LILO?

In the Official Arch Linux Install Guide (http://wiki.archlinux.org/index.php/Off … tall_Guide), it is said that GRUB is Arch's default bootloader and that it is highly recommended.  Do I have to install a bootloader during Arch's installation?  I currently run Windows XP, and I was hoping to use the Microsoft bootloader and just select which operating system I want to run during the boot up.  Right now, with nothing but Windows XP installed, during boot-up a screen is displayed for 3 seconds that gives me the option of choosing which operating system I want.  I am hoping to stay with only the Microsoft bootloader because I have no idea how having two bootloaders at the same time will work, and the idea of tampering with booting functions makes me think of pressing the on button and getting a whole lot of black screen and white jargon.

Offline

#2 2007-08-18 21:22:33

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Must I use GRUB or LILO?

Hi.
As you already know from the docs, arch comes with two bootloades you can choose to install. As I've never used lilo, I can't say anything about it. But as I am using GRUB, I can recommend it.

You have to install a bootloader because otherwise you won't be able to boot into your installed system because the Windows bootloader doesn't recognize and isn't able to boot other operating systems than Windows*.

GRUB is able to boot Windows and Linux, so I recommend you to install the GRUB bootloader. In order to boot Windows, you have edit the /boot/grub/menu.lst accordingly. I think there's even a (commented) default entry for Windows.
If you tell us on which partition (and harddisk drive) Windows is installed, we can surely help you with this.
My Windows XP installation is located at /dev/sda1 and my boot entry for Windows looks like this:

# (3) Windows XP
title Windows XP
root (hd0,0)
makeactive
chainloader +1

*As stated above, Windows isn't capable of booting *nix operating systems. As far as I can tell this is right, but it *is* possible to use the Windows bootloader to boot your linux operating system. But as there's no benefit over GRUB, I cannot tell how to do this without looking it up.

I recommend using GRUB and overwriting your Windows bootloader as GRUB is capable of booting both operating systems.

If something fails, you can restore your Windows bootloader with it's installation CD (repair console).

Or you can make a backup of your existing bootloader before installing GRUB by issuing this command (originating in your bootloader is located on /dev/sda):

dd if=/dev/sda of=bootloader count=1 bs=512

Then you can restore it with this command:

dd if=bootloader of=/dev/sda count=1 bs=512

edit: This wiki article should cover most of your upcoming questions: Windows and Arch Dual Boot

Last edited by harlekin (2007-08-18 21:28:48)


Hail to the thief!

Offline

#3 2007-08-18 21:38:44

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

Thank you very, very much!  I will use GRUB, and I can tell you that Windows XP is the first thing that was installed on this computer (OEM), and that it is on the C drive.  However, this computer came with a D drive, which is at the very start of the physical drive.  Drive C is the second partition on that physical drive and begins at 7235MB.  Beyond that, I do not know how to name partitions in either format (sdx or hdx (I will look it up in the Wiki)).  It might also help to know that I am installing Arch on an external hard drive, drive F (First and only partition on that physical drive). 

If I do install GRUB, how will it work?  Will I be able to set Windows XP as the default operating system to run, but have GRUB display all installed operating systems for 3 seconds at the system boot so I could choose Arch when I wanted to?  This computer is used by four people, and I am the only person who wants anything whatsoever to do with Linux, so I need something that will seamlessly boot Windows XP unless I sit in front of the computer and actually tell it to boot Arch.  I do not have a Windows Installation CD, (Installed OEM and we did not request separate CDs), so I will have to attempt your second method of backing-up the Windows bootloader, but I have no idea how to get to the Windows bootloader command terminal to enter the code you just gave to me. 

Finally, to overwrite the Windows Bootloader with GRUB, would I install GRUB into MBR?  What if I do not overwrite the Windows bootloader?

Last edited by Kienja Kenobi (2007-08-18 21:54:59)

Offline

#4 2007-08-18 21:52:52

ozar
Member
From: USA
Registered: 2005-02-18
Posts: 1,686

Re: Must I use GRUB or LILO?

Yes, install GRUB to the MBR.

You will have a choice of booting Arch or Windows.  You can change the default OS.  You can change the length of time you have to choose and OS.


oz

Offline

#5 2007-08-18 22:00:07

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Must I use GRUB or LILO?

First thing: What you want to accomplish can definitely  be done with grub. Grub parses the file /boot/grub/menu.lst and will select the first entry given in there as default entry. You can also change the standard time to wait for a user selection from 5 to 3 secs. (;

As far as I can tell, grub should be installed onto the MBR of your harddrive as your BIOS will look for a bootloader there. You should not run into any problems and even if you do, they should be solvable.

As you don't have a installation CD for Windows, I suggest backing up your current bootloader just in case.

If you are still in the archlinux setup, you can enter a free console by hitting alt+Fx where x is something between 2 and 4 I guess. Then you are logged in as root in your install cd's operating system.
You can run the commands from there, but make sure you're saving your bootloader file on your hard disk drive and not in the installation cd's os (the RAM), as it wouldn't survive a reboot. (;

Btw. the naming scheme should be /dev/sdXY where X is an alphabetic character starting from a. /dev/sda represent the first hdd in your computer (master on ide port 0 or first sata port). /dev/sdb would be the second. Partitions withing a hard disk drive are specified by appending a number. For example /dev/sda1 would be the first partition in /dev/sda. /dev/sda2 the second, etc.

You can watch your current partition table for /dev/sda by typing:

fdisk /dev/sda

And then entering 'p'.

Last edited by harlekin (2007-08-18 22:03:28)


Hail to the thief!

Offline

#6 2007-08-18 22:03:34

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

Thanks.  I am pretty sure the partition Windows XP is installed on would be called h(0, 1) (It is on the first physical drive, but it is the second partition).  I think the equivalent of this in the other naming system would be sata2. 
Will there be a problem with the bootloader (GRUB) being installed 8MB away from the start of the physical drive?  When I was looking at things about dual-booting (Which I do not plan on doing) I saw a lot of talk about BIOS 1024 cylinder limit.  Will that apply to this situation?

Offline

#7 2007-08-18 22:10:03

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Must I use GRUB or LILO?

You don't want to setup up a dual boot? I think you have to.
At least if you mean by dual boot, you have one bootloader which can boot two operating systems.

You should install your bootloader in the MBR that is /dev/sda and not /dev/sda1 or /dev/sda2 and then boot /dev/sda as configured in your BIOS.

You said that Windows XP was the first and only OS on this computer. It would be more logical if it's installed on /dev/sda1, the first partition on the hard drive. So make sure you're correct with your assumption that it's hd(0,1).

Also notice that hd(X,Y) is grub notation and it starts from zero instead of one as it's writting in unix.
You can check if Windows would be hd(0,1) by looking at the output of `fdisk /dev/sda`. Then the device /dev/sda2 should use a NTFS filesystem.


Hail to the thief!

Offline

#8 2007-08-18 22:13:48

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

Sorry, I was mistaken about the the definition of "dual boot."  A dual boot is indeed what I am trying to do here.  The BIOS 1024 cylinder limit may not apply here because the methods that spoke of a BIOS 1024 cylinder limit were very different from the method given in the Arch Wiki/the method you guys have told me.  I think the Arch Wiki would mention the BIOS 1024 cylinder limit if it pertained to this situation. 

The problem is that Windows XP is not installed on the first partition.  It is installed on the first physical drive, but on the second logical drive (second partition).  Therefore it should be hd(0,1).  It does not make sense, but Hewlett Packard had the stupid idea that having a D drive h(0,0) with recovery files was useful.

Last edited by Kienja Kenobi (2007-08-18 22:43:37)

Offline

#9 2007-08-18 22:53:56

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

I think I am down to understanding everything except the number in the parentheses at the start of the code for adding a Windows operating system to the /boot/grub/menu.lst :

The example in the Official Arch Instillation Guide is this:

# (1) Other OS
title My Other OS
rootnoverify (hd0,1)
makeactive
chainloader +1

While the example provided by harlekin is this:

# (3) Windows XP
title Windows XP
root (hd0,0)
makeactive
chainloader +1

I understand every difference except the differing numbers at the very beginning of the code: (1) and (3).  Why do those numbers do?

Also, do I actually type the # character at the beginning of the code, or does that say something about the code to human readers?

Offline

#10 2007-08-18 22:55:42

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Must I use GRUB or LILO?

The latter one. Mostly #-prefixed lines are treated as comments. I named the section # (3) Windows XP as it's my third OS entry in my menu.lst.

But you can name it any different or even leave this line out.


Hail to the thief!

Offline

#11 2007-08-18 23:07:18

twiistedkaos
Member
Registered: 2006-05-20
Posts: 666

Re: Must I use GRUB or LILO?

Actually if memory serves me, you can edit the windows bootloader mbr file to load up linux. I did that when I was dual booting years ago. Unfortunately, memory isn't my high quality so I can't tell you how to do it.  But it can be done, with XP atleaste.

Last edited by twiistedkaos (2007-08-18 23:07:43)

Offline

#12 2007-08-18 23:26:44

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,969

Re: Must I use GRUB or LILO?

Yes, you can boot linux through the windows bootloader, but it's tricky and error-prone.
As the windows bootloader can't boot linux directly, you need to make a copy of the linux bootsector and put that copy on your windows c-drive.
On some systems that must be repeated after a major linux kernel update (like from 2.6.22 to 2.6.23).
Grub can boot windows directly, so using grub to boot windows is a lot easier.

about that d-partition : hp,dell and acer (possible more) use that method.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#13 2007-08-19 00:16:41

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

Thank you all very much.  I believe I understand everything now, so I will now try to install Arch.  I will use GRUB rather than the Windows bootloader.  My only concern was that GRUB would not seamlessly allow the other people who use this computer to go straight to Windows XP. 

Assuming I am able to boot up the computer lol, I will let you know how the Arch installation goes.

Offline

#14 2007-08-19 01:15:55

voonte
Member
Registered: 2007-08-02
Posts: 15

Re: Must I use GRUB or LILO?

I installed Arch on our family computer were Windows is mostly used. Dual booting with Arch and Windows works great. If you notice that the GRUB booting screen (countdown + OS selection) makes people nervous, add this line to your GRUB menu.lst file:

hiddenmenu

This will hide the OS selection and only show a countdown. If you press Escape you will see the boot screen and can choose Arch or Windows.

Offline

#15 2007-08-19 07:39:24

twiistedkaos
Member
Registered: 2006-05-20
Posts: 666

Re: Must I use GRUB or LILO?

Lone_Wolf wrote:

Yes, you can boot linux through the windows bootloader, but it's tricky and error-prone.
As the windows bootloader can't boot linux directly, you need to make a copy of the linux bootsector and put that copy on your windows c-drive.
On some systems that must be repeated after a major linux kernel update (like from 2.6.22 to 2.6.23).
Grub can boot windows directly, so using grub to boot windows is a lot easier.

about that d-partition : hp,dell and acer (possible more) use that method.

Actually, I didn't do that O.o, seems quite a challenge for a first linux install, which was what mine was. I may have just followed some online documentation and did it the way you're saying, but I don't remember it being too complicated.

Offline

#16 2007-08-19 20:36:21

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

Well...  After seven tries at installing Arch, my computer is booting, but as if I did nothing whatsoever to install Arch.  During the Arch installation, I come to the very, very last step, after I have edited the GRUB configuration file, and I am asked where I want to install the bootloader (sda, sdb, sda1...).  I have tried several of those options, and immediately after I choose one I am asked: "Do you have installed on software raid?"  I am rather positive my answer is no, but right when I say no, the setup stalls.  Nothing happens.  Zero.  There is no processor or hard drive activity, so I just Alt +F2 to a free console and type reboot.  When the computer reboots there is no sign of any GRUB bootloader or Arch.  The Windows bootloader comes up and takes me straight to Windows XP.  Any ideas? 

I am following the Arch Wikis and the advice from this forum to the letter.  The only problem I can think of is that I have an unusual hard drive configuration: I have two hard drives.  My internal hard drive contains the C drive, which is where Windows XP is installed.  I am installing Arch to one of three partitions on my external hard drive.  (One of the other partitions is the swap and one of them is NTFS formatted so I can share files between Windows and Arch).  The partition on which I am installing Arch is at the front of the drive's space. 

I know LILO is supposed to be more difficult to set up than GRUB, but I am going to try it since GRUB is not working whatsoever.

Offline

#17 2007-08-20 00:10:52

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Must I use GRUB or LILO?

Do you find something interesting in your fifth terminal? (Alt+F5) This is where all errors go.

Alternatively you can install grub by hand which would give you more detailed output about possibly occurring errors.

To install grub, you have to mount your root partition (I'll name it /dev/sda1):

mkdir /mnt/root
mount /dev/sda1 /mnt/root

If you have a boot partition (assuming it is /dev/sda2), you have to mount this as well:

mount /dev/sda2 /mnt/root/boot

Then you have to bind /dev and /sys:

mount --bind /dev /mnt/root/dev
mount --bind /sys /mnt/root/sys

Then you can chroot into your local system:

chroot /mnt/root/

And you should be able to install grub with this command on your primary hdd /dev/sda:

grub-install /dev/sda

But well, this is mainly what should be done by the installer and you should see the output on Alt+F5.

PS.: I am not quite sure with the bindings. Maybe you have to bind /proc additionally to /dev or instead of it. But I think only /dev and /sys was right.

edit: I don't know about arch being installed on a external hdd being a problem though.

Last edited by harlekin (2007-08-20 00:15:31)


Hail to the thief!

Offline

#18 2007-08-20 01:05:18

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Must I use GRUB or LILO?

Harlekin, I miss your old avatar. sad

Offline

#19 2007-08-20 01:16:41

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: Must I use GRUB or LILO?

I think the problem is that grub is getting installed to the usb mbr when it needs to be in the windows mbr, I've always bounced my way through using just straight grub when this happens.

I think its like this
grub #this changes to a prompt
root (hd1,0) #where arch root is
setup(hd0)  #where the mbr needs changing
exit

As said a little fuzzy on details but that seems to be the trouble perhaps you can use grub-install http://wiki.archlinux.org/index.php/Grub using root directory flag but I never quite got it sussed that way

Offline

#20 2007-08-20 12:03:37

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Must I use GRUB or LILO?

Misfit138 wrote:

Harlekin, I miss your old avatar. sad

Heh, thanks. I am surprised that someone even noticed the change. (=


Hail to the thief!

Offline

#21 2007-08-20 20:10:26

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

I always check the fifth terminal after every process in the setup is completed.  When I check the fifth terminal once the setup has frozen, there is actually a list of things that grub has done and then "SUCCESS."  I see no errors.  I will try the code that harlekin and FeatherMonkey have suggested. 

However, I will say that the Arch Wiki for GRUB does not work for me at all.  I use the very code that page contains and get nothing but errors that say the file/drive/location does not exist.  I have used every drive and partition I know in every naming system I know and still get the same errors.  I even tried it with the drive names that these commands yield:

fdisk /dev/sda

and then the command "p" (I also substitute sdb in for sda because I have two drives)

Perhaps the problem is that I do not first mount those drives like harlekin suggested in her code.  If that is the problem, I think the Wiki should tell readers to mount the drives first.

Last edited by Kienja Kenobi (2007-08-20 20:25:36)

Offline

#22 2007-08-20 20:44:12

harlekin
Member
From: Germany
Registered: 2006-07-13
Posts: 408

Re: Must I use GRUB or LILO?

Actually I'm male, but no problem. :D

Well, you don't have to mount the partition or hard drive to install a bootloader. I mentioned just to mount it, because I am used to run grub from the installed system. And you need to mount a partition if you need to access the files in there. This is actually not necessary for grub.

I think you should provide further details about your hdd setup.

Please post the output of fdisk [device] and 'p' for all you hdds and say what is contained by each partition.

Usually your BIOS would boot your master drive and read the boot sector of it. This should be /dev/sda, so you should be fine with the steps I've mentioned. Maybe you should check your BIOS options, too. In case you try to boot something strange first instead of your master hard disk drive.

Last edited by harlekin (2007-08-20 20:46:02)


Hail to the thief!

Offline

#23 2007-08-20 23:43:58

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

Sorry harlekin.  big_smile

I was very wrong!  There was never any output concerning GRUB in the fifth terminal!  I just tried it again, and I noticed that the very last output in the fifth terminal is from the installation of the Kernel, not from the installation of GRUB.  The "SUCCESS" that I was seeing was from the installation of the kernel.  Very sorry that I misinformed. 

Also, I just went through the regular Arch setup all of the way through the installation of the kernel, and then I stopped before getting to the bootloader installation and used harlekin's code to the letter.  (Except that I substituted sdb1 for your sda1 (Because my root partition on which Arch is installed is the first partition on my second hard drive)).  Everything went perfectly until the very last step:

grub-install /dev/sda

On that step, it gave this exact error (I wrote it down): "mkdir: cannot create directory '/boot/grub': Operation not permitted" 


I checked the Windows boot commands by going to Control Panel->System->Advanced->Settings (Under Startup and Recovery)->Edit.  This brings me to the Windows boot.ini.  This is a copy and paste of what is in that boot.ini:

[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional Edition" /fastdetect /NoExecute=OptIn
C:\CMDCONS\BOOTSECT.DAT="Microsoft Windows Recovery Console" /cmdcons

From the moment I press the analogue button on my box, to the moment the Windows XP login screen appears, I see three screens: 1-Hewlett Packard (From here I can do nothing but go to the HP Recovery Console).  2-A blank screen with a white line in the very right left corner of the screen.  (This is where the BIOS check for boot CDs and floppies).  3-A black screen with the two options to boot from the Windows bootloader: Microsoft Windows XP Professional Edition and Microsoft Windows Recovery Console. 


Finally, I will reboot with the Arch CD and use the fdisk command for every hard drive I have and rewrite the exact output here.  I do not want to give you more mistaken information. 

Thanks so much to the people who have been helping me.  We will get it!  big_smile

Last edited by Kienja Kenobi (2007-08-21 00:36:18)

Offline

#24 2007-08-20 23:56:01

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: Must I use GRUB or LILO?

If you're going to use grub-install you need to use root directory the error message is correct there is no /boot/grub on sda its on sdb.

But thats where I fail you I never succeded you need something like grub-install --root-directory=

You need to tell grub-install that the boot/grub is else where otherwise it'll look on sda for /boot/grub/

Offline

#25 2007-08-21 00:32:23

Kienja Kenobi
Member
Registered: 2007-08-17
Posts: 62

Re: Must I use GRUB or LILO?

Here is what fdisk can tell you about my drives:

fdisk /dev/sda:

The number of cylinders for this disk is set to 15881. 
There is nothing wrong with that, but this is longer than 1024, and could in certain setups cause problems with:
1)software that runs at boot time (e.g. old versions of LILO)
2)booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)

Disk /dev/sda: 122.9 GB, 122942324736 bytes
240 heads, 63 sectors,/track, 15881 cylinders
Units = cylinders of 15120 * 512=7741440 bytes

Device       Boot     Start    End       Blocks          ID   System
/dev/sda1                1       980      7408768+       b   W95 FAT32
/dev/sda2    *        981    15880    112644000      7   HPFS/NTFS

-------------------
fdisk /dev/sdb:

The number of cylinders for this disk is set to 24792.
There is nothing wrong with that, but this is longer than 1024, and could in certain setups cause problems with:
1)software that runs at boot time (e.g. old versions of LILO)
2)booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK)

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device       Boot     Start       End       Blocks          ID   System
/dev/sdb1     *         1         11473      92156841     83   Linux
/dev/sdb2             11474    22946    92156872+      7   HPFS/NTFS
/dev/sdb3             22947    24792    14827995       82   Linux swap/Solaris
------------------
Here is what I can tell you about my hard drives:
sda1 is the D drive, which is in FAT32 format.  Drive D has nothing but recovery information that Hewlett Packard put on there. 
sda2 is the C drive, which is in NTFS format.  Windows XP Professional SP2 is installed on drive C. 

sdb1 is in XFS format.  I am installing Arch Linux to this partition. 
sdb2 is in NTFS format.  I plan to use this to share files between Linux and Windows.
sdb3 is in Linux swap/Solaris format.  This is what I use for the Linux swap file. 


According to what FeatherMonkey is saying, should I use this command at the end of the code harlekin gave me, rather than the grub-install /dev/sda: 

grub-install --root-directory=/boot /dev/hdb

Sorry, I am not good at coming up with code.

Last edited by Kienja Kenobi (2007-08-21 21:12:24)

Offline

Board footer

Powered by FluxBB