Partioning trouble: 4 Windows partitions

When I try to install openSuSE 11.3 from the DVD onto my new laptop, I cannot add a partition for SuSE because there are already four partitions on the hard drive, summarized below with the output of fdisk -l:

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc7f66b27
Device		Boot	Start	End	Blocks		Id	System
/dev/sda1	*	1	26	203776		7	HPFS/NTFS
/dev/sda2		26	37033	297256960	7	HPFS/NTFS
/dev/sda3		37033	38901	15002624	7	HPFS/NTFS
/dev/sda4		38901	38914	105816		c	W95 FAT32 (LBA)

In the custom partitioner, /dev/sda1 is labeled “SYSTEM”, /dev/sda2 is not labeled, /dev/sda3 is labeled “RECOVERY”, and /dev/sda4 is labeled “HP_TOOLS”.
I cannot add another partition for SuSE, seemingly because the machine limits me to 4 (primary) partitions according to this post.
What should I do? The installer suggests that I delete all the four Windows partitions, but I want to keep Windows installed on the machine. It also says “Resize impossible due to inconsistent fs under Windows” for /dev/sda2 and /dev/sda3, but I seem to be able to resize /dev/sda2 using the Expert custom partitioner. I do have a 160 GB portable hard drive which I could use to hold the contents of one of the Windows Partitions.

Well you have to make space some where. Inconsistent means there are errors in the file system this may be caused by incorrectly shutting it down. Run the ms utilities to fix disks.

Also to have more then 4 partitions one of them must be an extened which allow you to add logical partitions. You are only allowed 4 primary. So you need to get rid of one make it an extended then install Linux.

Anytime you play with partitioning you need to back up any important data.

I think that MS is intentionally encouraging the makers to fill up the primary partiton table to make it hard to do what you want to do.

I forgot to mention that I have run chkdsk, though I had to choose the run at restart option, and defragmented the hard drives from Windows.

On 2010-08-26 02:06, s-phi-nl wrote:
>
> I forgot to mention that I have run chkdsk, though I had to choose the
> run at restart option, and defragmented the hard drives from Windows.

  1. First, image your whole disk, partition by partition, so that you can recover in case of disaster.

  2. Then reduce the size of number 2.

  3. Then, delete partition number 2, replace with an extended partition, and inside create several
    logical partitions. One will be the old number 2, now number 5. The rest, for linux.

  4. reconstruct windows boot. No idea how.

Or,

  1. Delete partition number 2, replace with an extended partition, and inside create one logical
    partition, number 5. In that one, copy back the contents of old partition 2.

  2. Rebuild windows so that it can still boot. No idea how.

  3. Reduce the partition 5 in size, so that it leaves free space. In that space, add linux.

Or something of the sort. I chose delete part 2 because it is the biggest.

It is possible that (payware) “partition magic” can do the trick.

Good luck.

Warning: the above procedure is dangerous and I can’t say that you will succeed. Me, I would add a
second hard disk - being a laptop: uff :frowning:

I was lucky with my laptop, I can see. One partition free.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

I’ll try to add my understanding of your situation, because i think part of the problem is that if your description of the problem is incorrect or ambiguous, your response is likely to be wrong, too.

You can have more that four partitions on a hard disk (technically, you can have something like a hundred, but please do not try this…any attempt to do that will expose bugs in all sorts of utilities for partitioning and analysing the disk and is generally a bad idea), but four is the maximum number of primaries; the usual situation is three primaries plus a secondary, or container partition, into which a small number of ‘virtual’ partitions, inside the container partition, can be placed.

How windows would react to changes like this is unknown to me, but I have to suggest that badly would be the default.

/dev/sda4 ends on cyl 38914 and your disk has 38913 cylinders. This ‘using cylinders that you haven’t got’ is unconventional and may be the source of the inconsistency error messages. In any case, if this is essentially a read-only partition, you may be able to get away with it as far as Windows is concerned, but if you mess around with it (short of a clean install), it is possible that all sorts of nasty things could happen

Even if nothing else happens, I’d want a good, trustworthy, backup.

Note that, apart from recommending a backup (or two), none of the above constitutes actual advice.

Thank you all for your replies, though I must say that Carlos’s scares me a lot. Also, sorry for confusing any of you about anything.

