LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to partition a computer to accommodate three or more distros? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-partition-a-computer-to-accommodate-three-or-more-distros-4175538944/)

herakles_14 04-06-2015 04:14 PM

how to partition a computer to accommodate three or more distros?
 
Hey,

My PC has 298 GB of which approximately 179 GB is unallocated. The remaining estimated 119 GB is being used by two distro's: PCLinuxOS and Manjaro 0.8.12

When I have tried to add a new distro, having plenty of free space, I usually get a message telling me I can not proceed further due to my having four primary partitions.

I have a Swap partition of sufficient size to handle multiple distros almost 10 GB.

I installed PCLOS first and then Manjaro. I gave each approximately 12 GB for their 'Root' (/) Their Home (/home) partition was roughly 40 GB each.

{/dev/sda1 swap /dev/sda2 Extended (/dev/sda5, dev/sda6) "PCLinuxOS" /dev/sda3. /dev/sda4 "Manjaro 0.8.12"

For /dev/sda 5 & 6 I used 'Reiserfs' file system. For /dev/sda 3 & 4, I used Ext4.}

The way I look at it my root and home partitions are 'primary' thus taking up the four primary allowed. I seem ti either recall or seen somewhere, that beside 'Primary there was something called 'Logical'

Starting with PCLinux as a base could I make a new installation of Manjaro where (/) would be Primary and (/home) would be Logical?

Or would I need to start totally over with fresh installs of both Manjaro ant PCLinux?? Then make (/) primary and (/home) logical?

Would such a move allow me to install additional distros?

A thought could I make the changes in Gparted while keeping the distros as they are, just making the changes [primary & logical?]

TIA

herakles_14

thorkelljarl 04-06-2015 05:00 PM

Extended...

The way around the four primary partition limit is to use one of the four to make an extended partition in which you can have many logical partitions.

You can begin from the beginning and format the whole HDD as an extended partition with many logical partitions and probably as many linux distributions installed as you like.

There are many guides on how to do this, but if you have already used all of your four primary partitions, you will at least have to change one of your linux installations to free up one partition to use for your extended partition.

http://www.tldp.org/LDP/sag/html/partitions.html

Timothy Miller 04-06-2015 05:06 PM

Yup, I'd do a primary partition as swap (as it will be shared between all distro), then do an extended partition with logical partitions for / of each distro you want to run. You can, if you like, also do a single partition for /home so that all your settings carry over from 1 distro to the next, although no idea if that's something you want to do or not.

yancek 04-06-2015 06:19 PM

You might be able to do it but it depends upon where the "free space" is. If the information in your initial post is accurate, you have a primary partition as swap, the second primary is the extended and the other two primary partitions are the manjaro partition. sda5 and sda6 are logical partitions inside the Extended partition, sda2 so if you have space inside sda, you could create logical partitions there.

Primary partitions in Linux are numbered 1-4 and logical begin with 5. Run the command below as root to get the needed info.

Code:

parted /dev/sda print all

Shadow_7 04-06-2015 07:56 PM

I tend to boot linux from USB. For $30 you can get 3x SDHC cards and put a distro on each. Alternatively you can choose a main distro and chroot to the others in directories, not partitions. Or go the VM route. Lots of options.

sgosnell 04-06-2015 09:54 PM

To expand slightly on the above, the limitation of 4 primary partitions is due to MBR limitations. If you use GPT partitioning, you can have as many primary partitions as you like. It's possible to change MBR to GPT, but it's not entirely straightforward. MBR is on its last legs, and probably won't last much longer. UEFI and GPT are taking over the computer world, for valid reasons. Your choices are to either use logical partitions or to switch to GPT.

herakles_14 04-07-2015 05:59 PM

Thanks to all who have taken the time to help me with this issue.

sqosnell;

If I were inclined to switch from the MBR set up to GPT, how would I do it? You said the change was not straight forward, is that another way of telling me it is somewhat convoluted in changing from MBR over to GPT?

Shadow 7;

Is this SDHC card you mention another name for a 'flash drive or flash stick"? If so I have not had the best of luck trying to put a distro on such a device. I have a 16GB 'flash drive on which could be placed a distro. Providing I can figure out how to do it? I know of 'unetbootin' I have PCLinuxOS and I do not believe it plays nice with it, unetbootin.

Yancek;

Here is what I came up with "parted /dev/sda print all"

"[root@mithradates menelaos]# parted /dev/sda print all
Model: ATA WDC WD3201ABYS-0 (scsi)
Disk /dev/sda: 320GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 32.3kB 10.7GB 10.7GB primary linux-swap(v1)
2 10.7GB 69.6GB 58.9GB extended
5 10.7GB 25.8GB 15.1GB logical reiserfs
6 25.8GB 69.6GB 43.8GB logical reiserfs
3 69.6GB 82.4GB 12.8GB primary ext4 boot
4 82.4GB 128GB 46.0GB primary ext4


