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-09-2005, 07:59 PM   #1
linda
Member
 
Registered: Apr 2001
Location: New Jersey
Distribution: Slackware
Posts: 222

Rep: Reputation: 30
Active/Bootable partition question


I am dual-booting WinXP and trying different Linux distros. Since I still consider myself a newbie (and probably always will!) I do my partitioning in Windows. I have Partition Magic (but not using it anymore) and Paragon's Partition Manager.

My question is this: according to things I've read, I think I can't have more than one Active/bootable partition? But in both of the above programs, my XP partition is active, and my Debian partition which is in an extended partition is also. I can't seem to change it, in either program.

Is it possible to have more than one active partition on the same physical drive? The drive is a 250 GB sata, if that matters...
 
Old 11-09-2005, 08:41 PM   #2
den15
Member
 
Registered: Oct 2005
Distribution: zenwalk
Posts: 88

Rep: Reputation: 15
i presume that u have to resize your extended partition, which takes all place and allows just creating of logical partitons. you need one more primary partition (if u want one more OS to be bootable, or more primary partitions if u want more OS). you can use fdisk (comes with Slackware) to do all that. in slackware installing tutorials u can find descriptuion how to use fdisk. i recommend this one:

http://www.bitbenderforums.com/vb22/...threadid=60154
 
Old 11-09-2005, 09:04 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I have two ide drives with one primary active bootable partition on each drive, and one extended partition on each drive. Each extended drive is subdivided into 5 partitions, with one of the 5 flagged as bootable. So, hda1 and hdb1 each hold a bootable OS, and hda6 and hdb6 also have bootable OSs.

I googled up this information, which you may find useful.

Primary Partitions
The primary DOS partition is the partition containing the files (IO.SYS, MSDOS.SYS and COMMAND.COM) needed to boot DOS. This is C:. Primary partitions cannot be divided into logical drives.

Any hard disk in a PC can have a primary partition, not just the first hard disk.

Because of the fixed size of the partition table (64 bytes), there can be at most 4 primary partitions on any given drive. If there were 4, they would be called C:, D:, E: and F:, assuming they are on the first hard disk.

If you want more that 4 partitions on 1 hard disk, some need to be extended partitions. Remember, you don't have to have 4 primary partitions, but you can have up to 4.

This limit of 4 explains why, under Linux, primary partition names - for the first hard disk - range from /dev/hda1 to /dev/hda4, and why logical partition names must start from /dev/hda5.

Active And Bootable Partitions
If a partition is marked as active, it can be booted from. Only primary partitions can be marked active.

Use DOS's or Linux's fdisk program to display partition tables, wherein you will see some partitions marked as active.

Extended Partitions
An extended partition is a non-primary partition. There can only be 1 extended partition per drive. The major difference is that extended partitions can be sub-divided.

Thus an extended partition could be (contain) D:, or it could be D: and E:, or ...

Logical Drives
Logical drives are the names, C:, D:, E:, etc, used to refer uniformly to primary partitions and the parts of extended partitions.

If, under Linux, the first SCSI drive (/dev/sda) contained a primary partition and an extended partition, and the latter contained 2 logical drives, then:


1. The primary partition would be /dev/sda1
2. The logical partitions would be /dev/sda5 and /dev/sda6
 
Old 11-09-2005, 09:13 PM   #4
den15
Member
 
Registered: Oct 2005
Distribution: zenwalk
Posts: 88

Rep: Reputation: 15
a little bit confused.

"Only primary partitions can be marked active. "

and only active partition can be bootable, or acitve means bootable? and u have logical partitions also as bootable....?
 
Old 11-10-2005, 07:50 AM   #5
linda
Member
 
Registered: Apr 2001
Location: New Jersey
Distribution: Slackware
Posts: 222

Original Poster
Rep: Reputation: 30
"Active And Bootable Partitions
If a partition is marked as active, it can be booted from. Only primary partitions can be marked active."

Yes, this is why I am asking. I just created a screenshot of both Paragon's Partition Manager and PowerQuest's Partition Magic. I have a bmp of both, but nowhere to put it here..

