LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   The exact process of booting from a logical partition ... (https://www.linuxquestions.org/questions/linux-newbie-8/the-exact-process-of-booting-from-a-logical-partition-744500/)

joeBuffer 08-02-2009 06:43 AM

The exact process of booting from a logical partition ...
 
I apologize if this has been asked a hundred times, but I searched through the threads and posts here and did not find an answer that helped me at all.
What is the exact process of booting from a logical partition?
I have read several things, and all are confusing to me and I can't find a good answer.
Here's what I know and an example:
I've read this is easily possible ... some things I've read said something about it being complex and that you have to chainload. Some things I've read said it's very easy, but it has something to do with booting from the extended partition. Others said, no you use the logical partition itself. I can't clear up what anyone is talking about ...
When using openSUSE 11.1, the Live CD ... and trying to install it. It will give me problems when trying to boot from a logical partition, not to mention I don't want to do something wrong and add data or anything where it shouldn't be. I don't know what I'm doing, at all, and I can't understand people's explanations of this.
When using openSUSE, you can choose (when configuring GRUB using the graphical installation) "boot from extended partition" and use "custom boot partition: sda(1,2,3,whatever)" and it will work. If you choose to boot from the logical partition only, and don't check "boot from extended partition", it will say "no operating system found" when booting. What exactly is happening here, I'm completely lost. Choosing "boot from extended partition" can't cause any problems of any kind, can it? What is the proper way of doing things in this situation, what is really happening?
:cry:

pixellany 08-02-2009 07:01 AM

Booting from a logical partition is no different than booting from a primary. You simply have to get control transferred to the boot code on the partition. In GRUB, that is what the chainloader does.

But, you can't boot from an extended partition---in fact, you can't do anything with an extended---it simply acts as a container** for the logicals.

The fundamental truth is simply that any physical drive which the BIOS tries to boot must have boot code in the MBR (defined as the first sector or the drive---regardless of partitions). If you also put boot code on a partition, the MBR boot code (or more typically the config file) has to point to that partition.

The link below in my sig is old, but still might be useful. Also search here for member "Saikee" and look at his links.


**
An extended partition is actually just the beginning of a linked list---it points the system to the beginning of the first logical partition. The boot sector of the first logical has a mini partition table pointing to the actual partition and to the next logical----this daisy chain continues to the maximum number of logicals allowed.

joeBuffer 08-02-2009 07:20 AM

I know using fdisk, if you use a to mark a partition as active, and you mark the extended partition as active, it will give you a warning ... warning: extended partition.
When I am installing openSUSE, say I have it this way:
2 is extended partition, 5 is /boot, 6 is swap, 7 is /
If I don't choose "boot from extended partition" on the menu, but choose to boot from custom partition: 5, it will not boot.
By default, it sets it so that the boot partition gets marked as active, using openSUSE's installer.
I have to check "boot from extended partition" AND "boot from custom partition: 5" or it WILL NOT WORK. I have no idea what I'm doing, I've looked at sites, I've read documentation on partitioning, I do not understand what is happening. What is the difference between picking "boot from extended partition" and "custom partition: 5"?
What happens when you choose to boot from extended partition and select custom partition: 5. By default it was setting it so that "boot from extended partition" and "custom partition: 1", which is a windows xp recovery partition (not for myself, but I was thinking about getting a new computer and giving this one away with windows xp on it). what happened in that case? This may seem like I want you to put a web site of information here, but I'm telling you I've seen these websites, I've seen this information, over and over and over again I've read things on this and none of it is specific as to what to do or what is happening, it's worded in a strange way and I see conflicting information on all of this (unless it's just openSUSE's way of doing things that is confusing me). It's ridiculous. Why would it mark my first partition as active, and change the contents slightly (which it did, it slightly altered the size!) by default!? I have read and read and read on this, I have no idea what this is doing, this is ridiculous.

I should add that when not choosing boot from extended partition , it will mark the extended partition as active, which would be the problem ... so you have to inform that you're booting from a logical partition?? If so, what are you doing to inform it that you are booting from a logical, and not the extended? It just marks the logical as active instead of the extended? It's confusing to me that if you choose to make 5 the /boot partition, but don't choose "boot from extended partition", it will mark the extended partition as active and try to boot.

So the reason that it marked the first partition and changed it's size slightly by default is because it installed the stage 2 bootloader there?

joeBuffer 08-02-2009 07:30 AM

I thought I had a pretty firm understanding of this, and now I'm very lost.
What I'm saying is, I have trouble understanding openSUSE and extended partitions, but I have not had any problems with doing things this way using anything but openSUSE. I've installed this way before, and it was easy. Using primary partitions it's easy, using Ubuntu and logical partitions, it's easy. Installing openSUSE this way, I'm wondering what it is I'm doing when I do something. I'm used to either using fdisk or using fdisk to set things up and having the installer take care of the rest, sort of.

joeBuffer 08-02-2009 09:17 AM

I just installed and updated openSUSE 11.1 using the "boot from extended partition" option and the "custom partition: 5" option. Obviously I think I understood what I was doing, but what it does by default was confusing to me.
I had one funny thing happen, only ... I was doing something, and twice the theme I had on here went away all of a sudden. Then I went to change it back, and it said possibly something's already running. Anyways, I restarted again, changed it back when it did it again, didn't receive a message, and now it seems to be working fine.
I'm sure I understood how to do it, then when thinking I had it wrong because of the way it does things by default, I went reading other stuff, and got confused by the way things were worded, and people's posts. So I had a good understanding, and it's just openSUSE that confused me. I'm sure I have it fixed, now, and understand what to do ...
I was just starting to think that maybe I really misunderstood what I was doing, and was relying on the installer more in the past than it seemed like I was, except I thought "I've used Gentoo and LFS and made the partitions myself and never had a problem, so it must be the way it is with openSUSE and I'm not really confused".

joeBuffer 08-03-2009 07:58 AM

pixellany, or someone:
Using those choices for installation, which are the default choices using the openSUSE installation, it has done what I was talking about:
it marked my extended partition as active.
Can any problems be caused by this? It seems to be working fine, except when I use themes, the themes aren't showing up correctly in the theme selection window, but they do show up correctly otherwise (when selected). Also, I did have the problem I mentioned a couple of times, where it changed over suddenly to another theme (but not in the panel) and gave me messages that something could already be running. But it has gone away now.
Is it possible using the choices I already wrote down here, that any sort of problem could be caused? I guess I have to do more reading ...
again, I chose the default "boot from extended partition", but changed the "custom boot partition" to 5. The second (extended partition) is marked as active.

pixellany 08-03-2009 08:15 AM

I don't see how there would be any connection between themes and marking partitions as active.......

Linux does not use the active flag, so you might as well try turning it off.

Quote:

I chose the default "boot from extended partition"
This really puzzles me---I don't believe you can actually use an extended partition for anything---it is only the beginning of a linked list of the logical partitions.

What is the overall boot setup? i.e. what is in the MBR? Are you chainloading to the Linux partitions? Assuming that GRUB is in the MBR, please post the contents of the relevant /boot/grub/menu.lst (Take out all the commented lines to keep it concise.)

joeBuffer 08-03-2009 08:19 AM

Code:

3 timeout 15

  5 gfxmenu (hd0,4)/message

  9 title openSUSE 11.1 - 2.6.27.25-0.1
 10    root (hd0,4)
 11    kernel /vmlinuz-2.6.27.25-0.1-default root=/dev/disk/by-id/ata-WDC_WD800JD-22JNC0_WD-WMAM966    19155-part7 resume=/dev/disk/by-id/ata-WDC_WD800JD-22JNC0_WD-WMAM96619155-part6 splash=silent sh    owopts vga=0x31a
 12    initrd /initrd-2.6.27.25-0.1-default
 13

 15 title Failsafe -- openSUSE 11.1 - 2.6.27.25-0.1
 16    root (hd0,4)
 17    kernel /vmlinuz-2.6.27.25-0.1-default root=/dev/disk/by-id/ata-WDC_WD800JD-22JNC0_WD-WMAM966    19155-part7 showopts ide=nodma apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off    highres=off processor.max_cstate=1 x11failsafe vga=0x31a
 18    initrd /initrd-2.6.27.25-0.1-default

no line numbers, of course, i just copied and pasted from vim ...

joeBuffer 08-03-2009 08:21 AM

The theme errors don't make any sense to me, I was just wondering if maybe I don't know what I'm talking about ... I'd be surprised.
What I'm talking about is the default for the installation, the only other thing it did by default (when I didn't tinker with the grub setup options), was use the active flag on the first partition.
It always sets the active flag.