thorkelljarl;

When you speak of removing one of my distros, do you mean the complete removal of said distro then the installation of that distro as a 'logical' extended?

sgosnell 04-07-2015 10:08 PM

http://www.rodsbooks.com/gdisk/index.html

http://www.rodsbooks.com/gdisk/mbr2gpt.html

Note especially the recommendation about backing up the mbr, and the instructions on how to do that.

Since you already have logical and extended partitions on the disk, you can just use gparted to make more logical partitions.

herakles_14 04-08-2015 02:26 AM

Thanks for the links. I'll go over them carefully.

johnsfine 04-08-2015 07:31 AM

If you don't want to reinstall, you can move partitions in order to make the unpartitioned space usable for new partitions.

You currently have sda1, sda3 and sda4 as primary partitions, with sda2 as an extended partition containing logical partitions sda5 and sda6. I don't think you made the location of the unallocated space clear, but I assume it is physically after sda4.

In order to create new partitions, the unallocated space must be inside your extended partition (sda2).

First (running in a mode in which sda4 is not mounted) you must move sda4 to the physical end of the drive.
Second (running in a mode in which sda3 is not mounted) you must move sda3 to right before sda4.
Third (running in a mode in which neither sda5 nor sda6 is mounted) you must expand sda2 to include the unallocated space.

Then you will be able to create new partitions.

Each of those steps is easy in any GUI partitioning tool. The only trick is not having those partitions mounted while doing it. If you boot from a USB, CD or DVD "live" Linux, then it is easy to do all those steps in quick sequence with all those partitions unmounted. If you instead boot from your installed linux systems on sda, I think you can dance around the conflicts by rebooting a few times and running different copies of the GUI partitioning tool for each step. But that is at least harder and maybe I misunderstood some detail making it impossible.

Quote:

The way I look at it my root and home partitions are 'primary' thus taking up the four primary allowed. I seem ti either recall or seen somewhere, that beside 'Primary there was something called 'Logical'

Starting with PCLinux as a base could I make a new installation of Manjaro where (/) would be Primary and (/home) would be Logical?
You were confused about what "primary" and "logical" mean when you wrote that. You also seemed to be confused about the significance of primary and logical in Linux. Linux does not care about whether any of its partitions are primary.

You just need to satisfy the rules of the partitioning scheme (or start over with GPT, but I see no point to that):
sda1 through sda4 can each be anywhere on your hard drive. But all partitions sda5 and higher, must be inside the extended partition.

The ones inside the extended partition are called "logical" partitions.

Depending on which document's terminology you choose, the "primary" partitions are either all of sda1 through sda4 or all of those except the extended partition. That is only a terminology question (is the "extended" partition also called a "primary" partition). Regardless of terminology, the extended partition must be one of sda1 through sda4 and each primary partition must be one of sda1 through sda4 and every other partition must be inside the extended partition.

So your problem (as I described earlier) is that your unallocated space is outside the extended partition, but you need to create sda7 etc. inside the extended partition.

The error message expresses the problem from the less practical viewpoint: Your unallocated space is outside the extended partition, so it could be used only to create one of sda1 through sda4. But all those already exist, so your unallocated space cant be used.

yancek 04-08-2015 08:44 AM

Viewing the information you posted from the Parted command, the suggestions by johnsfine above should work. The major problem I see is the fact that for some reason, you have a separate boot partition near the end of the disk and the boot partition is one which will need to be moved. GParted is pretty easy to use and gives a good visual representation of what will be happening so is usually a bit easier to use. From the GParted manual, the following quote

Quote:

f the partition is an operating system boot partition, then the operating system might not boot after the move operation is applied.
The link below is to the section of the GParted Manual on moving partitions:

http://gparted.org/display-doc.php?n...move-partition

If you were booting from Grub on PCLinux, you would not have this problem since there would be no need to move either of its partitions.

johnsfine 04-08-2015 09:14 AM

Quote:

Originally Posted by yancek (Post 5344382)
the boot partition is one which will need to be moved.

I'm not sure about each version of grub, whether it simply survives that kind of move or whether it needs to be reconfigured after the move.

If the next step after moving partitions were to install a third distro and if you let that third distro installer default to installing its own copy of grub and doing os scanning to find and include previous linuxes in its menu, then the question of whether the partition moving broke the previous grub doesn't even matter.