I have a primary parttion for WinXP that is active, and a Debian extended partition that is on the same Sata drive that is also marked as Active. I can't change it from within those programs: the option is grayed out.

What is the easiest way to run fdisk to look at how that program reports my partitions?
 
Old 11-10-2005, 08:22 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Let me throw the baby out with the bath.

Bootable partition is only used by DOS and Windows (Also BSD & Solaris) because they cannot survive in a logical partition.

The bootable flag in a logical partition is "unused"! Linux can be booted from either a primary or logical partition and does not give a damn if the booting flag is switched on or not. In other word Linux is immune to the system used by DOS/Windows.

A good partitioning program, that has been designed to be PC compatible, would switch permit only one primary partition booting flag to be switched on by switching off the previous one whenever a new one is selected. This is visible in Linux's cfdisk & fdisk. The DOS's fdisk and XP's disk management program do the same thing. Even 3rd party Partition Magic would toes the line, otherwise all hell will break loose for DOS & Winodws.
 
Old 11-10-2005, 08:52 AM   #7
linda
Member
 
Registered: Apr 2001
Location: New Jersey
Distribution: Slackware
Posts: 222

Original Poster
Rep: Reputation: 30
Ok, saikee, your post made sense to me. In other words, the flag on my Debian partition is useless, and not read by Linux anyway.

But I worry about my DOS, winXP stuff. I don't want it to get confused, as you say, all hell will break loose. This problem with having 2 active partitions showed up after installing Debian. I guess the Debian install set a flag that said it was active/bootable, and turned off the flag for my XP partition. I had to turn it back on to boot XP. I used Paragon to do that, and it didn't turn off the Debian's flag. And is not able to ...

I guess ulitmately my question is, should I be concerned? I can delete my Debian install to set things right... so should I?
 
Old 11-10-2005, 09:35 AM   #8
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I wouldn't worry about the booting flag in logical partitions. If a distro needs it as a guide it will flag it up on being booted to it every time.

Both Lilo and Grub need the user to define the root partition for every booting choice and that is all it take to boot a Linux or a Windows

Lilo uses image=/dev/hda? or other=/dev/hda?

Grub uses root (hd0,?) etc

A user only needs to touch the booting flag if he/she has several DOS/Windows partition within the same disk. In such case the partitions ahead of the booting partition can be made hidden and the target partition can be "makeactive" to satisfy the DOS/Windows' fantasy of being booted to a "C" drive.

One can boot up a Grub floppy (unattached to an operating system) and manually switch the booting flag around with the command "makeactive".
 
Old 11-13-2005, 05:00 PM   #9
linda
Member
 
Registered: Apr 2001
Location: New Jersey
Distribution: Slackware
Posts: 222

Original Poster
Rep: Reputation: 30
Saikee, I have been reading other posts about the Grub bootloader, and I am going to try your process of creating a Grub floppy (unattached). It sounds like a perfect tool for someone who likes to dabble in trying different distros.

You wrote somehwere that you don't understand why people don't stop using the ntloader, and just use Grub. One big reason (the biggest reason for me anyway) is that everytime WinXP updates, it overwrites the MBR. So I always leave the MBR untouched by Linux. Doesn't that problem affect you in your system? Or have you found an easy work-around?
 
Old 11-13-2005, 05:53 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
linda,

Never experience such a thing that M$ would update the boot loader and I ran 5 licenses of XP at home.

Think you mix up with M$ always "reboots" after a major update. You can still boot up the XP as usual (like before the update) with a non-M$ boot loader.

I am pretty relax about that M$ would not touch the boot loader because of the following reasons

(1) Boot loader resides in sector 0 or a partition reserved exclusively for such a purpose. It is not part of the filing system. That is why people can format a partition 100 times but can't get rid of the boot loader which can only be overwritten by anther boot loader.

(2) Boot loader has no security risk as it buggers off before you can say thank you to it. You never see the bugger again until next time you boot the PC. The partition table is inside the stage 1 of a boot loader and that has a security risk. No boot loader can exists without the ability of steering away from the partition table in all conditions.

(3) M$ uses a common MBR for DOS, old and new Windows. I have always managed to restore the XP's MBR with a dead DOS floppy. I have also used a XP installation CD to restore Win2k's MBR and vice versa.

