-1

a while ago, I asked a question about partitions and it was recommended to me to create an extended partition to install my Linux on.

However, it seems like I cannot just create extended partition from the unallocated space since it has no data.

So I'd like to ask how can I do it, so that in the installation I can just start creating needed partitions in the extended partition. Is it possible to just create a small bit of data and make it the 90GB extended partition on which I will install the Linux?

EyfI
  • 115
  • Uh, that's the only way to create an extended partition, it is basically just a container for more partitions and can only be created in unallocated space. – Bobby May 18 '16 at 19:39
  • Oh! But how can I do it? I saw that you can do it in the windows disk manager, but I do not have that option there. – EyfI May 18 '16 at 19:40
  • Ugh, no idea how to do it there, never saw that tool. Maybe use a Live-CD with gparted? – Bobby May 18 '16 at 19:41
  • Okay. I guess one article confused me, because someone said that you can only extend an existing partition with the unallocated space. I'll use the booting usb stick to load the 'demo' version of Linux and see if I can work it out. – EyfI May 18 '16 at 19:48
  • All logical partitions must be "inside" the extended partition. You may just create several logical partitions and it will then include the extended. But you can only have one extended partition and it counts as one of the 4 primary allowed partitions. So all logical partitions must be next to each other so in the one extended. – oldfred May 18 '16 at 20:47

2 Answers2

1

So, here are some basics on partitioning:

But before changing partitions: BACKUP YOUR DATA !!!
No joke: BACKUP YOUR DATA !!!

For MBR disks I would advise "Easeus Partition Master" (freeware; my long time favourite) for Windows – which is far better and flexible than those Windows tools – or GParted for Linux which is (also) approved and robust. But there is a small difference:
Easeus PM does not care about cylinder boundaries, which is generally OK. But there is a little tricky workaround to manage that. The point on that is, that sometimes when resizing/moving partitions a small piece of unallocated space remains between two neighbour partitions.
My experience with GParted is quite small, but as far as I remember, it follows those cylinder boundaries to keep compatibility with some OS's. Nevertheless it accepts partitions that are not placed within these boundaries.

On an MBR disk you can simply add a new partition and decide/select whether it shall be a primary or logical partition. Latter one will automatically be embedded into an expanded extended partition – if possible (read on).

An MBR disk is only capable of carrying 4 primary partitions. The trick is that one of these (only one!) can be an extended partition which itself just serves as a container for logical partitions.

With elder fdisk programs you will have to add an extended partition prior to adding a logical one. But with modern GUI tools like Easeus PM, Windows Volume Manager or GParted you just need to select – while adding – if you want to add a primary (if still available) or logical partition. In latter case the underlying extended partition will ether be added or expanded.

I would advise to use primary partitions just for boot (marked as active), swap and OS volumes. But OS volumes nowadays (since Win2k) don't need to be on primary partitions as long as there is a boot manager (GRUB/BCD) on a primary one which can be quite tiny (~50-100 MB).
On factory-side pre-installed Windows hard disks you most likely already will have such a 100MB partition at the beginning of the disk. Here the Windows boot manager (BCD) and the recovery console resides.

For additional Linux installation the GRUB can be put here too but not necessarily. Be aware, that installing GRUB on this partition will overwrite the MBR (the BCD stays intact and will be called from GRUB). The trouble is in this case you cannot edit the BCD any more unless you repair it (overwrite the MBR again which next time overrides GRUB).
I would recommend to install GRUB to the Linux system partition. But in this case you need to study BCD programming to add Linux to the BCD. This is quite tricky and weird.
I strongly recommend to thoroughly plan changes on partitions before installing new OS's, because it can be quite dangerous changing Windows system partitions – of course unless you REALLY know what you're doing.

Anyway, back to partitioning: you cannot split extended partitions. So if you have e.g. a partitions order P-E-P-U (U=unallocated) you cannot go and add an extended partition in the unallocated disk space. In such a case you can

  • (complicated way) IF the E partition contains just one L partition, copy that L partition into the U space as a P partition (if it fits), delete the source E/L, move the second P direct next to the first one, transform the copied P into a L (optional: expand E to the left, and move L left, next to the second P) and add a new L into the U space. This will (further) expand E.

  • (easy way) Transform the last P partition into a L (which again expands E automatically) and add a new L into the U space.

