#3096 Issue open: Device nvme0n1 is designated as write-protected (needs manual configuration)

ramzcode opened issue at 2023-12-01 09:44:

RearR Version 2.7
Amazon Linux 2023

Trying to recover on a different New VM, but the error looks not clear. Not sure which and why write protection is triggered by.

Log:
Relax-and-Recover 2.7 / Git
Running rear recover (PID 1612 date 2023-12-01 07:10:35)
Using log file: /var/log/rear/rear-ip-172-31-23-140.log
Sourcing additional configuration file '/etc/rear/local_f.conf'
Running workflow recover within the ReaR rescue/recovery system
Using backup archive '/mcsquare-backups//ip-172-31-23-140/backup.tar.gz'
Calculating backup archive size
Backup archive size is 703M /mcsquare-backups/2023-11-30-1415-F.tar.gz (compressed)
Comparing disks
Device nvme0n1 is designated as write-protected (needs manual configuration)
Switching to manual disk layout configuration (GiB sizes rounded down to integer)
/dev/nvme0n1 had size 8589934592 (8 GiB) but it does no longer exist
Original disk /dev/nvme0n1 does not exist (with same size) in the target system
No device found where to /dev/nvme0n1 could be mapped so that it will not be recreated
Current disk mapping table (source => target):
There is no valid disk mapping
Currently unmapped disks and dependant devices will not be recreated
(unless identical disk mapping and proceeding without manual configuration):
/dev/nvme0n1 /dev/nvme0n1p1 /dev/nvme0n1p127 /dev/nvme0n1p128 fs:/ fs:/boot/efi
Confirm or edit the disk mapping

  1. Confirm disk mapping and continue 'rear recover'
  2. Confirm identical disk mapping and proceed without manual configuration
  3. Edit disk mapping (/var/lib/rear/layout/disk_mappings)
  4. Use Relax-and-Recover shell and return back to here
  5. Abort 'rear recover'
    (default '1' timeout 300 seconds)
    1
    User confirmed disk mapping
    Disk /dev/nvme0n1 and all dependant devices will not be recreated
    Disabling component 'disk /dev/nvme0n1' in /var/lib/rear/layout/disklayout.conf
    Disabling component 'part /dev/nvme0n1' in /var/lib/rear/layout/disklayout.conf
    Disabling component 'fs ... /' in /var/lib/rear/layout/disklayout.conf
    Disabling component 'fs ... /boot/efi' in /var/lib/rear/layout/disklayout.conf
    Trying to automatically resize last partition when disk size changed
    Confirm or edit the disk layout file
  6. Confirm disk layout and continue 'rear recover'
  7. Edit disk layout (/var/lib/rear/layout/disklayout.conf)
  8. View disk layout (/var/lib/rear/layout/disklayout.conf)
  9. View original disk space usage (/var/lib/rear/layout/config/df.txt)
  10. Use Relax-and-Recover shell and return back to here
  11. Abort 'rear recover'
    (default '1' timeout 300 seconds)
    1
    User confirmed disk layout file
    Confirm or edit the disk recreation script
  12. Confirm disk recreation script and continue 'rear recover'
  13. Edit disk recreation script (/var/lib/rear/layout/diskrestore.sh)
  14. View disk recreation script (/var/lib/rear/layout/diskrestore.sh)
  15. View original disk space usage (/var/lib/rear/layout/config/df.txt)
  16. Use Relax-and-Recover shell and return back to here
  17. Abort 'rear recover'
    (default '1' timeout 300 seconds)
    1
    User confirmed disk recreation script
    Disks to be completely overwritten and recreated by /var/lib/rear/layout/diskrestore.sh:

