Author Topic: bootloader  (Read 26635 times)

fernand

  • Newbie
  • *
  • Posts: 30
bootloader
« on: June 01, 2012, 15:54:22 PM »
Helo, I'm new on this site. I'd registered for some questions about a bootloader. On my Pc I've 2 operating systems. On the one side windows xp and on the other Linux(Debian). By the end of the installation of Debian, the installer asked me where can I put the bootloader? It propose two places, in the MBR of the harddisc. But this possibility I didn't like because afterwards I can't boot windows xp anymore. Important to know that I've two OS on a same harddisc. My first partition belong to windows xp ntfs. On the other partitions I've Debian ext3, two swap partitions and a FAT partition. On the other place I might to give an address like sda(0.1) for installing the bootloader. My question is which address I can put to boot windows xp and debian. For example sda (0.1) 0 represented
the harddisc where windows is located and the number 1 the ohter partition where Debian is on. The menu indicate that debian is on the sda 7 but this is is illogic because I've only 5 partitions. Please can someone tell me the number to put in parenthis to indicate the exact address that the bootloader will be installed on the debian partition in the way that I can afterwards choose between windows xp and debian. I were happy for a solution. Greetings Fernand   

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #1 on: June 01, 2012, 16:47:26 PM »
hi,

when you install debian, then it should automatically create a grub entry to boot windows. so its no problem when you install grub to the mbr. you will be still able to boot windows.

... The menu indicate that debian is on the sda 7 but this is is illogic because I've only 5 partitions.

sda1-4 is reserved for primary and extended partitions. the first logical partition is sda5. sda7 is the 3rd logical partition.

best regards
elmar

EDIT: added "and extended" to the answer
« Last Edit: June 04, 2012, 06:28:17 AM by Elmar »

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #2 on: June 01, 2012, 18:02:51 PM »
hi,
thx for the prompt answer, but when the installer asked me to put the bootloader in the MBR, first I
agreed, but the result were that the bootloader of windows were overwritten and I couldn't start windows.
So what can I do or exist an alternative to boot from Debian in a way that I can choose to boot one of my
two Os. Thank you in advance for an answer.
Fernand

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #3 on: June 01, 2012, 18:50:02 PM »
windows is started by the boot sector of the windows partition. it doesn't matter what program is in the mbr. so there is only a configuration problem in the grub config.

what happened exactly and what message did you see when you tried to start windows?

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #4 on: June 01, 2012, 19:34:36 PM »
Hi, the debian installer asked me if I want to put the mbr, it offers two options
yes o no, if I push yes I can see only 3 entries after booting: Debian and Debian rescue and Acronis a save program, but windows xp didn't appear. If I push no in the last question of the debian-installer, a window at the bottom open and nothing is write inside, in this line I must put the address like sda (0,1) I don't know what I can
write in this window to boot Debian in their own partition,
I hope that I've described my problem so that you can find a solution,
Fernand     

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #5 on: June 01, 2012, 19:51:06 PM »
then you have to create the entry for windows

when debian is up then open an editor as root and add to file /etc/grub.d/40_custom the following

Code: [Select]
menuentry "Windows" {
insmod chain
set root=(hd0,1)
chainloader +1
}

personally i would use my boot manager, but i am sure there will be some troubles with the linux installation on the logical partition (because of the way how the logical partition is created). i always prefer primary partitions.

regards
elmar

EDIT: run "update-grub" to apply the new menu entry
« Last Edit: June 02, 2012, 07:12:23 AM by Elmar »

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #6 on: June 01, 2012, 20:14:52 PM »
Hi , I'm newbie on Linux. You can help me by putting your file. On my Pc in debian
I'm now in the file /etc/grub.d/40_custom, but this file is write protected, I can't
write your code inside...
   

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #7 on: June 01, 2012, 20:33:45 PM »
Hi , I'm newbie on Linux. You can help me by putting your file. On my Pc in debian
I'm now in the file /etc/grub.d/40_custom, but this file is write protected, I can't
write your code inside...   

i dont know what you installed, so maybe the following does not work