I understand that I can have more than 4 partitions. The problem, as I see it, is that I need to have a primary partition to hold the secondary partitions for Linux, but my hard drive is already full of primary partitions.

Good catch.

You may be right, but note from my initial post that SuSE said that it could not resize /dev/sda2 and /dev/sda3, but did not say it could not resize /dev/sda1 and /dev/sda4.

I don’t quite understand what you’re saying here. I think you mean, “If [/dev/sda4] is a [partition that I do not expect to write to], I may be able to get away with [using cylinders I haven’t got], but if I mess around with [/dev/sda4], it is possible that all sorts of nasty things could happen.” In that case, yes, I do not expect to write to /dev/sda4.

What should I back up given that this is a brand-new laptop on which I have booted Windows but otherwise have neither saved nor installed anything? I have made the HP recovery disks which they say will restore the computer to its factory condition. I know Carlos recommended a full Hard Drive image, but that would be saving a whole lot of nothing.
In addition, I wonder whether, now that I’ve made the HP recovery disks, I can delete the recovery partition and maybe the HP_TOOLS partition. I can ask this question of HP if you think deleting the recovery partition would be useful.

Thank you all for your replies, though I must say that Carlos’s scares me a lot. Also, sorry for confusing any of you about anything.

Imaging the disk is never a bad idea, Always save anything you need…

Having said that, what you want to do is not difficult, (certainly if you have done it just once before, it is simple.)

By the way, many of the computers that do not come with a windows install disk offer some method of ‘imaging’ the installed OS.

I eventually had a computer guy come over and we decided to delete the Recovery and HP_TOOLS partitions (/dev/sda3 and /dev/sda4) and to resize the /dev/sda2 partition (all of which, by the way, you can do from Windows 7). SuSE then partitioned properly and the machine works.
Thank you all for your help.

Thank you all for your help.
I had a computer guy come over, and we decided to delete the Recovery and HP_TOOLS partitions (/dev/sda3 and /dev/sda4 respectively) and to resize the /dev/sda2 partition, all of which we did from the Windows 7 device manager. SuSE then partitioned the drive correctly and SuSE installed. Consider this question CLOSED.

On 2010-08-26 22:36, dvhenry wrote:
>
>> Thank you all for your replies, though I must say that Carlos’s scares
>> me a lot. Also, sorry for confusing any of you about anything.

Better scared than sorry :wink:

> Imaging the disk is never a bad idea, Always save anything you
> need…
>
> Having said that, what you want to do is not difficult, (certainly if
> you have done it just once before, it is simple.)

To me, it is - I no longer know windows tricks, I have been using linux instead for several years. I
just keep a copy of windows because I need it for somethings, like updating my phone, perhaps fired
once a month.

> By the way, many of the computers that do not come with a windows
> install disk offer some method of ‘imaging’ the installed OS.

Yes, mine has. But the recovery procedure deletes everything and leaves the disk as it originally
came. I think it has a configuration file, but I did not try to do so to leave space for another
partition. I had to create my own recovery procedure, that doesn’t touch linux partitions.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

