[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: partitions - primary vs logical and bootability

Am Sonntag, 11. November 2012 schrieb Joe:
> On Sat, 10 Nov 2012 16:09:36 -0600
> Charles Blair <c-blair@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.

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..."

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

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

Reply to: