Unable to add new Physical Volumes - Error creating partition on /dev/vda (Too many primary partitions.)

Has anyone got any ideas on what has caused this error?

Error creating partition on /dev/vda: Failed add partition to device ‘/dev/vda’ (Too many primary partitions.)

sounds like the disk could be in MBR that is limited to 4 primary partitions

Hi @markareait

For one, why are you trying to further partition a disk which has already more than 4 partitions?
Second, why are you trying to change the installed system?

→ These questions are needed, as you don’t seem to understand that any Intel / AMD / ARM system using MBR is limited to 4 primary partitions…

If a forth partition is created, it must be an “Extended Volume”, which is the case here.
NethServer is NOT designed for this (But it CAN work, IF you KNOW what you’re doing, which is what I doubt here!). The GUI, as I assume, can’t handle this!!!

Besides which, I’m reading about a “virtual Disk”, yet NOT ONE WORD about virtualization from your side!!! Not what system you’re using, nada!

Not even a word on what version of Nethserver you’re trying to run (or break!).

Very BAD !!!

Please stop acting like a PITA, and people (including me) may help you out…

Note:

Our motto here is:
The only dumb questions are those NOT asked!!!

However, AFAIK, all of us here are not mind-readers, so it’s up to you to provide info on what you’re trying to do, and on what environment.
This is, after all, the NethServer forum, we can support that.
We can’t and won’t support ANY & Every computer system, and HAL is def. not supported here!

Note 2:

If running on a virtual system, the solution is to enlarge the partition after enlarging the disk, this takes a couple of minutes only. The solution is NOT to add in new partitions ad absurdum!

My 2 cents
Andy

1 Like

I see a bare metal restore in the future. Or a partition resize.

Thanks Marc, I was thinking it would have been GPT, been awhile since working with MBR in my works. Pity the error message did not mentioned MBR.

It looks like a bare metal restore will be needed.

Marc would know -

  1. I had a look and I did not see, but is it an option on install Neth with GPT instead of MBR ?
  2. If so, would you know why GPT is not used by default in Neth ?

Hi Michael,

Sure looks that way.

Thanks

Well Andy,

It would also seem to me that you did not receive the pictures at your end that I attached to the post.

FYI - This Server is hosted on a VPS and I they provision more space by allocating another drive not growing existing drives. Painful

I see have to boot the Neth install iso/ disk via gpt

Why this needs more than 4 primary partitions?

OK. This was the issue / fix -

XFS -
The VPS provider does grow the KVM Disks. NethServer GUI does not support XFS expansion. Instead the new space shows as a new drive and the GUI only option was to mount new drive to use the space.

MBR vs GPT -
It did not occur to me to start off with that MBR was being used instead of GPT and it was the reason for that error.

By the way Andy thought I was misleading but in PM with Andy I explained -
I think some of the miscommunications was referring to “Physical Volumes” which I was referencing to where I was trying to add the spare space to via NethServer GUI, not that fact it was a Physical drive or a Virtual Drive I was adding. Years ago that was the only way I saw how to in the GUI to add the extra space, and it worked until now.

Andy shared below which is the correct way to expand a XFS -

Under the Proxmox GUI:

  1. Click on the NS7-VM > Hardware > Hard Disk (xxx) > Resize disk > 1500

On the NS7 Console:

  1. fdisk /dev/sda > p > d > 2 > n > p > 2 > First sector > Last sector w
  2. reboot the server If you get this:

WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8)

  1. pvresize /dev/sda2
  2. lvresize -l +100%FREE /dev/VolGroup/lv_root
  3. xfs_growfs /dev/VolGroup/lv_root

Finished! Not really needed, but a Reboot and check is not a bad idea…

Note: This method will work for almost all known VM virtualizations, including VMWare, XEN, VirtualBox, Hyper-V - at least on the NethServer side.

I have tested the above on a test Proxmox and it all works well.

It would be great if some of these nuggets of information could be in the GUI error codes or help notes on the config page. Even just a note saying xfs expansion not support see forum “xfs expansion”.

I had different experience… I also installed LVM management on cockpit.

Edit: I extended the partition after extending via gParted the XFS filesystem. But several years passed and probably i don’t remember all details.

Hi @pike

Both of these tools are NOT part of NethServer, nor part of the cockpit GUI.

NethServer does have the command to enlarge the XFS partition, but no GUI for this.

So, this remains valid:

NethServer GUI / Cockpit does not support XFS expansion

My 2 cents
Andy