Ok, guys let’s clear up some inferedfacts with actual facts. Not directed at anyone, but to the topic.

  1. Yes Microsoft has reached many agreements with venders to install and use as many primary (max is 4) to prevent people from being inclined to try other things. This just makes good business sense for them.

  2. You have an external 160GB hdd you said you could use to temporarily hold stuff. So that being the case, sda1 is small partition called system and has on it a simple program that checks to see if sda2( c: windows OS) is presenton not. If windows is present it transfers control to windows if not it looks for recovery on sda3 (d: or e: depending on whether the install assigned a drive letter to sda1) and if recovery is not found it prompts for you install the system recovery disc’s. sda2 is your windows system, sda3 is the recovery system that is supposed to have been used to create the re-install media when you first bought your machine. sda4 is special HP drivers and apps provided.

  3. The BIOS numbers cylinders from 0 to 38913 in your case because track 0 sector 1 has the MBR (partition table and boot code ~512bytes) and is not counted. Linux assigns cylinders 1 to 38914 because it counts cylinder 0 as a valid track with the partition table and boot code. This accounts for the difference.

  4. Windows does a very poor job of handling parttiioning so you may run into the odd “does not end on cylinder boundary” but linux can handle this usually quite easily since it does it’s own partition computations and windows handles it by just ignoring it (one reason windose has many hdd crashes).

  5. Maximum number of partitions per drive is technically 1 primary 3 extended and 15 logical in each extended for a maximum of 49 using ide/eide/sata/pata and in the case scsi drives 1 primary 3 extended and 31 logical per extended for a maximum of 97. For external USB drives, follow the sata spec for maximum.

  6. a PC can have a maximum of 4 physical hdd without additional controller cards, but CD/DVD/ZIP drives diminish the count as they are counted as a hdd.

  7. Reason you may be having trouble with sda2 not being able to be resized may be due to :
    …a) You have recovery points defined (while home premium can create recovery points, you need to upgrade to ultimate or professional to really use them)
    …b) You may need to defrag the system many times before windows has actually moved all files compactly. If it leaves even one file up at the end of the drive, or even one tiny sector of a file orphaned at the end, a resize will fail.
    … c) Windows will not resize the windows partition in most cases.

  8. Windows and Linux can use extended partitions with no problems but windows must be on a primary and the SYSTEM (sda1) must be on a primary. Now on my system, Windows came pre-installed so I did the important first step in creating the recovery media. 1 recovery factory disc, 2 windows recovery disc and 1 value added apps recovery CD . yours may be different quanity than mine.
    …a) I was lucky and had no user files yet but if you do copy them off someplace safe. maybe make a small data partition on external 160GB and copy them there.
    …b) Turn off recovery points, change swap space from fixed to variable-minimum size of 0 and reboot
    …c) defrag the drive to maximize space (this step may need to be done more than once to get enough room)
    …d) Make partitions on the external, one for sda3-files and one for sda4-files
    …e) Copy sda3 to external, Copy sda4 to external ( make sure to show hidden/system files before moving)
    At this point you should have re-install media, back-ups of all files which are not part of the OS itself

Now it is safe to plan out how you want Linux installed. Keep in mind that Linux can boot from primary or extended partitions.

  • If windows will not resize small enough to your liking, Linux should be able to do the trick.
    ** Since you have backed up Recovery and HP-Special you are free to delete these partitions as well as resizing the windows one.
    ** Also note that if you re-install windows from scratch, the SYSTEM (sda1) really won’t be of any use at all either unless you do
    factory install which will recreate sda1,sda2,sda3,sda4 and then ask you to re-install using the windows recovery set.
    On my system, I just put the Linux swap over sda1 which was 1.9GB, left windows but resized it, created rest of drive as extended sda2 then
    created sda5 as NTFS for shared data in extended, sda6 as Linux root in extended. Please note that sda2 let say is 100GB extended, and sda5 is 50GB and sda6 is ~50GB the starting block of sda2 and sda5 will be equal, sda6 start will be right after sda5 end block and sda6 endblock will match sda2 end block.
    In your case you will probably want to copy the recovery back to your drive which means an extra logical partition in the extended for it, and the same for the HP stuff. thusly, yours might be sda5-windows share sda6-recovery sda7-hp-special sda8-Linux. You can of course add more if you want to say break up linux into root and home etc. After you install Linux go into Windows (it may complain about drive size changes but ignore and just do a fresh defrag) format the drives for windows use ‘data recovery hp’ because that way it will work better than using Linux to do it. Copy back you stuff off the external and return the external back to be a back-up drive.

hope this all helps

Thank you, techwiz03, for your very thorough reply. If I had not gotten outside help to solve this problem, it certainly would have been of help to me.

On 2010-08-27 01:06, s-phi-nl wrote:
>
> Thank you all for your help.
> I had a computer guy come over, and we decided to delete the Recovery
> and HP_TOOLS partitions (/dev/sda3 and /dev/sda4 respectively) and to
> resize the /dev/sda2 partition, all of which we did from the Windows 7
> device manager. SuSE then partitioned the drive correctly and SuSE
> installed. Consider this question CLOSED.

Glad to hear that, and thank you for commenting the solution that worked.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

  1. a PC can have a maximum of 4 physical hdd without additional controller cards, but CD/DVD/ZIP drives diminish the count as they are counted as a hdd.