Determining disks to be wiped ...
Disks to be wiped:

  1. Confirm disks to be wiped and continue 'rear recover'
  2. Skip wiping disks and continue 'rear recover'
  3. Use Relax-and-Recover shell and return back to here
  4. Abort 'rear recover'
    (default '1' timeout 300 seconds)
    1
    User confirmed disks to be wiped
    Start system layout restoration.
    Disk layout created.
    Recreated storage layout:
    NAME KNAME TRAN TYPE FSTYPE LABEL SIZE MOUNTPOINTS
    /dev/nvme0n1 /dev/nvme0n1 nvme disk 8G
    `-/dev/nvme0n1p1 /dev/nvme0n1p1 nvme part vfat RESCUE SYS 208M
    Confirm the recreated disk layout or go back one step
  5. Confirm recreated disk layout and continue 'rear recover'
  6. Go back one step to redo disk layout recreation
  7. Use Relax-and-Recover shell and return back to here
  8. Abort 'rear recover'
    (default '1' timeout 300 seconds)
    1
    User confirmed recreated disk layout
    ERROR: No filesystem mounted on '/mnt/local'. Stopping.
    Use debug mode '-d' for some debug messages or debugscript mode '-D' for full debug messages with 'set -x' output
    Aborting due to an error, check /var/log/rear/rear-ip-172-31-23-140.log for details
    Exiting rear recover (PID 1612) and its descendant processes ...
    Running exit tasks

ramzcode commented at 2023-12-01 09:47:

@jsmeix #3085 is it similar ?

Below is my source and Target lsblk output

[root@ip-172-31-23-140 ec2-user]# lsblk -ipo NAME,KNAME,MODEL,LABEL,SERIAL
NAME KNAME MODEL LABEL SERIAL
/dev/nvme0n1 /dev/nvme0n1 Amazon Elastic Block Store vol08d513eb795332479
|-/dev/nvme0n1p1 /dev/nvme0n1p1 /
|-/dev/nvme0n1p127 /dev/nvme0n1p127
`-/dev/nvme0n1p128 /dev/nvme0n1p128

lsblk -ipo NAME,KNAME,MODEL,LABEL,SERIAL
NAME KNAME MODEL LABEL SERIAL
/dev/nvme0n1 /dev/nvme0n1 Amazon Elastic Block Store vol0137277f9301125a4

ramzcode commented at 2023-12-01 10:04:

2023-12-01 10:01:33.438658037 Comparing disks
2023-12-01 10:01:33.464107877 /dev/nvme0n1 is designated as write-protected by ID 0542b474-6b5e-46d2-9f87-570007c622df
2023-12-01 10:01:33.469293825 Comparing nvme0n1
2023-12-01 10:01:33.471975543 Device /sys/block/nvme0n1 exists
2023-12-01 10:01:33.494742225 /dev/nvme0n1 is designated as write-protected by ID 0542b474-6b5e-46d2-9f87-570007c622df
2023-12-01 10:01:33.497510059 Device nvme0n1 is designated as write-protected (needs manual configuration)
2023-12-01 10:01:33.500627451 Switching to manual disk layout configuration (GiB sizes rounded down to integer)
2023-12-01 10:01:33.503512531 /dev/nvme0n1 had size 8589934592 (8 GiB) but it does no longer exist
2023-12-01 10:01:33.509138763 Including layout/prepare/default/270_overrule_migration_mode.sh
2023-12-01 10:01:33.516431627 Including layout/prepare/default/300_map_disks.sh
2023-12-01 10:01:33.571478999 /dev/nvme0n1 is designated as write-protected by ID 0542b474-6b5e-46d2-9f87-570007c622df
2023-12-01 10:01:33.574510577 Cannot use /dev/nvme0n1 (same name and same size 8589934592) for recreating /dev/nvme0n1 (/dev/nvme0n1 is write-protected)
2023-12-01 10:01:33.582048735 Could not automap /dev/nvme0n1 (no disk with same size 8589934592 found)
2023-12-01 10:01:33.590285211 Original disk /dev/nvme0n1 does not exist (with same size) in the target system
2023-12-01 10:01:33.613069834 /dev/nvme0n1 is designated as write-protected by ID 0542b474-6b5e-46d2-9f87-570007c622df
2023-12-01 10:01:33.615970005 /dev/nvme0n1 excluded from device mapping choices (is designated as write-protected)
2023-12-01 10:01:33.618799102 No device found where to /dev/nvme0n1 could be mapped so that it will not be recreated
2023-12-01 10:01:33.625054708 Current disk mapping table (source => target):
There is no valid disk mapping
2023-12-01 10:01:33.634579896 Currently unmapped disks and dependant devices will not be recreated
(unless identical disk mapping and proceeding without manual configuration):
/dev/nvme0n1 /dev/nvme0n1p1 /dev/nvme0n1p127 /dev/nvme0n1p128 fs:/ fs:/boot/efi


[Export of Github issue for rear/rear.]