Skip to content

Conversation

@glance-
Copy link
Contributor

@glance- glance- commented Oct 4, 2024

I run lvm with pv's on un-partitioned disks.

Unless I ignore this error code here, the searching for labels fails setup-storage.

With this it works as expected, but it's not all that pretty.

The whole error handling from FAI::execute_ro_command is sort of sus, because the error handleing happens directly in that function, so when it detects a warning, it should just warn, and ignore the result.

With this I get:
(CMD) parted -sm /dev/sdb unit B print 1> /tmp/SY_fQFB0P0 2> /tmp/QOgCOzFBVU Executing: parted -sm /dev/sdb unit B print
(STDERR) Error: /dev/sdb: unrecognised disk label
(STDOUT) BYT;
(STDOUT) /dev/sdb:4096805658624B:scsi:512:512:unknown:ATA Samsung SSD 860:; Ignoring error parted_3_2

And the relevant information can be parsed from that.

I run lvm with pv's on un-partitioned disks.

Unless I ignore this error code here, the searching for labels fails
setup-storage.

With this it works as expected, but it's not all that pretty.

The whole error handling from FAI::execute_ro_command is sort of sus,
because the error handleing happens directly in that function, so when
it detects a warning, it should just warn, and ignore the result.

With this I get:
(CMD) parted -sm /dev/sdb unit B print 1> /tmp/SY_fQFB0P0 2> /tmp/QOgCOzFBVU
Executing: parted -sm /dev/sdb unit B print
(STDERR) Error: /dev/sdb: unrecognised disk label
(STDOUT) BYT;
(STDOUT) /dev/sdb:4096805658624B:scsi:512:512:unknown:ATA Samsung SSD 860:;
Ignoring error parted_3_2

And the relevant information can be parsed from that.
@glance- glance- marked this pull request as draft October 4, 2024 13:24
@glance-
Copy link
Contributor Author

glance- commented Oct 4, 2024

This is more of a case showing the issue rather then a final solution to the problem. I guess most (all?) returned errors from FAI::execute_ro_command can be just ignored.

@Mrfai
Copy link
Contributor

Mrfai commented Jun 12, 2025

To me it also seems that we could ignore the errors from execute_ro_command. But it would make some following code obsolete, which makes sure the disk has a disk label. I really fear to break other configs if we just ignore this error, since we do not have many testcases for all different sort of partitioning.

For me the usage of unpartitioned disks in LVM is more a rare case, so currently I do like to include your patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants