Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip invalid disk drives (zero sized, no media) when saving layout #3047

Merged
merged 4 commits into from
Sep 13, 2023

Commits on Sep 13, 2023

  1. Move "parted $devname" after validation of $devname

    This prevents errors when parted is called on an invalid device.
    pcahyna committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    3ba1f96 View commit details
    Browse the repository at this point in the history
  2. Validate disk when saving layout

    Introduce function is_disk_valid, which performs checks for disk
    usability beyond validating the device name. In some cases the device
    name may be valid, but there are no data, typically because it is a
    drive with removable media and there is no medium in the tray. Happens
    typically with card (e.g. SD card) readers with empty slot.
    
    This is a normal occurrence, so do not Error out, only display a message
    and skip the device.
    pcahyna committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    808b15a View commit details
    Browse the repository at this point in the history
  3. Revert "Update 200_partition_layout.sh"

    This reverts commit 0a1d634.
    
    We now skip disks with no data (like when there is no medium), so
    incomplete disk entries (without partition type) should not occur
    anymore. Restore the code that aborted when such disks were encountered.
    Incomplete entries should not be allowed to occur, as they could confuse
    the layout restoration code. Moreover, the layout restoration wipes
    all disks in the layout, so if during layout restoration there happens
    to be a medium in the drive that was empty during layout save, the data
    on the medium would get overwritten and lost. And if there is not medium,
    the layout recreation script would fail.
    
    See the discussion at rear#2958 (comment)
    pcahyna committed Sep 13, 2023
    Configuration menu
    Copy the full SHA
    cfe34a4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    db191aa View commit details
    Browse the repository at this point in the history