open a terminal. when you installed the gnome desktop then press ALT-F2 and enter "gnome-terminal"
then try "sudo gedit /etc/grub.d/40_custom"

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #8 on: June 01, 2012, 20:42:26 PM »
hi, so I put your code in the 40_custom file
must I reboot now or what's the following to do
Fern

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #9 on: June 01, 2012, 20:44:03 PM »
yes, reboot

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #10 on: June 01, 2012, 20:51:13 PM »
Hi Elmar, I've reboot, but unfortunately windows xp don't appear in the bootmenu!

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #11 on: June 01, 2012, 21:20:21 PM »
whats the content of the 40_custom file?

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #12 on: June 01, 2012, 21:34:53 PM »
the content is the following:
#!/bin/sh
exec tail -n +3 $0
#This file provides an easy way to add custom menu entries. Simply type the
#menu entries you want to add after this command. Be careful not to change
#the 'exex tail' line above
menuentry "Windows" {
insmod chain
set root= (hd0,1)
chainloader +1
}
that's all..

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #13 on: June 01, 2012, 21:51:05 PM »
i dont know if it makes a difference, but you posted a "space" after the "set root="
try it without the space

i dont have grub installed to test that.

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #14 on: June 01, 2012, 22:00:12 PM »
I've in the file no space, but indeed by copying the file to your post I've do
a space.... 

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #15 on: June 01, 2012, 22:13:40 PM »
Hi, I remember me years before I try to install an OS on the harddisc where
windows xp was yet installed. The consecuence were that after I couldn't start anymore windows. So I visit your website and installed your plop, In this way
I could again start windows. I don't know if this information is relevant for my boot-problem, so you are informed about...   

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #16 on: June 02, 2012, 06:40:23 AM »
Hi, I remember me years before I try to install an OS on the harddisc where
windows xp was yet installed. The consecuence were that after I couldn't start anymore windows. So I visit your website and installed your plop, In this way
I could again start windows. I don't know if this information is relevant for my boot-problem, so you are informed about...   

thanks for the info, but thats not important for the grub.

i know now what i forgot to say. run "sudo update-grub" in a terminal. then it should work.


fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #17 on: June 02, 2012, 08:50:39 AM »
Hi Elmar, it works!!
Thank you very much for your patience and help.
By the way is it possible to ask your help also by other problems
than bootloader what concerns linux-features
greetings

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #18 on: June 02, 2012, 10:33:16 AM »
Hi Elmar, it works!!

:)


By the way is it possible to ask your help also by other problems
than bootloader what concerns linux-features
greetings

normally i give only linux support for my plop linux. when you have a problem and find no solution in the web, then its better to ask the community of the linux distribution that you use.

best regards
elmar

fernand

  • Newbie
  • *
  • Posts: 30
Re: bootloader
« Reply #19 on: June 02, 2012, 11:29:10 AM »
Thank you again.

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #20 on: June 04, 2012, 02:17:17 AM »
hi,

when you install debian, then it should automatically create a grub entry to boot windows. so its no problem when you install grub to the mbr. you will be still able to boot windows.

... The menu indicate that debian is on the sda 7 but this is is illogic because I've only 5 partitions.

sda1-4 is reserved for primary partitons. the first logical partition is sda5. sda7 is the 3rd logical partition.

best regards
elmar

actually , sda 1 thru 4 can been logical partitions , if so created that way by a partitioning utility like G-parted ...

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #21 on: June 04, 2012, 06:24:08 AM »
actually , sda 1 thru 4 can been logical partitions , if so created that way by a partitioning utility like G-parted ...

no, a logical partition can't be sda1-4. a logical partition resists in an extended partition. an extended partition is a partition that has an own partition table in the first sector and can have 4 partition records. a record can be a logical partition or again an extended partition.
sda1-4 represents the 4 partition records in the partition table of the mbr. the 4 records can be primary partitions and extended partitions (an extended partition is not a logical partition). to not confuse fernand i simplified my answer and didn't say that it also can be an extended partition. ok, fully correct is sda1-4 is reserved for primary and extended partitions. but logical partitions is definitely wrong. they can't be sda1-4, because the definition of a logical partition is, that it is inside of an extended partition.

« Last Edit: June 04, 2012, 12:49:13 PM by Elmar »

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #22 on: June 05, 2012, 08:02:25 AM »



no, a logical partition can't be sda1-4.


actually yes it/they can , if the partitions in question were so named sda1 , sda2 , sda3 etc...  if they are placed on the hard drive "that way"  and named as such , then they can be...  i've done it....





Quote
a logical partition resists in an extended partition. an extended partition is a partition that has an own partition table in the first sector and can have 4 partition records. a record can be a logical partition or again an extended partition.

um, what????  i don't quite follow your meaning here....


Quote
sda1-4 represents the 4 partition records in the partition table of the mbr.

of "the mbr" ????  (master boot record) are you sure on that one???

yeah sure , sda/hda 1-4 would represent "4 partition records" , but i would have to think that out of the whole hard disk...

