#2652 Issue closed: Various segfaults 'chroot /mnt/local ... some_program ...'

Labels: support / question, no-issue-activity

cvijayvinoth opened issue at 2021-07-09 10:39:

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"): Relax-and-Recover 2.6 / Git

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):
OUTPUT=ISO
BACKUP=RSYNC
RSYNC_PREFIX="diskimage_${HOSTNAME}"
OUTPUT_URL=rsync://diskimage@xxxx::rsync_backup
BACKUP_URL=rsync://diskimage@xxxx::rsync_backup
BACKUP_RSYNC_OPTIONS+=(-z --progress )
ISO_DIR="/var/www/html/imageBackup/iso/$HOSTNAME"
MESSAGE_PREFIX="$$: "
PROGRESS_MODE="plain"
AUTOEXCLUDE_PATH=( /tmp )
PROGRESS_WAIT_SECONDS="1"
export TMPDIR="/var/www/html/imageBackup/iso/"
PXE_RECOVER_MODE=automatic
ISO_FILES=("/var/www/html/imageBackup/rsync")
ISO_PREFIX="${HOSTNAME}"
ISO_DEFAULT="automatic"
  • Hardware (PC or PowerNV BareMetal or ARM) or virtual machine (KVM guest or PoverVM LPAR):
    virtual machine

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
    x86 compatible

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
    BIOS and GRUB

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    local disk

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,SIZE,MOUNTPOINT" or "lsblk" as makeshift):

NAME        MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
loop0         7:0    0 29.9M  1 loop  /snap/snapd/8542
loop1         7:1    0   55M  1 loop  /snap/core18/1880
loop2         7:2    0 71.3M  1 loop  /snap/lxd/16099
loop3         7:3    0 32.3M  1 loop  /snap/snapd/12398
loop4         7:4    0 55.5M  1 loop  /snap/core18/2074
loop5         7:5    0 67.6M  1 loop  /snap/lxd/20326
sda           8:0    0  100G  0 disk
├─sda1        8:1    0    1M  0 part
└─sda2        8:2    0  100G  0 part
  └─md0       9:0    0  100G  0 raid1
    ├─md0p1 259:1    0   10G  0 part  /
    ├─md0p2 259:2    0    5G  0 part  /boot
    ├─md0p3 259:3    0   50G  0 part  /home
    ├─md0p4 259:4    0   10G  0 part  [SWAP]
    └─md0p5 259:5    0   25G  0 part  /var
sdb           8:16   0  100G  0 disk
├─sdb1        8:17   0    1M  0 part
└─sdb2        8:18   0  100G  0 part
  └─md0       9:0    0  100G  0 raid1
    ├─md0p1 259:1    0   10G  0 part  /
    ├─md0p2 259:2    0    5G  0 part  /boot
    ├─md0p3 259:3    0   50G  0 part  /home
    ├─md0p4 259:4    0   10G  0 part  [SWAP]
    └─md0p5 259:5    0   25G  0 part  /var
sdc           8:32   0   10G  0 disk
└─sdc1        8:33   0   10G  0 part
  └─md1       9:1    0   20G  0 raid0
    └─md1p1 259:0    0   20G  0 part  /mnt/vijay
sdd           8:48   0   10G  0 disk
└─sdd1        8:49   0   10G  0 part
  └─md1       9:1    0   20G  0 raid0
    └─md1p1 259:0    0   20G  0 part  /mnt/vijay
sr0          11:0    1 1024M  0 rom
  • Description of the issue (ideally so that others can reproduce it):
chroot /mnt/local /bin/bash --login -c 'grub-install /dev/sda

throws Segmentation fault error

  • Workaround, if any:

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files):
    raid0.txt

jsmeix commented at 2021-07-14 08:27:

When chroot /mnt/local some_program segfaults
it segfaults within the restored system
i.e. with and within the files of the original system
that have been restored from the backup.
When something segfaults within the restored files of the original system
it is usually not an issue in ReaR but an issue within the restored system
or even an issue within the original system e.g. think about something
went wrong on the original system so that there 'some_program' would segfault
and you save and restore this broken state then 'some_program' would also
segfault within the restored files.