(4) The MBR is only 512 byte large with only the first 446 bytes being the executable code, followed by the 64 bytes describing the 4 primary partition and 2 spare bytes. There is no scope to make the MBR any more complicated. The MBR's duty is to pull the main 2rd stage boot loader into memory. A boot loader always chainload another at the position after the first sector or the +1 position.

So there is not much that can be changed in the stage1 of a boot loader (the bit that actually in the MBR) or any purpose served. M$ can make other systems more difficult to boot its own systems but it is already boxed itself in a tight corner as a result.

These are some cosequences M$ suffered from its "clever or selfish" moves with the boot loader in the past

(a) XP can only boot one DOS-based system but Grub can boot all MS systems put together in a box

(b) A M$ system cannot survive outside a primary partition but Linux can reside anywhere in a disk.

(c) Same version of M$ systems cannot co-exist as working operating systems in the same box. Linux can do that and also is able to change root to another Linux to operate it without leaving the original system.
 
Old 11-13-2005, 06:37 PM   #11
linda
Member
 
Registered: Apr 2001
Location: New Jersey
Distribution: Slackware
Posts: 222

Original Poster
Rep: Reputation: 30
So on your system, where do you install Grub? On the MBR (of the first partition)? And Windows updates don't corrupt it? That was the only reason I always put Grub on a seperate partition, installed on the PBR, of the second partition.

What happens if I re-install WinXP? I do that about once a year. I guess it would be easy to reinstall Grub to the MBR after a re-install overwrites it... Especially if I keep one of those Grub floppies you wrote about. :-) I sure do wish I knew as much as you do about booting processes... But the next best thing is, you are here and so willing to share your knowledge!!!
 
Old 11-13-2005, 07:24 PM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
There is nothing to corrupt. Both XP and Linux or any system compete for the MBR or the first 512 bytes of the bootable disk, only because that is what the BIOS reads every time the machine is switched on.

If you put XP in the MBR it takes a fair bit of effort to multi-boot, relative to the work needed with Grub or Lilo.

Basically XP need the first 512 bytes of a Linux boot loader copied, stored into "C" and amend its hidden boot.ini to include entry of the Linux. If the user choses Linux to boot then XP's NTLDR just puts Linux's stage1 (or first 512 byes) of it boot loader in memory and disappears for holiday.

Grub in MBR does nearly the same but a lot neater. It has a command interpretor for accept instructions, line by line from a user, to execute a booting process manually. It can hunt down every partition withouttouching the other' system's boot loader. What an average user normally does is to put the commands in a batch file or a script called /boot/grub/menu.lst so that Grub just goes ahead to obey it. Grub also pull XP into memorry at the +1 position.

There isn't much difference in the booting operation of all of them. You just need to know how to restore their MBR

XP's MBR can be restored by a DOS floppy (by fdisk /mbr)or an NT version of Windows installation CD (by fixmbr).

Linux's Lilo or Grub can be restored by any Linux Live CD or the installation CD. You boot up the CD's version of Linux, change root to the one that lost the MBR (command chroot) and replicate the boot loader in the MBR.

For Lilo you type lilo -b /dev/hda

For Grun you type grub-install /dev/hda

Therefore a user can afford to lose the MBR for any system without fear.

XP cannot be booted by M$'s own floppy. Lilo floppy only boots the version attached to a Linux. Grub is the only one that can be attached or deteched from a system. When detached from a system it can boot all systems in a PC. I am still search a system that can beat this Grub floppy.

Booting in Linux is actually very simple. Only Windows makes it complicated.
 
  


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
Best Bootable Partition Tool? totalshredder Linux - Software 9 01-01-2005 09:02 PM
BIOS resetting active partition Snyke Linux - General 5 12-06-2004 09:51 AM
active partition? JediDrunk Linux - Newbie 9 09-01-2003 01:58 PM
Resize an Active Partition deesto Linux - General 1 02-04-2003 02:22 AM
How do I change the active boot partition Tayste_2000 Linux - Newbie 4 07-06-2002 06:29 PM

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

All times are GMT -5. The time now is 02:09 AM.

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