pixellany 08-03-2009 11:26 AM

(Referring to your grub config file)

Assuming that this is the config file tied to the GRUB installed in the MBR, then you don't have any chainloading going on---i.e. you are booting directly into the 5th partition, which is mounted to /boot.

If you want to dig a bit further, do this:
Code:

[root@mherring-08140091110 printer]# dd if=/dev/sda bs=64 count=1|hexdump -C
1+0 records in
1+0 records out
00000000  eb 48 90 00 00 00 47 52  55 42 16 08 1c 7c d7 49  |.H....GRUB...|.I|
00000010  00 00 00 00 1c 7c d7 49  25 8a 25 8a 01 00 80 60  |.....|.I%.%....`|
00000020  5f 80 3b 01 b8 c0 07 8e  d0 bc 00 08 fb 52 53 06  |_.;..........RS.|
00000030  56 fc 8e d8 31 ed 60 b8  00 12 b3 36 cd 10 03 02  |V...1.`....6....|
00000040
64 bytes (64 B) copied, 5.3081e-05 seconds, 1.2 MB/s

What this does is dump the first 64 bytes of the MBR. If you have GRUB there, you'll get something similar.

joeBuffer 08-03-2009 11:36 AM

Code:

bash-3.1$ sudo dd if=/dev/sda bs=64 count=1 | hexdump -C
Password:
00000000  31 c0 8e d0 bc 00 7c 8e  c0 8e d8 bf 1e 06 be 1e  |1À.м.|.À.Ø¿..¾.|
00000010  7c 50 57 b9 e2 01 f3 a4  b9 00 02 f3 ab cb 80 fa  ||PW¹â.ó¤¹..ó«Ë.ú|
00000020  8f 7e 02 b2 80 52 52 bb  94 07 8d af 2a 00 8a 46  |.~.².RR»...¯*..F|
00000030  04 66 8b 7e 08 66 03 3e  b3 06 84 c0 74 0b 80 7e  |.f.~.f.>³..Àt..~|
00000040
1+0 records in
1+0 records out
64 bytes (64 B) copied, 0.000343102 s, 187 kB/s


