Skip to content

Conversation

@jgronowski
Copy link

In function find_unused_disks() there is a potential bug.
In some situation message from the fdisk about GPT support is delayed:

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

This affecting possibility to do awk on the specific disks

following code:

fdisks=$(fdisk -l |& awk '/^Disk .* bytes/{print $2}' |sort)

can be replaced with

(fdisk -l 2>/dev/null | awk '/^Disk .* bytes/{print $2}' |sort)

In function find_unused_disks() there is a potential bug.
In some situation message from the fdisk about GPT support is delayed:

> WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

This affecting possibility to do awk on the specific disks

following code:

`fdisks=$(fdisk -l |& awk '/^Disk .* bytes/{print $2}' |sort)`

can be replaced with

`(fdisk -l 2>/dev/null | awk '/^Disk .* bytes/{print $2}' |sort)`
@edwbuck
Copy link

edwbuck commented Jan 22, 2021

Redirecting standard error out of the awk command is the right thing to do. We need to probably process STDERR in the long run, but at least this prevents it from creating other failures.

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