Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

partitions - primary vs logical and bootability

58 views
Skip to first unread message

Charles Blair

unread,
Nov 10, 2012, 5:40:01 PM11/10/12
to
I am trying to set up a dual-boot windows 7 / wheezy.

The installer shows me 3 primary ntfs partitions,
presumably for windows7.

I have been able to resize to create freespace.
As I understand it, / must be bootable, which seems
to mean it must be a primary partition. However,
when I do that, the installer shows the remaining
free space as "unusable," and won't let me create
logical partitions for swap, /usr, etc.

I'm sure I'm overlooking something basic. Thanks
for your patient help.


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20121110160...@debian.hsd1.il.comcast.net.

Rick Thomas

unread,
Nov 10, 2012, 11:00:01 PM11/10/12
to

On Nov 10, 2012, at 2:09 PM, Charles Blair wrote:

> I am trying to set up a dual-boot windows 7 / wheezy.
>
> The installer shows me 3 primary ntfs partitions,
> presumably for windows7.
>
> I have been able to resize to create freespace.
> As I understand it, / must be bootable, which seems
> to mean it must be a primary partition. However,
> when I do that, the installer shows the remaining
> free space as "unusable," and won't let me create
> logical partitions for swap, /usr, etc.
>
> I'm sure I'm overlooking something basic. Thanks
> for your patient help.

You only get 4 primary partitions. If you want any Logical
partitions, you have to have to make one of the primary partitions an
Extended partition, and put your Logical partitions inside that
Extended partition.

So, in effect, your three Primary NTFS partitions have used up all the
primary partitions you can have if you want to use Logical partitions.

As I see it, you have two options:

1) Make your Linux partition an "everything" partition (root, boot,
usr, var, home, and so on...), in Primary slot #4.

2) Backup one of your NTFS partitions (say, #3); put your Linux Root
in the now-free Primary partition (#3) resized as necessary; move the
remaining two NTFS Primary partitions around (if necessary) so you can
consolidate all your free-space into one Extended partition (#4); then
create a Logical partition (#5), inside the Extended (free-space)
partition, to hold the backed-up contents of the old #3; and one or
more Logical partitions (#6, #7, #8) to hold the rest of your Linux
stuff.


Or... You could leave your old Windows disk alone, buy a new disk and
put Linux on it. Then you can switch between booting Linux and
Windows by using the boot disk chooser of the BIOS. There was a
recent thread in Debian-Users on this topic -- I recommend you read it
before you start.

For more on the topic of Logical/Extended/Primary partitions, see
WikiPedia at

http://en.wikipedia.org/wiki/Disk_partitioning
or
http://en.wikipedia.org/wiki/Master_boot_record

and the man page for "fdisk" (it may be called "fdisk.distrib" if you
have gnu-fdisk installed) which is available on the web at (among
other places) http://linux.die.net/man/8/fdisk .


Enjoy!

Rick


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/57B29786-4867-439A...@pobox.com

T o n g

unread,
Nov 11, 2012, 12:10:02 AM11/11/12
to
On Sat, 10 Nov 2012 19:51:29 -0800, Rick Thomas wrote:

> You only get 4 primary partitions. If you want any Logical partitions,
> you have to have to make one of the primary partitions an Extended
> partition, and put your Logical partitions inside that Extended
> partition.
>
> So, in effect, your three Primary NTFS partitions have used up all the
> primary partitions you can have if you want to use Logical partitions.
>
> As I see it, you have two options: . . .

Another option is to put your linux partition in the Extended Logical
partitions, then put LILO in MBR to chain boot Windows or your linux.

I.e., LILO does not have the MS brain-dead limitation to only boot from
primary partitions.



--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/k7nbq8$vab$2...@ger.gmane.org

T o n g

unread,
Nov 11, 2012, 12:40:02 AM11/11/12
to
On Sun, 11 Nov 2012 05:07:20 +0000, T o n g wrote:

> On Sat, 10 Nov 2012 19:51:29 -0800, Rick Thomas wrote:
>
>> You only get 4 primary partitions. If you want any Logical partitions,
>> you have to have to make one of the primary partitions an Extended
>> partition, and put your Logical partitions inside that Extended
>> partition.
>>
>> So, in effect, your three Primary NTFS partitions have used up all the
>> primary partitions you can have if you want to use Logical partitions.
>>
>> As I see it, you have two options: . . .
>
> Another option is to put your linux partition in the Extended Logical
> partitions, then put LILO in MBR to chain boot Windows or your linux.
>
> I.e., LILO does not have the MS brain-dead limitation to only boot from
> primary partitions.

What I've tried and successful was, put the MBR from LILO into the MBR
sector on the disk,

lilo -S /dev/null -M $MBR ext

then mark my linux partition in the Extended Logical partitions as
bootable, and put GRUB in its PBR, then chain boot *everything* from
there.

I.e., you do necessarily boot from LILO, just wipe out the brain-dead MS
MBR with it would be fine.

PS. for booting Q&As, I found bootland (now reboot.pro) extremely helpful.

HTH

cheers




--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/k7ndki$buh$1...@ger.gmane.org

Neil T. Dantam

unread,
Nov 11, 2012, 2:20:01 AM11/11/12
to
At Sat, 10 Nov 2012 16:09:36 -0600,
Charles Blair wrote:
>
> I am trying to set up a dual-boot windows 7 / wheezy.

Can you install grub2 to the MBR and have it boot both debian and
MSWindows? This worked fine to dual-boot WinXP.

> As I understand it, / must be bootable, which seems to mean it must
> be a primary partition.

AFAIK, an MBR-installed grub doesn't care about partition boot flags.
Only if you have a DOS MBR and grub installed to a PARTITION does the
boot flag matter.

Grub2 should be able to handle / and /boot on a logical partition.

Actually, I prefer to use LVM rather than individual partitions, and
grub2 CAN load kernels from an LVM / or /boot.

Cheers,

-ntd



--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/k7nip6$ef1$1...@ger.gmane.org

Rick Thomas

unread,
Nov 11, 2012, 5:20:01 AM11/11/12
to

On Nov 10, 2012, at 9:49 PM, Charles Blair wrote:

> Thank you very much for your reply. I think I will post
> a restatement of the question. I would have thought that
> a dual boot of windows 7 and debian would be a common
> enough problem that there should be something about it
> somewhere, perhaps in the installer instructions.
>
>
>> 1) Make your Linux partition an "everything" partition (root, boot,
>> usr, var, home, and so on...), in Primary slot #4.
>
> Just to get more detail on how this would work:
> I would create a primary partition using all the available
> free space, described as / and bootable? This would work
> even though there isn't swap space?
>
> I must admit I'm afraid to tinker with the windows section,
> so that your other idea of backing up one of the windows partitions
> (don't even know how I would do that) and doing things so I
> have only two primary winows partitions and
> have one primary debian partiton for / (bootable) and one extended
> partion for swap, /home, etc. Actually I must be misunderstanding
> your idea, since I think swap is somehow incompatible type from /,
> /home, etc.

If you've got enough RAM, you don't absolutely have to have a swap
partition. If you're short on RAM you can make a swap file in the
root directory and use it. E.g.:
dd if=/dev/zero of=/swap bs=1M count=512
mkswap /swap
swapon /swap

To back up the Windows partition, you probably want an external (e.g.
USB) hard disk to put the backup image onto.

Take a look at the "clonezilla" utility as described at
http://www.linuxjournal.com/content/clonezilla-live
for ideas.

Rick


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/28CCCE93-8610-4B98...@pobox.com

Joe

unread,
Nov 11, 2012, 5:30:02 AM11/11/12
to
On Sat, 10 Nov 2012 16:09:36 -0600
Charles Blair <c-b...@illinois.edu> wrote:

> I am trying to set up a dual-boot windows 7 / wheezy.
>
> The installer shows me 3 primary ntfs partitions,
> presumably for windows7.
>
> I have been able to resize to create freespace.
> As I understand it, / must be bootable, which seems
> to mean it must be a primary partition. However,
> when I do that, the installer shows the remaining
> free space as "unusable," and won't let me create
> logical partitions for swap, /usr, etc.
>
> I'm sure I'm overlooking something basic. Thanks
> for your patient help.
>
>

As others have said, up to four primary partitions, OR one extended
partition and up to three primaries.

The difference between them is that only four slots are allocated for
partitions in the table: IBM apparently thought that nobody would ever
need more than four. The 'extended' partition is an entry in the four
slot table pointing to another disc area where more partition table
entries can be placed. There's little agreement on how many are
'enough' these days, and an OS will often permit more on a SCSI drive
than an ATA. You can usually bet on at least ten 'logical' partitions
being available.

There is no practical difference between primary and logical partition
usage *except* that Windows (up to and including XP to my knowledge,
probably later versions also) requires that the first primary partition
it can recognise (i.e. the partition table says it's FAT or NTFS) must
be marked with the 'bootable' flag, and must contain a few critical boot
files. Apart from that, anything can be anywhere, including the Windows
directory which contains the entire OS apart from the boot files.

Linux does not make use of the 'bootable' flag, though Linux
partitioning utilities can set and display it. Linux does not need
anything to be stored on a primary partition.

By the way, one or possibly two of the NTFS partitions will not
normally be used, they are usually a recovery partition (MS hasn't
supplied installation media for many years) and the computer
manufacturer's rescue tools and drivers. Windows itself normally only
uses one partition on consumer OEM computers. If that is indeed the
case, they can be copied off elsewhere (with a note of their partition
table entries) and the space used, and can be copied back to the same
physical disc locations if you ever need to reinstall Windows. Don't
try moving Windows itself (though its partition can usually be shrunk)
because some of the OS knows where it is, on which individual hard
drive, and assumes that if it's not there it's an illegal copy, and
will refuse to run.

Note that the partition table is completely separate from the rest of
the drive. The first thing you ever do when messing with partitions is
to write all the numbers down or print it. Then, if you make a complete
mess of the table, so long as you haven't mounted anything and written
to it, you can often use a rescue disc to rewrite the partition table
exactly as it was, and restore things. Just don't bet irreplaceable
files on that principle, because the one day you are out of luck will
be that day...

--
Joe


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20121111102...@jretrading.com

Rick Thomas

unread,
Nov 11, 2012, 6:40:02 PM11/11/12
to
Hi Charles,

On Nov 11, 2012, at 4:56 AM, Charles Blair wrote:

> Thanks again. I wish these issues had been
> addressed either by the installer itself or by the
> installation instructions. Tnere must be
> many other unsophisticated users that
> have encountered this problem.

You're welcome, of course. That's what these lists are for.

If you succeed in your experiments, one thing you can do to help the
next person is: write-up your experiences. If you follow the basic
format of the installation manual, I think there might be somebody
here who would be willing to help you to get it into shape to include
as an appendix to the manual.

A good place to start is the Debian wiki at
http://wiki.debian.org/

If you decide to start a wiki page, let us know the URL so we can
contribute our thoughts too.

That's what open source is all about, after all -- share and share
alike. Share the effort; share the benefits.

Enjoy!

Rick


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/B2E189FE-F58C-4849...@pobox.com

Charles Kroeger

unread,
Nov 13, 2012, 1:10:02 AM11/13/12
to
On Sat, 10 Nov 2012 23:40:01 +0100
Charles Blair <c-b...@illinois.edu> wrote:

> The installer shows me 3 primary ntfs partitions,
> presumably for windows7.

What installer is that?

Well, I'm assuming this is the Debian Installer 7.0 Beta2 you're using. First off
it sounds like you have no 'free space' on this HD. You need that to achieve a duel
boot environment. Forget about doing this with the win7 installer. Use instead
Gparted on a 'rescue' disk like 'Rescatux' or other 'live' CD's that have Gparted
installed, and make yourself some space with a nice EXT4 filesystem. Gparted is a
great program.

Why are there 3 primary NTFS partitions..questions questions...I mean there can be
but why? Most of the windows installs I've seen just have the 'C' drive. and the
usual D E etc 'drives' for CD's and the like, but they're not primary drives.

Anyway, after you've wrested some free space away from the NTFS covered HD with
Gparted, boot up with the aforementioned installer that will install the 'wheezy'
version then install the Grub2 boot manager that will susout the other OSes on the
disk and with the reboot you should get a menu and see all the bootable
possibilities at that point, including a line for the windows7 installer.

I noticed the mention of LILO in some of these related posts and I would just
advise you to consider LILO to be out of it and stick with Grub2.

Welcome to Debian, that's Debian Invictus to you, it certainly is to me.
--
CK


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/age50n...@mid.individual.net

Martin Steigerwald

unread,
Nov 17, 2012, 5:50:01 AM11/17/12
to
Yes. Thats what I thought to be the case as well. I was not completely sure so thanks for the confirmation.

So it should be possible to have the last primary partition as extended partition going up to the end of the drive, create logical partitions in there and have GRUB load Linux from a logical partition.

Personally I would go for:

1) Primary: Windows or recovery or windows data or whatnot
2) Primary: Windows or recovery or windows data or whatnot
3) Primary: Windows or recovery or windows data or whatnot
4) Extended
5) Logical: 200 MB /boot or so
6) Logical: LVM

> Note that the partition table is completely separate from the rest of
> the drive. The first thing you ever do when messing with partitions is
> to write all the numbers down or print it. Then, if you make a complete
> mess of the table, so long as you haven't mounted anything and written
> to it, you can often use a rescue disc to rewrite the partition table
> exactly as it was, and restore things. Just don't bet irreplaceable
> files on that principle, because the one day you are out of luck will
> be that day...

Yeah. Especially with logical partitions as they are more difficult to restore with gpart and testdisk.

I suggest using sfdisk to make a backup of the partition table.

I have:

# Partitionierung
echo "Sichere Partitionierung..."
sfdisk -d /dev/sda > /root/sfdisk.dump
parted -l > /root/parted-l.txt

# LVM-Metadaten
echo "Sichere LVM-Metadaten..."
vgcfgbackup

in my rsync based backup script. The files are then backed up via rsync afterwards.

Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201211171139...@lichtvoll.de
0 new messages