Quote
The MBR may contain one or more of:

    A partition table describing the partitions of a storage device. In this context the boot sector may also be called a partition sector.
    Bootstrap code: instructions to identify the configured bootable partition then load and execute its volume boot record

Quote
the 4 records can be primary partitions and extended partitions (an extended partition is not a logical partition).

well , let's start from square one there , you have four logical partitions , then because of partitioning constraints/rules after four logicals , one is required to create extended partitions if extras are needed...

Quote
fully correct is sda1-4 is reserved for primary and extended partitions. but logical partitions is definitely wrong. they can't be sda1-4, because the definition of a logical partition is, that it is inside of an extended partition.

see previous reply , oh they can be...

http://en.wikipedia.org/wiki/Disk_partitioning#PC_partition_types


Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #23 on: June 05, 2012, 08:08:05 AM »
i think you dont understand the meaning of primary, extended and logical partition, however believe what you want. you are wrong.

the only (silly) ways that sda1-4 could be used to access logical partitions are
1) change the dev nodes of sda1-4
or
2) change the node numbers in the kernel

but both would not represent whats really on the hard disk sectors.
« Last Edit: June 05, 2012, 08:38:30 AM by Elmar »

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #24 on: June 05, 2012, 08:47:39 AM »

Quote
i think you dont understand the meaning of primary, extended and logical partition, however believe what you want. you are wrong.

i do understand , but you believe what?

no i am not wrong , but i do think that possibly there is a misunderstanding of the terminology here ... lol

Quote
the only (silly) ways that sda1-4 could be used to access logical partitions are

"silly ways"???   aren't you going against your own words now???  an extended partition can be named (sda1 , 2 , 3 , ) i've done it before with gparted... true!! it was a little suprising to me that things ended up that way , which i later changed because of too much confusion with installation and what not... but still...
Quote
1) change the dev nodes of sda1-4
or
2) change the node numbers in the kernel


ok , wait what??  change the nodes or alter the kernel ??  what kernel???  for kernel , isn't that a more system/distro specific  ???

Quote
but both would not represent whats really on the hard disk sectors


well it's really not hard for one to read/write to a hard drive with something like Gparted or even Windows installer, so ....... what not to see????

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #25 on: June 05, 2012, 09:01:51 AM »




http://ubuntuforums.org/showthread.php?t=1667915


clearly , "sda2" is shown in the screenshots...  so am I still wrong???

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #26 on: June 05, 2012, 09:02:31 AM »

Quote
i think you dont understand the meaning of primary, extended and logical partition, however believe what you want. you are wrong.

i do understand , but you believe what?

no i am not wrong , but i do think that possibly there is a misunderstanding of the terminology here ... lol

i think you interchange the meaning of extended and logical partition.


Quote
the only (silly) ways that sda1-4 could be used to access logical partitions are

"silly ways"???   aren't you going against your own words now???  an extended partition can be named (sda1 , 2 , 3 , ) i've done it before with gparted... true!! it was a little suprising to me that things ended up that way

in which way i am against my own words? sda1-4 can be only a  primary or an extended partition


Quote
1) change the dev nodes of sda1-4
or
2) change the node numbers in the kernel


ok , wait what??  change the nodes or alter the kernel ??  what kernel???  for kernel , isn't that a more system/distro specific  ???

the thread was started with linux. so from what kernel do you think i am talking about? you can change the kernel of every linux distro.

Quote
but both would not represent whats really on the hard disk sectors
well it's really not hard for one to read/write to a hard drive with something like Gparted or even Windows installer, so ....... what not to see????

i dont understand what you want to say. when you want to know whats really on the hard disk, then you have to look with a hexeditor on the hard disk and not gparted.

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #27 on: June 05, 2012, 09:05:52 AM »

clearly , "sda2" is shown in the screenshots...  so am I still wrong???

sda2 is an EXTENDED partition!!! and not a LOGICAL partition
sda5 and sda6 are logical partitions

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #28 on: June 05, 2012, 09:11:44 AM »
Quote
i think you interchange the meaning of extended and logical partition.

i know that i didn't...


Quote

in which way i am against my own words? sda1-4 can be only a  primary or an extended partition

in reply ...

Quote
no, a logical partition can't be sda1-4. a logical partition resists in an extended partition. an extended partition is a partition that has an own partition table in the first sector and can have 4 partition records. a record can be a logical partition or again an extended partition.
sda1-4 represents the 4 partition records in the partition table of the mbr. the 4 records can be primary partitions and extended partitions (an extended partition is not a logical partition). to not confuse fernand i simplified my answer and didn't say that it also can be an extended partition. ok, fully correct is sda1-4 is reserved for primary and extended partitions. but logical partitions is definitely wrong. they can't be sda1-4, because the definition of a logical partition is, that it is inside of an extended partition.