But if you want to keep the previous copy of grub active (and add the third distro to the menus of the previous grub, which is trickier) then you ought to know the commands for reconfiguring the grub you are now using and you might need to give the appropriate command after moving the partition, before the hard drive can be booted again.

Before either moving partitions or installing a third OS, it is generally wise to review online instructions for repairing whatever version of grub you are using (assuming, like me, you don't have those commands memorized already).

Shadow_7 04-09-2015 07:45 AM

Quote:

Originally Posted by herakles_14 (Post 5344062)
Shadow 7;

Is this SDHC card you mention another name for a 'flash drive or flash stick"? If so I have not had the best of luck trying to put a distro on such a device. I have a 16GB 'flash drive on which could be placed a distro. Providing I can figure out how to do it? I know of 'unetbootin' I have PCLinuxOS and I do not believe it plays nice with it, unetbootin.

The SDHC card is what you put in camcorders and such, what the earlier models of the raspberry pi use and such. You will need a card reader that is bootable (not all are). You may have a card reader built into your machine already. I use these cards over "sticks" because most sticks are sooooo slow in the I/O that you will not have a good experience. You basically treat the cards like you would a USB HDD. You can even put grub in the MBR of said cards, although you might need to -f (force) it to get it there.

If you already have linux and are familiar with it, then it's kind a neat route to take. These cards do have limited writes so it's not all roses, but it can get you up and running and help rescue a system or two on the cheap. They also tend to use less power and put off less heat than an HDD, so there's perks there as well. The "sticks" use even less power, but the I/O is so slow on those that you'll buffer on disk writes trying to watch a 360p youtube video. Which will likely consume 50% or more of the experience and even cause your browser to crash. A class 6 or higher SDHC card is decent enough on the speed to be in the realmn of acceptability.

sgosnell 04-09-2015 09:48 AM

IME there is no real difference in speed between USB flash drives and SD cards, because they both use the USB interface. Under the hood, SD card readers are USB devices. There is a difference between individual cards or flash drives, of course, and you want to get a faster device if possible. The cheaper the drive or card is, the slower it usually is. Performance does have a cost.

The partitioning scheme the OP has is rather unusual, and I'm not entirely sure how that came about, but I expect it just grew like Topsy, and was never planned at all. It's possible to make exact copies of each partition using dd, wipe the drive entirely, and use a better partitioning scheme, then restore everything using dd again. The swap partition doesn't need to be backed up at all, of course. The time and effort to do this might be more than one is willing to expend, though. That's something no one else can decide.

herakles_14 04-13-2015 02:59 AM

Hey,

i am sorry it has taken me so long to get back with all of you, after the time you took out of your own schedules to help me.

The partition set up was planned, sgosnell, it just did not come out that way.

Okay, johnsfine, You said,

"First (running in a mode in which sda4 is not mounted) you must move sda4 to the physical end of the drive.
Second (running in a mode in which sda3 is not mounted) you must move sda3 to right before sda4.
Third (running in a mode in which neither sda5 nor sda6 is mounted) you must expand sda2 to include the unallocated space.

Then you will be able to create new partitions."

As far as I can recall at no time during the partitioning of either my PCLOS or my Manjaro did I click on or check a box to mount anything. I went over he instructions for moving partitions, provided by, 'yancek', I was hesitant to try to move 'sda4' in the manner you suggested.

I took a screenshot of my gparted set up and had intended to post it here, but when I tried the image came out exceedingly small and difficult to make out pertinent factors. So here is the 'Set up': sda1 is Swap, sda2 is Extended and under its umbrella are sda5 and sda6, which are the Root and Home partitions for PClinuxOS. sda3 is the Root partition for Manjaro, and sda4 is the Home partition for Manajo. The unallocated space is without an 'sda' indication. For an unknown reason at the end of sda4 is 'boot'.

You tell me to move sda4 to the physical end of the drive. Do you mean to the end of the 'unallocated space'? Then follow stuit with sda3, to have it close to sda4. In both cases they should be unmounted.

Running in a Mode where sda5 & sda6 are mounted, I am to expand sda2 to encompass the unallocated space.

I believe to do what you ask, I would need to do part of it while using 'gparted' on PCLOS and the other art while I am using 'gparted' on Manjaro. A least that is my solution, or whatever.

On moving sda3 & sda4, could I right click and while holding the 'right button down 'drag' the partition to the end of the 'unallocated space'. Then do the same for sda3?

I am still unclear on how to expand sda2 to include all of the unallocated space.Would it be a similar 'drag & drop' move I suggested for sda3 & sda4 moves?

sgosnell, for the time being i think i will leave the MBR as it is until I better understand how to change to 'GPT'.


All times are GMT -5. The time now is 05:09 PM.