That was true in the 90’. But later many mainboards came with that additional controller onboard (often a “Promise” one), which doubled the number of IDE devices. Nowadays mainboard have one IDE port with 2 channels (mainboards with 2 IDE ports are becoming very rare) and at least 4 sata ports (more often 5 or 6).

I eventually had a computer guy come over and we decided to delete the Recovery and HP_TOOLS partitions (/dev/sda3 and /dev/sda4) and to resize the /dev/sda2 partition (all of which, by the way, you can do from Windows 7). SuSE then partitioned properly and the machine works.
Thank you all for your help.

With the HP-TOOLS partition, I would have had a close look at what it contains, then either imaged it first, or copied the needed data.

With the “Recovery” partition I would have checked it, and I suspect I would have imaged it.

That of course, assumes you may want to recover windows at a later date, (Unless you have install disks).

You only needed to delete one of these to create the extended partition.

  1. Maximum number of partitions per drive is technically 1 primary 3 extended and 15 logical in each extended for a maximum of 49 using ide/eide/sata/pata and in the case scsi drives 1 primary 3 extended and 31 logical per extended for a maximum of 97. For external USB drives, follow the sata spec for maximum.

Can you point me to the doc’s on this? I have that found 4 primaries, one of which needs to be an extended primary, allows me to use as many partitions as I am likely to want.

@ Carlos .E .R
In response to this,

> Imaging the disk is never a bad idea, Always save anything you
> need…
>
> Having said that, what you want to do is not difficult, (certainly if
> you have done it just once before, it is simple.)

To me, it is - I no longer know windows tricks, I have been using linux instead for several years. I
just keep a copy of windows because I need it for somethings, like updating my phone, perhaps fired
once a month.

> By the way, many of the computers that do not come with a windows
> install disk offer some method of ‘imaging’ the installed OS.

Yes, mine has. But the recovery procedure deletes everything and leaves the disk as it originally
came. I think it has a configuration file, but I did not try to do so to leave space for another
partition. I had to create my own recovery procedure, that doesn’t touch linux partitions.

I made a post here, but then deleted it, You basically explained the reason for deleting, (although the post itself was OK, I felt not that helpful.)

On 2010-08-27 05:06, techwiz03 wrote:

> 5) Maximum number of partitions per drive is technically 1 primary 3
> extended and 15 logical in each extended for a maximum of 49 using
> ide/eide/sata/pata and in the case scsi drives 1 primary 3 extended and
> 31 logical per extended for a maximum of 97. For external USB drives,
> follow the sata spec for maximum.

Eummmm… no.

Max number is 4 primaries, of which one can be an extended partition. This one can contain an
unlimited number of logical partitions (it is a linked list).

It might be possible to create 2 or 3 (or even 4) extended partitions, but operating systems do not
allow that. Linux doesn’t. Only one.

Now, the number of logical partitions is unlimited, with respect to the definition. However,
operating systems do have limits. In Linux, with the traditional hda, hdb, hdc scheme, the limit is
63 partitions per disk (ie, hda0 up to hda63). For the sda, sdb, sdc scheme the limit is 16
partitions per disk (ie: sda0 up to sda15).

The limits are imposed simply because the /dev directory structure contains “device nodes” with a
major and minor numbers, both integers, IIRC.

/usr/src/linux/Documentation/devices.txt

8 block SCSI disk devices (0-15)
0 = /dev/sda First SCSI disk whole disk
16 = /dev/sdb Second SCSI disk whole disk
32 = /dev/sdc Third SCSI disk whole disk

240 = /dev/sdp Sixteenth SCSI disk whole disk

Partitions are handled in the same way as for IDE
disks (see major number 3) except that the limit on
partitions is 15.

A number of bits in the minor number is used to designate the partition, and other bits designate
the letter.

Recently there has been an addition to the kernel, so that since oS 11.2 we have effectively an
unlimited number of partitions. This derives from using a dynamic /dev tree (udev). This, by the
way, is a SUSE/Novell contribution - and I know this because I was one of the chaps insistently
requesting this feature (specifically, more logical partitions than 16 total -> ie 11 logical)

> 6) a PC can have a maximum of 4 physical hdd without additional
> controller cards, but CD/DVD/ZIP drives diminish the count as they are
> counted as a hdd.

Not exactly.

4 parallel-ata.

Many more if using serial ata. My current desktop has 7 connected at this moment, with several free
slots yet.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))