Quote
the thread was started with linux. so from what kernel do you think i am talking about? you can change the kernel of every linux distro.

i don't know , what kernel are you talking about??? 



manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #29 on: June 05, 2012, 09:14:40 AM »




Quote
sda2 is an EXTENDED partition!!! and not a LOGICAL partition


um No Elmar , I have "sda2 " on my machine that i am posting from now , and it is Not an extended partition , It is logical...


Quote
sda5 and sda6 are logical partitions


how do you (with respect) figure that????

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #30 on: June 05, 2012, 09:22:07 AM »
Quote
sda2 is an EXTENDED partition!!! and not a LOGICAL partition
um No Elmar , I have "sda2 " on my machine that i am posting from now , and it is Not an extended partition , It is logical...

on your images, what word do you see beside sda2? extended or logical? do you still think sda2 is a logical partition?

check the partition id of sda2 it will be
05h = Extended
or
0Fh = Extended LBA


Quote
sda5 and sda6 are logical partitions

how do you (with respect) figure that????

because a partition is a logical partition when it is defined with the partition table of an extended partition.

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #31 on: June 05, 2012, 09:37:26 AM »
Quote
on your images, what word do you see beside sda2? extended or logical? do you still think sda2 is a logical partition?


http://shareimage.ro/images/hacdc309kuivthqb65f9.png

Quote
check the partition id of sda2 it will be
05h = Extended
or
0Fh = Extended LBA

where exactly is that found in gparted????
« Last Edit: June 05, 2012, 09:46:44 AM by manbearpig »

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #32 on: June 05, 2012, 09:48:49 AM »
previous post: the image gives an 403 forbidden http error

where exactly is that found in gparted????

i dont know if gparted is able to show the partition id.

either you use "fdisk /dev/sda -l"  or you check the id with a hex editor.
« Last Edit: June 05, 2012, 09:51:06 AM by Elmar »

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #33 on: June 05, 2012, 09:52:56 AM »
« Last Edit: June 05, 2012, 09:55:11 AM by manbearpig »

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #34 on: June 05, 2012, 09:54:06 AM »
previous post: the image gives an 403 forbidden http error

where exactly is that found in gparted????

i dont know if gparted is able to show the partition id.

either you use "fdisk /dev/sda -l"  or you check the id with a hex editor.


what "hex editor" in linux????


my links should work , i can see them fine on my end....

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #35 on: June 05, 2012, 09:57:19 AM »
the image works now.

sda2 is there a primary partition. do you want to waste my time?

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #36 on: June 05, 2012, 09:59:08 AM »
the image works now.

sda2 is there a primary partition. do you want to waste my time?


what are you talking about????   primary , sda2 , logical!!!!!

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #37 on: June 05, 2012, 10:01:41 AM »
look man , I've already proven you wrong ! , now not that i want to gloat or say hahahaha , but just accept the fact that i did , or at the least that i know what i'm talking about ...

i'm not trying to be insulting here , just saying.... :)   

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #38 on: June 05, 2012, 10:02:21 AM »
the image works now.

sda2 is there a primary partition. do you want to waste my time?


what are you talking about????   primary , sda2 , logical!!!!!

i do no longer feed the troll

Elmar

  • Administrator
  • Hero Member
  • *****
  • Posts: 2434
  • a command shell is enough to do amazing things
Re: bootloader
« Reply #39 on: June 05, 2012, 10:04:37 AM »
look man , I've already proven you wrong ! , now not that i want to gloat or say hahahaha , but just accept the fact that i did , or at the least that i know what i'm talking about ...

i'm not trying to be insulting here , just saying.... :)

the only thing you proved is that you dont know much about partitions

manbearpig

  • Jr. Member
  • **
  • Posts: 56
Re: bootloader
« Reply #40 on: June 05, 2012, 10:12:27 AM »
the image works now.

sda2 is there a primary partition. do you want to waste my time?


what are you talking about????   primary , sda2 , logical!!!!!

i do no longer feed the troll

why do you call me a "troll"???


Quote
the only thing you proved is that you dont know much about partitions

well now , let's not be insulting??? , ok?  i'm just simply trying to have a conversation about disk partitioning and such....  not to start a flame war...


if i may ask , where are you from anyway...??