To debug it you can after "rear recover"
change into the restored system via

chroot /mnt/local

and debug things within the restored system.

jsmeix commented at 2021-07-14 08:41:

There are 6 Segmentation fault in your
https://github.com/rear/rear/files/6790691/raid0.txt

# grep -2 'Segmentation fault' raid0.txt

++ '[' -r /proc/mdstat -a -r /mnt/local/etc/mdadm/mdadm.conf -a -x /mnt/local/usr/share/mdadm/mkconf ']'
++ chroot /mnt/local /bin/bash --login -c '/usr/share/mdadm/mkconf >/etc/mdadm/mdadm.conf'
/usr/share/rear/finalize/Debian/i386/550_rebuild_initramfs.sh: line 61:  7037 Segmentation fault      chroot $TARGET_FS_ROOT /bin/bash --login -c "/usr/share/mdadm/mkconf >/etc/mdadm/mdadm.conf"
++ LogPrint 'WARNING:
Could not update /etc/mdadm/mdadm.conf with the new MD array information.
--
++ test -d /mnt/local/boot/grub
++ chroot /mnt/local /bin/bash --login -c 'grub-mkconfig -o /boot/grub/grub.cfg'
/usr/share/rear/finalize/Linux-i386/660_install_grub2.sh: line 70:  7098 Segmentation fault      chroot $TARGET_FS_ROOT /bin/bash --login -c "$grub_name-mkconfig -o /boot/$grub_name/grub.cfg"
++ LogPrintError 'Failed to generate boot/grub/grub.cfg in /mnt/local - trying to install GRUB2 nevertheless'
++ Log 'Failed to generate boot/grub/grub.cfg in /mnt/local - trying to install GRUB2 nevertheless'
--
++ Print 'Found possible boot disk /dev/sda - installing GRUB2 there'
++ chroot /mnt/local /bin/bash --login -c 'grub-install /dev/sda'
/usr/share/rear/finalize/Linux-i386/660_install_grub2.sh: line 139:  7178 Segmentation fault      chroot $TARGET_FS_ROOT /bin/bash --login -c "$grub_name-install $bootdisk"
++ LogPrintError 'Failed to install GRUB2 on possible boot disk /dev/sda'
++ Log 'Failed to install GRUB2 on possible boot disk /dev/sda'
--
++ Print 'Found possible boot disk /dev/sdb - installing GRUB2 there'
++ chroot /mnt/local /bin/bash --login -c 'grub-install /dev/sdb'
/usr/share/rear/finalize/Linux-i386/660_install_grub2.sh: line 139:  7229 Segmentation fault      chroot $TARGET_FS_ROOT /bin/bash --login -c "$grub_name-install $bootdisk"
++ LogPrintError 'Failed to install GRUB2 on possible boot disk /dev/sdb'
++ Log 'Failed to install GRUB2 on possible boot disk /dev/sdb'
--
++ chroot /mnt/local /bin/bash --login -c 'grub-install /dev/sda
/dev/sdb'
/usr/share/rear/finalize/Linux-i386/660_install_grub2.sh: line 139:  7292 Segmentation fault      chroot $TARGET_FS_ROOT /bin/bash --login -c "$grub_name-install $bootdisk"
++ LogPrintError 'Failed to install GRUB2 on possible boot disk /dev/sda
/dev/sdb'
--
++ chroot /mnt/local /bin/bash --login -c 'grub-install /dev/sda
/dev/sdb'
/usr/share/rear/finalize/Linux-i386/660_install_grub2.sh: line 139:  7355 Segmentation fault      chroot $TARGET_FS_ROOT /bin/bash --login -c "$grub_name-install $bootdisk"
++ LogPrintError 'Failed to install GRUB2 on possible boot disk /dev/sda
/dev/sdb'

github-actions commented at 2021-09-13 02:10:

Stale issue message


[Export of Github issue for rear/rear.]