0

This is how my partitions look like. They were created in a very lame way I admit:) Partitions

My primary goal here is to be able to have another primary partition for 3rd OS but for this I need to do something as I unwisely created /home partition as primary.

Most likely I will remove and re-create swap and windows partitions (reinstalling windows).

So the only way how to achieve this is for me to somehow change sda2 partition to logical. I don't mind doing anything except reinstalling Linux on sda1 and losing data on `sda2.

What are my options here? Is it for example possible to remove everything except sda1 and sda2 then somehow clone sda2to the new logical partition of newly created extented partition?

  • Are you sure you need an extended partition? The laptop I am using here has 9 partitions, none extended. It came with 7 partitions, courtesy of W8, and I found no difficulty using parted to add two more for Ubuntu and Swap. – AFH Jul 14 '14 at 21:33
  • 2
    @AFH you are likely using GPT partitioning. The above is MSDOS partitioning, so only supports four primary partitions. – Paul Jul 15 '14 at 4:34
  • @Paul - you may well be right: I have never needed to investigate on this machine. In which case LeNoob needs either to convert to GPT (if each OS supports it) or to save a partition by using a swap file instead of a swap partition (unless there is a need to hibernate): /dev/sda4 can be moved to the end of the disc, and /dev/sda3 can then be recreated to fill all the available space. – AFH Jul 15 '14 at 18:08
4

You can convert primary to logical and vice-versa using my FixParts program. Many Linux distributions provide it in the gdisk or gptfdisk package; the command name is fixparts. There are some caveats, though; namely, you need to have at least one free (unallocated) sector immediately preceding every to-be-logical partition. It's unclear if you've got such a free sector before your current /dev/sda2. If not, the safest way to create such a gap is to use GParted to shrink /dev/sda1 (that's /dev/sda1, not /dev/sda2) by the smallest amount possible -- probably 1MiB. That will open a gap between /dev/sda1 and /dev/sda2, which will enable FixParts to convert /dev/sda2 from primary to logical. Note that you'll need to do all of this (or at least the GParted operations) from a live CD; GParted won't let you operate on partitions that are currently mounted, as /dev/sda1 must be if you boot from it.

|improve this answer|||||
2

You have room to move /home back into root.

sudo mkdir /home2
sudo rsync -ax /home/ /home2/
sudo umount /home  (you'll need to boot as single user to do this)
sudo rmdir /home
sudo mv /home2 /home 

Then edit /etc/fstab so that it doesn't mount /home

Then you can delete /dev/sda2 and re-create it as an extended partition. Note that if the third OS is linux or similar, it doesn't need to be in a primary partition. Grub can boot it from a logical.

|improve this answer|||||
1

It seems to me that what you need to do is just:

  • create a new partition from unallocated space
  • install a new OS in there
  • optionally. repair GRUB and MBR if the 3rd OS is Windows, which more than likely will overwrite MBR with putting only itself to the boot option.
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.