#3399 PR merged: Further enhance 880_check_for_mount_by_id.sh

Labels: enhancement, fixed / solved / done

jsmeix opened issue at 2025-02-12 13:57:

In finalize/default/880_check_for_mount_by_id.sh
only when what is mounded 'by-id' does not exist
as block device on the replacement hardware,
then alert the user because then he may have to
adapt his TARGET_FS_ROOT/etc/fstab, see
https://github.com/rear/rear/issues/3383#issuecomment-2652966699

jsmeix commented at 2025-02-12 14:08:

On my original system
(same as in https://github.com/rear/rear/pull/3391)
I have in /etc/fstab

/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00001  /DVD  iso9660 defaults  0  0

When I have the same on my replacement VM
I get no longer an

Automatically adjusting /dev/disk/by-id entries in etc/fstab is not supported

alert as intended according to
https://github.com/rear/rear/issues/3383#issuecomment-2652966699

When I run "rear recover" in MIGRATION_MODE
I can change that in the restored /mnt/local/etc/fstab
after the backup was restored e.g. to

/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00002  /DVD  iso9660  defaults  0  0

and the I get when proceeding "rear recover"

Automatically adjusting /dev/disk/by-id entries in etc/fstab is not supported:
  Check /mnt/local/etc/fstab and manually adjust /dev/disk/by-id entries
  as needed to the actual values of the recreated system in /mnt/local
  Those /dev/disk/by-id entries are no block devices in the recreated system
  /dev/disk/by-id/ata-QEMU_DVD-ROM_QM00002
  'scsi_id' reports '/dev/sr0' 84MiB: ID_VENDOR=QEMU ID_MODEL=QEMU_DVD-ROM ID_SERIAL=1ATA_QEMU_DVD-ROM_QM00001 
  'scsi_id' reports '/dev/sr1' 1023MiB: ID_VENDOR=QEMU ID_MODEL=QEMU_DVD-ROM ID_SERIAL=1ATA_QEMU_DVD-ROM_QM00003

For this test I have on my replacement VM now
two QEMU_DVD-ROM virtual devices

RESCUE localhost:~ # ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Feb 12 14:30 ata-QEMU_DVD-ROM_QM00001 -> ../../sr0
lrwxrwxrwx 1 root root 9 Feb 12 14:30 ata-QEMU_DVD-ROM_QM00003 -> ../../sr1

jsmeix commented at 2025-02-12 14:30:

On my replacement VM with

RESCUE localhost:~ # ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Feb 12 15:22 ata-QEMU_DVD-ROM_QM00001 -> ../../sr0
lrwxrwxrwx 1 root root 9 Feb 12 15:22 ata-QEMU_DVD-ROM_QM00003 -> ../../sr1

while "rear recover" in MIGRATION_MODE
I changed the restored /mnt/local/etc/fstab to (excerpt)

/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00001  /DVD1  iso9660  defaults  0  0
/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00002  /DVD2  iso9660  defaults  0  0
/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00003  /DVD3  iso9660  defaults  0  0
/dev/disk/by-id/ata-QEMU_DVD-ROM_QM00004  /DVD4  iso9660  defaults  0  0

and got

Automatically adjusting /dev/disk/by-id entries in etc/fstab is not supported:
  Check /mnt/local/etc/fstab and manually adjust /dev/disk/by-id entries
  as needed to the actual values of the recreated system in /mnt/local
  Those /dev/disk/by-id entries are no block devices in the recreated system:
  /dev/disk/by-id/ata-QEMU_DVD-ROM_QM00002
  /dev/disk/by-id/ata-QEMU_DVD-ROM_QM00004
  'scsi_id' reports '/dev/sr0' 84MiB: ID_VENDOR=QEMU ID_MODEL=QEMU_DVD-ROM ID_SERIAL=1ATA_QEMU_DVD-ROM_QM00001 
  'scsi_id' reports '/dev/sr1' 1023MiB: ID_VENDOR=QEMU ID_MODEL=QEMU_DVD-ROM ID_SERIAL=1ATA_QEMU_DVD-ROM_QM00003

[Export of Github issue for rear/rear.]