pixellany 08-03-2009 10:50 PM

OK, so you don't have GRUB in the MBR.....But it does not look like the Windows MBR code either---(Ref: http://www.ata-atapi.com/hiwmbr.html

First, to double-check: One hard drive? Please run "fdisk -l" (no quotes, "ell", not "one", run it as root) and post the results here.

joeBuffer 08-03-2009 11:04 PM

Code:

joebuffer@linux-voes:~> sudo /sbin/fdisk -l /dev/sda
root's password:

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8f800000

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              1        911    7310488+  c  W95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary.
/dev/sda2  *        912        9729    70830585    f  W95 Ext'd (LBA)
/dev/sda5            912        943      257008+  83  Linux
/dev/sda6            944        1204    2096451  82  Linux swap / Solaris
/dev/sda7            1205        3814    20964793+  83  Linux
/dev/sda8            3815        3846      257008+  83  Linux
/dev/sda9            3847        6279    19543041  83  Linux


pixellany 08-03-2009 11:18 PM

Hmmmmmm......

What is on the first partition? (7+ GB, FAT32)

Was Windows ever on this machine?

Do you recall ever installing **anything** to the MBR?

(The noise you hear is me running out of ideas.......;))

joeBuffer 08-04-2009 08:37 AM

It's a Windows XP recovery partition. I don't use it, but I want to keep it there so that if I give this computer away I can give it away with Windows XP. I've been thinking about getting a new one.
I do recall choosing to install it to the MBR, actually.
When I installed openSUSE, I went to the GRUB configuration:
I chose:
1: one option, that was there by default, and it wasn't a big deal, it was something that wouldn't cause problems - I just can't think of what it was.
2: install to the MBR.
then I put a 15 second timeout on it, so it would wait 15 seconds to boot.

Then I chose "boot from extended partition" and "custom boot partition: 5"
If I don't check the "boot from extended partition" and choose "custom boot partition: 5", it will say "no operating system found" when I try to boot. By default, it has "boot from extended partition" and "custom boot partition: 1" checked and configured.
I have not had a problem partitioning my system, and believing I understand what I'm doing, until I tried to use a custom configuration with openSUSE - but I've pretty much gone step by step and either let the installation take care of it (sort of), or just marked the boot partition as active.
:newbie:
I'm not an expert on partitioning, but I didn't think I'd run into trouble really, especially using openSUSE. :)
I'll have to do some more reading, anyways, I don't like not knowing the details. I thought I understood more than I did, now I'm confused.


All times are GMT -5. The time now is 10:29 AM.