-- Note: copying partitions can take a lot of time, depending on their data size!
-- Note: the system (life) partition(s) (= partitions which are in use by the system) cannot be changed while the system is in use. Changes are being stored as jobs which will be executed during the next boot. Therefore (under Windows) the partitioning program needs to be installed.
-- WARNING: any operation in progress MUST NOT be interrupted or a complete loss of the partition can occur!!!
-- Note: Moving partitions by copying and deleting the source should not be done in a single session. Do this in two session. If something goes wrong while copying you will still have the original partition.

If you want to use new partitions with both Windows and Linux I strongly recommend to format it with NTFS under Windows. Linux is capable of reading and writing NTFS but Windows is not even able to recognize Linux type partitions (reiser, ext2/3/4, etc.) – not even their boundaries. Here you must be careful under Windows: it claims these partitions as (continuously) unallocated space!
Do not believe Windows! Windows is mean! [:smirk:]

If you have a GPT type disk, be careful: you must not change the boot partition (at beginning), the mirror/backup partition (at end) and the Windows partition! On the last point I am not really sure, but I once did that on a system with one big continuous partition and after that the system was damaged and had to be low level partitioned! That was more than just embarrassing …
But I guess if you already have unallocated space it should work without problems as GPT disks don't have this 4 primary partitions limit.

Howsoever, for compatibility reasons I recommend MBR disks as GPT disks are quite difficult to handle. M$ just wants to force users to only use (and buy) their products, so they make things as complicated as can be for that no one will understand how to deal with it. On MBR – of course with a piece of skills and a disk editor – you can edit/adjust the MBR itself if needed. But honestly: DON'T DO THAT AT HOME, KIDS !!! ;-)

Ah, one last thing before you start:

BACKUP YOUR DATA !!!

You will wimp like a sissy if you loose them …

Jens
  • 183
  • 11
  • The thing is, I cannot really use primary partitions for swap, boot and OS volumes. I already have three partitions: 1) tagged 'recovery', taking up 12GB 2) tagged 'recovery' and 'active', taking 100MB and 3) the C: in Windows. So I'd have to create all the Linux stuff in the extended partition. Adding to that, in your post you don't say how the actual extended partition is created, only logical one. Is it created automatically when I create a logical partition? – EyfI May 18 '16 at 21:49
  • Yes, it will be automatically generated. In more rudimentary fdisk programs you will have to add an extended partition prior to adding a logical one. But with Easeus as well as the Windows tools this is done automatically.
    For your Linux partition you can add a logical partition and install Linux there. during installation you will be asked where to install the boot manager (GRUB2). You should install this to your 100 MB system reserved partition. Here also the Windows BCD resides.
    – Jens May 18 '16 at 22:04
  • And what about the primary partitions? If I have everything Linux-related in the extended partition, will it somehow affect the performance compared to having it on a primary? – EyfI May 18 '16 at 22:06
  • Windows is the only one that has to boot from a primary partition. You can even have a second install of Windows in a logical partition as it really boots from primary NTFS with boot flag or first install. Linux will boot fine from logical partitions. And you do not need nor rarely require a separate /boot partition. Default install is just / (root) and swap which is fine for new users. Bit more advanced is a separate /home. I also suggest a separate NTFS data partition, but you cannot do that as part of install. Before or after you can create NTFS if you have space. – oldfred May 18 '16 at 22:09
  • The difference in performance is extremely minimal.
    A more relevant question is, where on the disk the partitions should be. If you put a partition to the beginning of the disk it is very much faster than at the end of a disk.
    This effect is much more relevant than the question of P or L partition.
    – Jens May 18 '16 at 22:11
  • @oldfred: Since Windows 2k the system doesn't need to be installed on a primary partition any more as long as the boot manger is on one. – Jens May 18 '16 at 22:14
  • @Eyfl: If you install the GRUB into your 100MB partition it will overwrite the MBR. That means your system boots with the GRUB and not with the Windows boot manager. But it is still on this volume though not booted. Actually that doesn't harm Windows (I have this done myself), except if you want to change something in the BCD. This won't work until you reinstall BCD, which again overwrites GRUB. You must decide which boot manager you want to use! Besides: GRUB will be updated with every system update, but it will automatically add/update the Windows boot. – Jens May 18 '16 at 22:21
  • @Eyfl: If you take 10-12 GB for Linux this should suit most of your needs. Take the rest for a Swap partition (=size of RAM), maybe a 4GB Linux /home partition where you also can put such space monsters like Firefox and Thunderbird or other Java programs and one or two NTFS data partitions. Remember to put a Swap partition as close as possible to the beginning of the disk. – Jens May 18 '16 at 22:30
