"unable to get device for partition 1"

MoxProxxer

Well-Known Member
Apr 25, 2018
86
37
58
54
Hi.

After h t t p s: // www .youtube.com/watch?v=z-q1WhZUICQ suggested pve 5.0 works out of the box on a C3000 based Atom system (they used a Supermicro platform) with eMMC, I tried my luck with the Gigabyte MA10-ST0 mainboard (h t t p s : //b2b.gigabyte.com/Server-Motherboard/MA10-ST0-rev-11#ov)

Unfortunately I constantly get said error, and details show

h t t p s: //i.imgur.com/nTm4tud.png

However, the eMMC is ok, I tested it completely with dd, not a sign of i/o error.

I'll try Debian for now, but it would ofc be nice if Proxmox would work "out of the box".

edit:

Debian 9.4 installed - went quite smooth.

edit2:

To clarify, I tried PVE 5.1 3rd release.
 
Last edited:
LOL - so after almost one year, I retried with PVE 5.3 2nd release

Same problem so I search da internetz and behold: I find my unanswered writeup here.

:thumbsup:

Maybe next year then.
H52QqlM.png
 
And by "enhancement" you certainly mean another mud puddle in get_partition_dev? (a pitty this forum doesn't allow for Perl syntax hilit)


Code:
sub get_partition_dev {
    my ($dev, $partnum) = @_;

    if ($dev =~ m|^/dev/sd([a-h]?[a-z]\|i[a-v])$|) {
    return "${dev}$partnum";
    } elsif ($dev =~ m|^/dev/[hxev]d[a-z]$|) {
    return "${dev}$partnum";
    } elsif ($dev =~ m|^/dev/[^/]+/c\d+d\d+$|) {
    return "${dev}p$partnum";
    } elsif ($dev =~ m|^/dev/[^/]+/d\d+$|) {
    return "${dev}p$partnum";
    } elsif ($dev =~ m|^/dev/[^/]+/hd[a-z]$|) {
    return "${dev}$partnum";
    } elsif ($dev =~ m|^/dev/nvme\d+n\d+$|) {
    return "${dev}p$partnum";
    } else {
    die "unable to get device for partition $partnum on device $dev\n";
    }

}

like this?

Code:
sub get_partition_dev {
    my ($dev, $partnum) = @_;

    if ($dev =~ m|^/dev/sd([a-h]?[a-z]\|i[a-v])$|) {
	return "${dev}$partnum";
    } elsif ($dev =~ m|^/dev/[hxev]d[a-z]$|) {
	return "${dev}$partnum";
    } elsif ($dev =~ m|^/dev/[^/]+/c\d+d\d+$|) {
	return "${dev}p$partnum";
    } elsif ($dev =~ m|^/dev/[^/]+/d\d+$|) {
	return "${dev}p$partnum";
    } elsif ($dev =~ m|^/dev/[^/]+/hd[a-z]$|) {
	return "${dev}$partnum";
    } elsif ($dev =~ m|^/dev/mmcblk\d+p\d+$|) {      # tadaaaa "Enhancement"
	return "${dev}$partnum";
    } elsif ($dev =~ m|^/dev/nvme\d+n\d+$|) {
	return "${dev}p$partnum";
    } else {
	die "unable to get device for partition $partnum on device $dev\n";
    }

}

So if you make a nice PVE 5.3 3rd release with this fixed, I will show you how I would have written that code.
 
Good News Everyone! I managed to install Proxmox on top of a Debian 9.8 on this machine, so all is well.

Well, ... except for the weird position of the proxmox team to software Raid "https://pve.proxmox.com/wiki/Software_RAID" - which is the exact opposite of currently (like 5 years ago) adopted best practices.

https://www.freenas.org/blog/freenas-worst-practices/

So yeah, use ZFS instead of hardware raid, but in case you do not want to use ZFS, you should be able to use the fine Linux mdadm. Now I know I can do it manually, but it seems Proxmox doesn't like/detect /dev/md* devices and certainly doesn't help to set them up out of the box.

Maybe again something for enhancement.

So given that, my question would be why Proxmox storage subsystem doesn't handle storage devices by uuid or somesuch in the first place?

You know: /dev/disk/by-*
 
So if you make a nice PVE 5.3 3rd release with this fixed, I will show you how I would have written that code.
Hi MoxProxxer,
contributions from the community are always welcome! So if you have some code for us and want to improve PVE, simply follow the guidelines at https://pve.proxmox.com/wiki/Developer_Documentation and send us your patches. That's the magic of open source software projects :).
 
That's the magic of open source software projects :).

Funny, I used that formulation in the 90ies. Which is the era some of the Proxmox Perl code seems to be from. Any chance to make anonymous contributions?

edit:

To make it clear - the Perl code may not be very shiny, but it gets the job done obviously. I do like Proxmox a lot. Unfortunately the entity CLA is a no go. I am aware it's based on the Harmony CLA, but in my humble opinion the paragraph about patent license is a complete f**up.

If I am not mistaken, Proxmox GmbH needs a CLA to make sure the contributions can be used by Proxmox - now or in future - without any license/IP claims. What the Entity CLA does is not only ensure this right, but also grabbing any patents the contributing entity may have now or in future and open them for own monetization.

This is like "If you want to give us a a piece of ham, please sign this agreement that you will not charge us for it or revoke that gift. Oh and by the way, also grant us the right to breed and sell any golden-egg laying geese you may have now or in future."

I wonder how many companies have signed that CLA.
 
Last edited:
On proxmox 8 the same trick works as well but the file is /usr/share/perl5/Proxmox/Sys/Block.pm :)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!