samatild/LinuxAiOPerf

script execution may hang on parted -l

Closed this issue · 0 comments

while collecting general data, the bash script may hang if parted detects any disk errors:

Disk /dev/sdb: ---
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      ---kB  ---  ---  ext4         primary



                                                                          

                                                                          
Fix/Ignore? 

                                                                          
Fix/Ignore? ^C

A ctrl+C will make the bash script to continue.

A possible fix would be to replace

    parted -l 2>/dev/null >> "$outputdir/parted-l.txt"

with

parted --script -l 2>&1 >> "$outputdir/parted-l.txt"

This will ensure that parted doesn't prompt for user input and any error messages or warnings will also be appended to the parted-l.txt file.

Fix Targeted for upcoming release