0

OK. I could take a lot of confusion from the later comments.

First of all: DON'T DELETE ANY OF YOUR REMAINING PARTITIONS !!!
It was already unnecessary to delete the data partition as you will need it back again.

Your picture shows that you most likely have a legacy/MBR HDD setting.

The first partition keeps the Windows recovery copy and hardware tools backup. This is typically for pre-installed Windows systems and you will need it for Windows system repairs and/or re-installations of Windows. You could move this one to the end of the disk (as a logical partition), but Windows is quite grumpy on that and again this step needs more skills to help Windows finding it back (Note: don't just do it without recording its GUID !!! – if needed I can help on that). Actually I think it is really stupid to put this one at the beginning of a HDD because it is nearly never needed and consumes the best performance place on the disk.
The second partition is typically used as boot partition (marked "active") with the Windows Boot Manager (BCD) and the recovery console (an emergency Windows repair environment) installed.
And your third partition is of course your Windows OS system partition (always "C:"). I presume you moved your data there as it is also unnecessarily huge.

For your needs and partition situation you only can add an extended partition with logical ones inside (in this order):

  • Linux Swap (type: SWAP – size of your RAM, but at least 4GB – that should suit most of anybody's needs)
  • Linux OS / Lubuntu (type: ext4 – ~10-12 GB)
  • if you like you can add an extra ext4 data/programs partition ("/home") for security issues (~ 4GB)
    This way you can keep personal data and program settings if you have to overwrite Lubuntu.
  • additional data partition (type: NTFS – size rest of the disk)
    This is also needed for security/backup/recovery issues: If something goes wrong with "C:" your data are safe here!

The NTFS partitions can also be used by Linux OS's. Unfortunately the SWAP and extX ones will be "invisible" for Windows (s.a.)

To add those Linux partitions you will need to add them under Linux/Lubuntu (with GParted as described) as Windows – and therefore any Windows tool – is unable to format anything else but M$ partition types (FAT12/FAT16/VFAT/FAT32/NTFS)! On the other hand it is the best way to format these partition under Windows.
So use your Lubuntu Life CD to configure the partitions (including NTFS – but format it later under Windows 7) as described.

But the real pain – after installation of an additional non-Windows OS – is to get the Windows Boot Manager (BCD) back to work! You won't come around to step through 2 (both) boot managers each boot to the "foreign" OS!

As you have just one HDD AND you have to install Lubuntu into an unbootable logical partition, dual boot becomes quite difficult and you should follow these steps:

During installation of Lubuntu you will be asked where to install GRUB (or what ever Lubuntu's boot manager is). You will have to install it to the boot partition (your 2nd 100MB one) as your new Lubuntu partition is a logical one and therefore not bootable.

Trouble is that installing GRUB here overwrites the boot sector so that Windows isn't able to find its BCD which then cannot be modified further more if needed.

But during installation of GRUB (and later after kernel updates) it will search your HDD's for other OS's and add them automatically to the boot menu. Here it should find back BCD on the mentioned boot partition and add it.

Now your first boot manager is GRUB. From here you can select "Windows 7" which then (should) start the Windows Boot Manager which then boots Windows 7.

There is another way, but this is much more complicated and as long as you do not need to repair Windows it will work. In latter case – to shorten this – use Lubuntu and ask me again ;-)

Jens
  • 183
  • 11
  • Thank you! This clears up a lot of things that I was worried about. I will get into it in a few hours and get back to you with how it went. I hope that the GRUB installation will work out, because that seems to be rather crucial :D – EyfI May 19 '16 at 14:50
  • Good luck and remember with GParted you will probably (not really sure about that) have to add an extend prior to logical partition. If you like, I can lead you later through the steps of moving your 1st partition to the end of the disk as a logical one. But that is much work to do. – Jens May 19 '16 at 15:12
  • Reporting in mid-installation. I created the logical partitions as you said (only chose a bit different sizes), you can see those in the second picture. In the first are the Windows ones and I'm wondering if the boot selection at the bottom is the one where I should choose the 100MB partition from Windows. So, did I do everything right so far and should I choose the sda2 at the bottom? https://imgur.com/a/3k8kH – EyfI May 19 '16 at 16:50
  • Also, how will Lubuntu know that it should install in the sda6 partition? – EyfI May 19 '16 at 17:03
  • Ok, I guess you mean the dropdownbox with "/dev/sda" selected. Yes, this is where to install the boot loader (that means to the MBR of the disk) as you just have this disk. Otherwise at next boot time BCD would start (currently in the MBR) and you cannot access Lubuntu. But in the meantime I came to the point that it might be less problematic for Windows (and its updates!) to leave BCD (/dev/sda2) as the primary boot manager or rather repair it later after installing Lubuntu. … – Jens May 19 '16 at 19:28
  • That would mean, that you should select /dev/sda6 to install Lubuntu (installer will know from "/" but you should be asked again as far as I remember) and later during installation process you'll be asked to select where you want to install GRUB2. Here – regarding to my latest considerations – you should better select to root device ("/"). This makes things a little bit easier later under Windows on repairing BCD and adding a new entry for Lubuntu (with EasyBCD under Windows). But BEFORE: you must have the repair console installed or at least a Windows installation CD/DVD. … – Jens May 19 '16 at 19:29
  • You will not come around to repair the MBR for the use of Windows later on. – Jens May 19 '16 at 19:29
  • I'm a bit confused now. What should I select in the dropdown menu and later on then? I thought you can't boot from logical partitions. And I don't have a Windows CD. – EyfI May 19 '16 at 19:32
  • Sorry, me Jack of all trades and master of none ;-) Yes, you can't boot from logical partitions (sda6) . Therefore GRUB is loaded in several stages. First it starts with the boot loader in the MBR (=master boot record – sda) or PBR (=partition boot record – sda2). This calls the rest of GRUB (/boot/*) where ever you like it to be: ether on the boot partition (sda2) or on the system partition (sda6). … – Jens May 19 '16 at 20:35
  • Actually the only difference is, that if you install GRUB to sda2 as a "GRUB-central" you could later reuse this GRUB for additional Linux installations and don't have to deal with each OS's own boot manager. The point is, the MBR has to be overwritten by GRUB to being able to boot to Lubuntu while installing. Though you will be able now to boot to Windows too, but you won't be able to run Windows updates. For doing this, Windows needs its own boot loader in the MBR – which means you'll have to fix it after installing Lubuntu. – Jens May 19 '16 at 20:36
  • Okay so if I install grub on sda2, the only problem I'll have with Windows is that I won't be able to update? I wouldn't mind that since I don't update it anyway... – EyfI May 19 '16 at 20:38
  • Well if you don't have a Windows CD it will become quite difficult to fix the MBR. I'll have to check this out … – Jens May 19 '16 at 20:42
  • LOL … in this case everything's fine. But you really shouldn't underestimate the necessities of Windows updates. Oh, I forgot: there should be a repair mode during Windows boot (after pressing F8). This will replace the need of an installation CD. – Jens May 19 '16 at 20:44
  • Well, if everything goes well with Lubuntu, I'll be using Windows just for occasional games. Thanks for the help, time to progress with the installation after like 3 hours :D – EyfI May 19 '16 at 20:46
  • And regarding the repair mode, I read that poking into the mbr can make it fail. – EyfI May 19 '16 at 20:52
  • Allright! Managed to boot into Lubuntu and then in Windows as well. It's late so I'll explore tomorrow :D Thank you very much for the help! – EyfI May 19 '16 at 21:26
  • You should never touch the MBR manually. What I wrote below was just a little boasting [:grin:]. So leave it to some tools like Windows' bcdedit that really know what to do here. It is safe to let Windows repair itself. Don't worry about that. Windows is mean but never to itself. So, good night and good luck ;-) – Jens May 19 '16 at 21:41