#473 Issue closed: Grub isn't Setup on Debian 7.6 ?

Labels: enhancement, waiting for info, won't fix / can't fix / obsolete

Reiner030 opened issue at 2014-10-13 16:10:

Hello,

after restore process from actual github version of today I got following error:

Patching '/proc/3335/mounts' instead of 'etc/mtab'
Installing GRUB2 boot loader

WARNING ! For this system
Debian/7.6 on Linux-i386 (based on )
there is no code to install a boot loader on the recovered system or the code
that we have failed to install the boot loader correctly.

Please contribute this code to the Relax-and-Recover project. To do so
please take a look at the scripts in /usr/share/rear/finalize,
for an example you can use the script for Fedora (and RHEL/CentOS/SL) in
/usr/share/rear/finalize/Fedora/i386/20_install_grub.sh

--------------------  ATTENTION ATTENTION ATTENTION -------------------
|                                                                     |
|          IF YOU DO NOT INSTALL A BOOT LOADER MANUALLY,              |
|                                                                     |
|          THEN YOUR SYSTEM WILL N O T BE ABLE TO BOOT !              |
|                                                                     |
-----------------------------------------------------------------------

You can use 'chroot /mnt/local bash --login' to access the recovered system.
Please remember to mount /proc before trying to install a boot loader.


Finished recovering your system. You can explore it under '/mnt/local'.

btw the referenced file Fedora/i386/20_install_grub.sh isn't available anymore ;)

But I have

# find /usr/share/rear/finalize -type f  -name "*grub*"
/usr/share/rear/finalize/Linux-i386/22_install_grub2.sh
/usr/share/rear/finalize/Linux-i386/21_install_grub.sh

and also

# find /usr/share/rear/finalize -type f -regex ".*/\(Debian\|Fedora\)/.*"
/usr/share/rear/finalize/Debian/i386/17_rebuild_initramfs.sh
/usr/share/rear/finalize/Fedora/i386/17_rebuild_initramfs.sh

Is there an option or so to debug this problem to find the reason?

Reiner030 commented at 2014-10-13 20:17:

ah, perhaps this is this reason: https://github.com/rear/rear/issues/137 ?

# df -lh .
Filesystem                                              Size  Used Avail Use% Mounted on
/dev/disk/by-uuid/61049f32-02db-407f-9c3e-dc67e3cfbcd2   12G  6.4G  4.5G  59% /

gdha commented at 2014-10-15 14:48:

@Reiner030 thank you for notifying about our comment (need to correct this). The uuid reference? Is this the case on your system in the grub.conf?

gdha commented at 2014-10-16 10:03:

@Reiner030 can you try again with latest updates?

Reiner030 commented at 2014-10-16 20:00:

Tested now with VM build by: https://gist.github.com/Reiner030/4b602289320f3c2ed4e7
(and used this repository for this check)

BackendException: ssh connection to 192.168.10.41:22 failed: Unknown server 192.168.10.41

=> /root/.ssh/known_hosts is missing
=> manually ssh connected/hostkey accepted
=> manually called "rear recover"

2014-10-16 19:28:57 Running 'finalize' stage
2014-10-16 19:28:57 Including finalize/default/01_prepare_checks.sh
2014-10-16 19:28:57 Including finalize/default/10_populate_dev.sh
2014-10-16 19:28:57 Including finalize/GNU/Linux/15_migrate_disk_devices_layout.sh
2014-10-16 19:28:57 Including finalize/GNU/Linux/15_migrate_uuid_tags.sh
2014-10-16 19:28:57 Including finalize/GNU/Linux/16_rename_diskbyid.sh
device node not found
device node not found
2014-10-16 19:28:57 Including finalize/Debian/i386/17_rebuild_initramfs.sh
/usr/share/rear/finalize/Debian/i386/17_rebuild_initramfs.sh: line 18: /mnt/local/etc/initramfs-tools/modules: No such file or directory
mount: none already mounted or /mnt/local/proc busy
mount: according to mtab, none is already mounted on /mnt/local/proc
Available versions:  3.2.0-4-amd64
Execute: /usr/sbin/update-initramfs -u -k "3.2.0-4-amd64" -b /boot -v
Keeping /boot/initrd.img-3.2.0-4-amd64.dpkg-bak
update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64
/usr/sbin/mkinitramfs: 66: .: Can't open /etc/initramfs-tools/initramfs.conf
Removing /boot/initrd.img-3.2.0-4-amd64.dpkg-bak
update-initramfs: failed for /boot/initrd.img-3.2.0-4-amd64 with 2.
2014-10-16 19:28:57 WARNING !!!
initramfs creation failed, please check '/var/log/rear/rear-rear-test.log' to see the error
messages in detail and decide yourself, wether the system will boot or not.

2014-10-16 19:28:57 Including finalize/Linux-i386/21_install_grub.sh
2014-10-16 19:28:57 Including finalize/Linux-i386/22_install_grub2.sh
2014-10-16 19:28:57 Installing GRUB2 boot loader
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
Auto-detection of a filesystem of /dev/sda1 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/mnt/local/boot/grub/device.map" --target=fs -v /mnt/local/boot/grub" to <bug-grub@gnu.org>
chroot: failed to run command `grub2-install': No such file or directory
2014-10-16 19:28:58 Including finalize/Linux-i386/23_run_efibootmgr.sh
2014-10-16 19:28:58 Including finalize/GNU/Linux/30_create_mac_mapping.sh
2014-10-16 19:28:58 Including finalize/GNU/Linux/41_migrate_udev_rules.sh
diff: /mnt/local//etc/udev/rules.d/70-persistent-cd.rules: No such file or directory
2014-10-16 19:28:58 Updating udev configuration (70-persistent-cd.rules)
cp: cannot stat `/mnt/local//etc/udev/rules.d/70-persistent-cd.rules': No such file or directory
cp: cannot create regular file `/mnt/local//etc/udev/rules.d/70-persistent-cd.rules': No such file or directory
2014-10-16 19:28:58 ERROR: Could not copy '/etc/udev/rules.d/70-persistent-cd.rules' -> '/mnt/local//etc/udev/rules.d/70-persistent-cd.rules'
=== Stack trace ===
Trace 0: /bin/rear:249 main
Trace 1: /usr/share/rear/lib/recover-workflow.sh:34 WORKFLOW_recover
Trace 2: /usr/share/rear/lib/framework-functions.sh:81 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:42 Source
Trace 4: /usr/share/rear/finalize/GNU/Linux/41_migrate_udev_rules.sh:33 source
Trace 5: /usr/share/rear/lib/_input-output-functions.sh:132 StopIfError
Message: Could not copy '/etc/udev/rules.d/70-persistent-cd.rules' -> '/mnt/local//etc/udev/rules.d/70-persistent-cd.rules'
===================
2014-10-16 19:28:58 Running exit tasks.
2014-10-16 19:28:58 Finished in 255 seconds
2014-10-16 19:28:58 Removing build area /tmp/rear.gy3u8C5UuL2L3DD
rmdir: removing directory, `/tmp/rear.gy3u8C5UuL2L3DD'
2014-10-16 19:28:58 End of program reached

Diagnose Grub:

RESCUE rear-test:~ # /usr/sbin/grub-probe --device-map="/mnt/local/boot/grub/device.map" --target=fs -v /mnt/local/boot/grub 
/usr/sbin/grub-probe: info: Cannot stat `/dev/disk/by-id/ata-VBOX_HARDDISK_VB9a77c2bc-6ea81425', skipping.
/usr/sbin/grub-probe: info: /dev/sda1 starts from 2048.
/usr/sbin/grub-probe: info: opening the device /dev/sda.
/usr/sbin/grub-probe: info: the size of /dev/sda is 24576000.
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.

Reiner030 commented at 2014-10-17 11:50:

I think the grubenv and perhapd some other files are also needed:

wheezy $ find /boot/grub/ -type f | grep -v -e .mod -e .mo -e .img -e .lst
/boot/grub/device.map
/boot/grub/grubenv
/boot/grub/unicode.pf2
/boot/grub/grub.cfg
wheezy $ find /boot/grub/ -type f | grep -e .mod -e .mo -e .img -e .lst | wc -l
244
wheezy $ find /boot/grub/ -type d
/boot/grub/
/boot/grub/locale
/boot/grub/i386-pc

mmh, this was previous Debian Squeeze ^^... ... checking Debian wheezy only install:

wheezy # find /boot/grub/ -type f | grep -v -e .mod -e .mo -e .img -e .lst
/boot/grub/grub.cfg
/boot/grub/device.map
/boot/grub/grubenv
/boot/grub/efiemu32.o
/boot/grub/efiemu64.o
wheezy # find /boot/grub/ -type f | grep -e .mod -e .mo -e .img -e .lst | wc -l
218
wheezy # find /boot/grub/ -type d
/boot/grub/
/boot/grub/locale

and here the actual Ubuntu:

trusty # find /boot/grub/ -type f | grep -v -e .mod -e .mo -e .img -e .lst
/boot/grub/grubenv
/boot/grub/unicode.pf2
/boot/grub/i386-pc/efiemu64.o
/boot/grub/i386-pc/efiemu32.o
/boot/grub/grub.cfg
/boot/grub/fonts/unicode.pf2
/boot/grub/gfxblacklist.txt
trusty # find /boot/grub/ -type f | grep -e .mod -e .mo -e .img -e .lst | wc -l
233
trusty # find /boot/grub/ -type d
/boot/grub/
/boot/grub/locale
/boot/grub/i386-pc
/boot/grub/fonts

gdha commented at 2014-10-17 12:30:

I did a successful recovery of

# lsb_release -a 2>/dev/null
Distributor ID: Debian
Description:    Debian GNU/Linux 7.6 (wheezy)
Release:        7.6
Codename:       wheezy

this morning with the modification I checked in yesterday.
btw: /boot/grub/grubenv is already included I believe

I did not need to rebuild initramfs:

update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64
/usr/sbin/mkinitramfs: 66: .: Can't open /etc/initramfs-tools/initramfs.conf

perhaps we need to COPY this to our rescue image?

Reiner030 commented at 2014-10-17 21:12:

mmh... there seems be a problem then.
I tried now my first VMware based guest again to backup/restore with a new build.

When I checked backup log I was astonished that my version string in rear wasn't updated.
Even if I made a "make clean; make deb" I got the wrong version from some 14th again (the multiple strings from 14th came perhaps because I forgot "make clean" there).
Here some log of my try:

$ make clean
rm -f rear-1.16.1-git201410100921-git201410100921-git201410100921-git201410100921.tar.gz
rm -f build-stamp
make -C doc clean
make[1]: Entering directory `/usr/src/rear/doc'
rm -f unconv.8 *.html *.xml
make -C user-guide clean
make[2]: Entering directory `/usr/src/rear/doc/user-guide'
rm -f *.html *.svg *.xml
make[2]: Leaving directory `/usr/src/rear/doc/user-guide'
make[1]: Leaving directory `/usr/src/rear/doc'
$ make deb
rm -f rear-1.16.1-git201410100921-git201410100921-git201410100921-git201410100921.tar.gz
rm -f build-stamp
make -C doc clean
...

So I checked it by deleting and checking out it completely new:

$ LANG=C diff -rq rear-inital rear-aftercompile
Files rear-inital/.git/index and rear-aftercompile/.git/index differ
Files rear-inital/.git/logs/HEAD and rear-aftercompile/.git/logs/HEAD differ
Only in rear-aftercompile: build-stamp
Only in rear-aftercompile: rear-1.16.1-git201410171607.tar.gz
$ LANG=C diff -rq rear-aftercompile rear-aftercleanup
Only in rear-aftercompile: build-stamp
Only in rear-aftercompile: rear-1.16.1-git201410171607.tar.gz
$ LANG=C diff -rq rear-inital rear-aftercleanup
Files rear-inital/.git/index and rear-aftercleanup/.git/index differ
Files rear-inital/.git/logs/HEAD and rear-aftercleanup/.git/logs/HEAD differ

but this seems fine - when the "make clean" is not forgotten ;)

I uploaded my deb package to https://www.dropbox.com/s/n1k8717twpgq43j/rear_1.16.1-1_all.deb?dl=0

On my VMware guest I have installed:

# duply -V
  duply version 1.8.0
  (http://duply.net)

  Using installed duplicity version 0.6.18, python 2.7.3, gpg 1.4.12 (Home: ~/.gnupg), awk 'GNU Awk 4.0.1', bash '4.2.37(1)-release (x86_64-pc-linux-gnu)'.
# duplicity --version
duplicity 0.6.18

The disk layout should be easy - the only thing is that I have swapped last year the order of swap and root partition:

# fdisk -l

Disk /dev/sda: 12.9 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders, total 25165824 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00066a9c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *     1050624    25165823    12057600   83  Linux
/dev/sda2            2048     1050623      524288   82  Linux swap / Solaris

Partition table entries are not in disk order

But I got still same error (after fixing libs manually from issue https://github.com/rear/rear/issues/426):

2014-10-17 19:22:18 Installing GRUB2 boot loader
mount: none already mounted or /mnt/local/proc busy
mount: according to mtab, none is already mounted on /mnt/local/proc
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
Auto-detection of a filesystem of /dev/sda1 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/mnt/local/boot/grub/device.map" --target=fs -v /mnt/local/boot/grub" to <bug-grub@gnu.org>
chroot: failed to run command `grub2-install': No such file or directory
2014-10-17 19:22:19 Including finalize/Linux-i386/23_run_efibootmgr.sh
2014-10-17 19:22:19 Including finalize/GNU/Linux/30_create_mac_mapping.sh
2014-10-17 19:22:19 Including finalize/GNU/Linux/41_migrate_udev_rules.sh
2014-10-17 19:22:19 Including finalize/GNU/Linux/42_migrate_network_configuration_files.sh
2014-10-17 19:22:19 Including finalize/default/88_check_for_mount_by_id.sh
2014-10-17 19:22:19 Including finalize/default/89_finish_checks.sh
2014-10-17 19:22:19 
WARNING ! For this system
Debian/7.6 on Linux-i386 (based on )
there is no code to install a boot loader on the recovered system or the code
that we have failed to install the boot loader correctly.

Please contribute this code to the Relax-and-Recover project. To do so
please take a look at the scripts in /usr/share/rear/finalize,
for an example you can use the script for Fedora (and RHEL/CentOS/SL) in
/usr/share/rear/finalize/Linux-i386/21_install_grub.sh or
/usr/share/rear/finalize/Linux-i386/22_install_grub2.sh

--------------------  ATTENTION ATTENTION ATTENTION -------------------
|                                                                     |
|          IF YOU DO NOT INSTALL A BOOT LOADER MANUALLY,              |
|                                                                     |
|          THEN YOUR SYSTEM WILL N O T BE ABLE TO BOOT !              |
|                                                                     |
-----------------------------------------------------------------------

You can use 'chroot /mnt/local bash --login' to access the recovered system.
Please remember to mount /proc before trying to install a boot loader.

2014-10-17 19:22:19 Including finalize/default/90_remount_sync.sh
2014-10-17 19:22:22 Finished running 'finalize' stage in 5 seconds
2014-10-17 19:22:22 Running 'wrapup' stage
2014-10-17 19:22:22 Including wrapup/default/50_post_recovery_script.sh
2014-10-17 19:22:22 Including wrapup/default/98_good_bye.sh
2014-10-17 19:22:22 Including wrapup/default/99_copy_logfile.sh
2014-10-17 19:22:22 Finished running 'wrapup' stage in 0 seconds
2014-10-17 19:22:22 Finished running recover workflow
2014-10-17 19:22:22 Running exit tasks.
2014-10-17 19:22:22 Finished in 739 seconds
2014-10-17 19:22:22 Removing build area /tmp/rear.4GXgylKvxwR6XJn
rmdir: removing directory, `/tmp/rear.4GXgylKvxwR6XJn'
2014-10-17 19:22:22 End of program reached

I downgraded now duply:

# duply -V
  duply version 1.5.5.5
  (http://duply.net)

  Using installed duplicity version 0.6.18, python 2.7.3, gpg 1.4.12 (Home: ~/.gnupg), awk 'GNU Awk 4.0.1', bash '4.2.37(1)-release (x86_64-pc-linux-gnu)'.

and tried backup again... but same:

2014-10-17 20:50:46 Installing GRUB2 boot loader
mount: none already mounted or /mnt/local/proc busy
mount: according to mtab, none is already mounted on /mnt/local/proc
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
Auto-detection of a filesystem of /dev/sda1 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/mnt/local/boot/grub/device.map" --target=fs -v /mnt/local/boot/grub" to <bug-grub@gnu.org>
chroot: failed to run command `grub2-install': No such file or directory
2014-10-17 20:50:47 Including finalize/Linux-i386/23_run_efibootmgr.sh
2014-10-17 20:50:47 Including finalize/GNU/Linux/30_create_mac_mapping.sh
2014-10-17 20:50:47 Including finalize/GNU/Linux/41_migrate_udev_rules.sh
2014-10-17 20:50:47 Including finalize/GNU/Linux/42_migrate_network_configuration_files.sh
2014-10-17 20:50:47 Including finalize/default/88_check_for_mount_by_id.sh
2014-10-17 20:50:47 Including finalize/default/89_finish_checks.sh
2014-10-17 20:50:48 
WARNING ! For this system
Debian/7.6 on Linux-i386 (based on )
there is no code to install a boot loader on the recovered system or the code
that we have failed to install the boot loader correctly.

Please contribute this code to the Relax-and-Recover project. To do so
please take a look at the scripts in /usr/share/rear/finalize,
for an example you can use the script for Fedora (and RHEL/CentOS/SL) in
/usr/share/rear/finalize/Linux-i386/21_install_grub.sh or
/usr/share/rear/finalize/Linux-i386/22_install_grub2.sh

--------------------  ATTENTION ATTENTION ATTENTION -------------------
|                                                                     |
|          IF YOU DO NOT INSTALL A BOOT LOADER MANUALLY,              |
|                                                                     |
|          THEN YOUR SYSTEM WILL N O T BE ABLE TO BOOT !              |
|                                                                     |
-----------------------------------------------------------------------

You can use 'chroot /mnt/local bash --login' to access the recovered system.
Please remember to mount /proc before trying to install a boot loader.

2014-10-17 20:50:48 Including finalize/default/90_remount_sync.sh
2014-10-17 20:50:49 Finished running 'finalize' stage in 3 seconds
2014-10-17 20:50:49 Running 'wrapup' stage
2014-10-17 20:50:49 Including wrapup/default/50_post_recovery_script.sh
2014-10-17 20:50:49 Including wrapup/default/98_good_bye.sh
2014-10-17 20:50:49 Including wrapup/default/99_copy_logfile.sh
2014-10-17 20:50:49 Finished running 'wrapup' stage in 0 seconds
2014-10-17 20:50:49 Finished running recover workflow
2014-10-17 20:50:49 Running exit tasks.
2014-10-17 20:50:49 Finished in 792 seconds
2014-10-17 20:50:49 Removing build area /tmp/rear.bNDHsPF9yNP6GNB
rmdir: removing directory, `/tmp/rear.bNDHsPF9yNP6GNB'
2014-10-17 20:50:49 End of program reached

I try to test the same with my Vagrant / Virtualbox tomorrow.

Reiner030 commented at 2014-10-19 14:08:

ah for the Vagrant testing I have found my problem / when creating the test env for the main repository I have made a mistake (but only for the Vagrant version - not the above mentioned VMware guest problem):

rear-test/rear$ git remote -v
origin  https://github.com/tyl0re/rear.git (fetch)
origin  https://github.com/tyl0re/rear.git (push)

My provision script is setup right but yet not checking for modified remotes:

 # Github Repository_URL of ReaR:
 GIT_REPO="https://github.com/rear/rear.git"
 #GIT_REPO="https://github.com/tyl0re/rear.git"

=> now fixed (also in https://gist.github.com/Reiner030/4b602289320f3c2ed4e7 )

Vagrant backuo/recover now works better with included fix https://github.com/rear/rear/issues/426 but there are still 2 problems

  1. with the known_hosts file.
    a) automatic restore didn't use / find it - but it's there: /root/.ssh/known_hosts
    b) manual run in the root login/shell works nice.

  2. recovered machine has problems to boot - it hung with

Loading, please wait...
INIT: version 2.88 booting
INIT: No inittab file found

Enter runlevel: _

but manual set of runlevel didn't help.
Here last lines of the recover log:

2014-10-19 13:23:28 Including restore/DUPLICITY/default/10_restore_duply.sh
mv: cannot move `restore//boot' to `./boot': Device or resource busy
2014-10-19 13:26:18 Including restore/DUPLICITY/default/20_prompt_user_to_start_restore.sh
2014-10-19 13:26:18 Including restore/DUPLICITY/default/40_restore_duplicity.sh
2014-10-19 13:26:18 Including restore/DUPLICITY/default/50_selinux_autorelabel.sh
2014-10-19 13:26:18 Created /.autorelabel file : after reboot SELinux will relabel all files
2014-10-19 13:26:18 Including restore/default/90_create_missing_directories.sh
2014-10-19 13:26:18 Finished running 'restore' stage in 170 seconds
2014-10-19 13:26:18 Running 'finalize' stage
2014-10-19 13:26:18 Including finalize/default/01_prepare_checks.sh
2014-10-19 13:26:18 Including finalize/default/10_populate_dev.sh
2014-10-19 13:26:18 Including finalize/GNU/Linux/15_migrate_disk_devices_layout.sh
2014-10-19 13:26:18 Including finalize/GNU/Linux/15_migrate_uuid_tags.sh
2014-10-19 13:26:18 Including finalize/GNU/Linux/16_rename_diskbyid.sh
2014-10-19 13:26:18 Including finalize/Debian/i386/17_rebuild_initramfs.sh
2014-10-19 13:26:18 Including finalize/Linux-i386/21_install_grub.sh
2014-10-19 13:26:18 Including finalize/Linux-i386/22_install_grub2.sh
2014-10-19 13:26:18 Installing GRUB2 boot loader
2014-10-19 13:26:20 Including finalize/Linux-i386/23_run_efibootmgr.sh
2014-10-19 13:26:20 Including finalize/GNU/Linux/30_create_mac_mapping.sh
2014-10-19 13:26:20 Including finalize/GNU/Linux/41_migrate_udev_rules.sh
diff: /mnt/local//etc/udev/rules.d/70-persistent-cd.rules: No such file or directory
2014-10-19 13:26:20 Updating udev configuration (70-persistent-cd.rules)
cp: cannot stat `/mnt/local//etc/udev/rules.d/70-persistent-cd.rules': No such file or directory
cp: cannot create regular file `/mnt/local//etc/udev/rules.d/70-persistent-cd.rules': No such file or directory
2014-10-19 13:26:20 ERROR: Could not copy '/etc/udev/rules.d/70-persistent-cd.rules' -> '/mnt/local//etc/udev/rules.d/70-persistent-cd.rules'
=== Stack trace ===
Trace 0: /bin/rear:249 main
Trace 1: /usr/share/rear/lib/recover-workflow.sh:34 WORKFLOW_recover
Trace 2: /usr/share/rear/lib/framework-functions.sh:81 SourceStage
Trace 3: /usr/share/rear/lib/framework-functions.sh:42 Source
Trace 4: /usr/share/rear/finalize/GNU/Linux/41_migrate_udev_rules.sh:33 source
Trace 5: /usr/share/rear/lib/_input-output-functions.sh:132 StopIfError
Message: Could not copy '/etc/udev/rules.d/70-persistent-cd.rules' -> '/mnt/local//etc/udev/rules.d/70-persistent-cd.rules'
===================
2014-10-19 13:26:20 Running exit tasks.
2014-10-19 13:26:20 Finished in 188 seconds
2014-10-19 13:26:20 Removing build area /tmp/rear.hDpDETjSPknLOv2
rmdir: removing directory, `/tmp/rear.hDpDETjSPknLOv2'

Reiner030 commented at 2014-10-19 16:09:

mmh, having a cold is not the best thing to setup/diagnose things...
When checking why 70-persistent-cd.rules was not found by restore process I recognized that I had accidently excluded the folder in my backup testing... now with this fix I got again problem

  1. known_hosts / ssh access is only used when run manually
  2. same problem as with VMware guest on Friday also for Vagrant / Virtualbox VM guest:
2014-10-19 14:43:00 Including layout/recreate/default/25_verify_mount.sh
2014-10-19 14:43:00 Finished running 'layout/recreate' stage in 9 seconds
2014-10-19 14:43:00 Running 'restore' stage
2014-10-19 14:43:00 Including restore/DUPLICITY/default/10_restore_duply.sh
mv: cannot move `restore//boot' to `./boot': Device or resource busy
2014-10-19 14:46:04 Including restore/DUPLICITY/default/20_prompt_user_to_start_restore.sh
2014-10-19 14:46:04 Including restore/DUPLICITY/default/40_restore_duplicity.sh
2014-10-19 14:46:04 Including restore/DUPLICITY/default/50_selinux_autorelabel.sh
2014-10-19 14:46:04 Created /.autorelabel file : after reboot SELinux will relabel all files
2014-10-19 14:46:04 Including restore/default/90_create_missing_directories.sh
2014-10-19 14:46:04 Finished running 'restore' stage in 184 seconds
2014-10-19 14:46:04 Running 'finalize' stage
2014-10-19 14:46:04 Including finalize/default/01_prepare_checks.sh
2014-10-19 14:46:04 Including finalize/default/10_populate_dev.sh
2014-10-19 14:46:04 Including finalize/GNU/Linux/15_migrate_disk_devices_layout.sh
2014-10-19 14:46:04 Including finalize/GNU/Linux/15_migrate_uuid_tags.sh
2014-10-19 14:46:04 Including finalize/GNU/Linux/16_rename_diskbyid.sh
device node not found
device node not found
2014-10-19 14:46:04 Including finalize/Debian/i386/17_rebuild_initramfs.sh
mount: none already mounted or /mnt/local/proc busy
mount: according to mtab, none is already mounted on /mnt/local/proc
Available versions:  3.2.0-4-amd64
Execute: /usr/sbin/update-initramfs -u -k "3.2.0-4-amd64" -b /boot -v
Keeping /boot/initrd.img-3.2.0-4-amd64.dpkg-bak
update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64
mktemp: failed to create directory via template `/var/tmp/mkinitramfs_XXXXXX': No such file or directory
Removing /boot/initrd.img-3.2.0-4-amd64.dpkg-bak
update-initramfs: failed for /boot/initrd.img-3.2.0-4-amd64 with 1.
2014-10-19 14:46:04 WARNING !!!
initramfs creation failed, please check '/var/log/rear/rear-rear-test.log' to see the error
messages in detail and decide yourself, wether the system will boot or not.

2014-10-19 14:46:04 Including finalize/Linux-i386/21_install_grub.sh
2014-10-19 14:46:04 Including finalize/Linux-i386/22_install_grub2.sh
2014-10-19 14:46:04 Installing GRUB2 boot loader
/usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
Auto-detection of a filesystem of /dev/sda1 failed.
Try with --recheck.
If the problem persists please report this together with the output of "/usr/sbin/grub-probe --device-map="/mnt/local/boot/grub/device.map" --target=fs -v /mnt/local/boot/grub" to <bug-grub@gnu.org>
chroot: failed to run command `grub2-install': No such file or directory
2014-10-19 14:46:05 Including finalize/Linux-i386/23_run_efibootmgr.sh
2014-10-19 14:46:05 Including finalize/GNU/Linux/30_create_mac_mapping.sh
2014-10-19 14:46:05 Including finalize/GNU/Linux/41_migrate_udev_rules.sh
2014-10-19 14:46:05 Including finalize/GNU/Linux/42_migrate_network_configuration_files.sh
2014-10-19 14:46:05 Including finalize/default/88_check_for_mount_by_id.sh
2014-10-19 14:46:05 Including finalize/default/89_finish_checks.sh
2014-10-19 14:46:05
WARNING ! For this system
Debian/7.6 on Linux-i386 (based on )
there is no code to install a boot loader on the recovered system or the code
that we have failed to install the boot loader correctly.

Please contribute this code to the Relax-and-Recover project. To do so
please take a look at the scripts in /usr/share/rear/finalize,
for an example you can use the script for Fedora (and RHEL/CentOS/SL) in
/usr/share/rear/finalize/Linux-i386/21_install_grub.sh or
/usr/share/rear/finalize/Linux-i386/22_install_grub2.sh

--------------------  ATTENTION ATTENTION ATTENTION -------------------
|                                                                     |
|          IF YOU DO NOT INSTALL A BOOT LOADER MANUALLY,              |
|                                                                     |
|          THEN YOUR SYSTEM WILL N O T BE ABLE TO BOOT !              |
|                                                                     |
-----------------------------------------------------------------------

You can use 'chroot /mnt/local bash --login' to access the recovered system.
Please remember to mount /proc before trying to install a boot loader.

2014-10-19 14:46:05 Including finalize/default/90_remount_sync.sh
2014-10-19 14:46:06 Finished running 'finalize' stage in 2 seconds
2014-10-19 14:46:06 Running 'wrapup' stage
2014-10-19 14:46:06 Including wrapup/default/50_post_recovery_script.sh
2014-10-19 14:46:06 Including wrapup/default/98_good_bye.sh
2014-10-19 14:46:06 Including wrapup/default/99_copy_logfile.sh
2014-10-19 14:46:06 Finished running 'wrapup' stage in 0 seconds
2014-10-19 14:46:06 Finished running recover workflow
2014-10-19 14:46:06 Running exit tasks.
2014-10-19 14:46:06 Finished in 197 seconds
2014-10-19 14:46:06 Removing build area /tmp/rear.Cgw0H7DqAU2R1y0
rmdir: removing directory, `/tmp/rear.Cgw0H7DqAU2R1y0'
2014-10-19 14:46:06 End of program reached

There is an error in log:

Execute: /usr/sbin/update-initramfs -u -k "3.2.0-4-amd64" -b /boot -v
Keeping /boot/initrd.img-3.2.0-4-amd64.dpkg-bak
update-initramfs: Generating /boot/initrd.img-3.2.0-4-amd64
mktemp: failed to create directory via template `/var/tmp/mkinitramfs_XXXXXX': No such file or directory
Removing /boot/initrd.img-3.2.0-4-amd64.dpkg-bak
update-initramfs: failed for /boot/initrd.img-3.2.0-4-amd64 with 1.
2014-10-19 14:46:04 WARNING !!!
initramfs creation failed, please check '/var/log/rear/rear-rear-test.log' to see the error

The files are there:

RESCUE rear-test:~ # ls -la /mnt/local/boot/
total 15671
drwxr-xr-x  4 root root     1024 Oct 19 14:46 .
drwxr-xr-x 20 root root     4096 Oct 19 14:46 ..
-rw-r--r--  1 root root  2112778 Jul  4 23:11 System.map-3.2.0-4-amd64
-rw-r--r--  1 root root   129206 Jul  4 23:11 config-3.2.0-4-amd64
drwxr-xr-x  3 root root     5120 Oct 19 14:46 grub
-rw-r--r--  1 root root 10871879 Jul 14 12:23 initrd.img-3.2.0-4-amd64
drwx------  2 root root    12288 Oct 19 14:42 lost+found
-rw-r--r--  1 root root  2840000 Jul  4 23:11 vmlinuz-3.2.0-4-amd64

but boot process is now not functional - no boot loader prompt even.

Perhaps I have some misunderstaning how ReaR works?
So I tried manual resotre + grub setup - and found different variants of grub* programs:

--- Finished state OK at 15:09:32.809 - Runtime 00:03:00.683 ---
Installing GRUB2 boot loader
Installation finished. No error reported.

Finished recovering your system. You can explore it under '/mnt/local'.

RESCUE rear-test:~ # fdisk -l

Disk /dev/sda: 12.6 GB, 12582912000 bytes
255 heads, 63 sectors/track, 1529 cylinders, total 24576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000345e5

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758    24575999    12037121    f  W95 Ext'd (LBA)
/dev/sda5          501760    24573951    12036096   8e  Linux LVM
[...]
RESCUE rear-test:~ # grub-
grub-install      grub-mkdevicemap  grub-mkrelpath    grub-reboot       grub-setup
grub-mkconfig     grub-mkimage      grub-probe        grub-set-default
RESCUE rear-test:~ # chroot /mnt/local/ bash --login
bash: id: command not found
bash: [: : integer expression expected
root@rear-test:/# grub-
grub-bin2h            grub-kbdcomp          grub-mkimage          grub-mkrelpath        grub-ntldr-img
grub-editenv          grub-menulst2cfg      grub-mklayout         grub-mkrescue         grub-script-check
grub-fstest           grub-mkfont           grub-mkpasswd-pbkdf2  grub-mount

... the problem: after leaving the chroot env I got again an empty fdisk table?

RESCUE rear-test:~ # fdisk -l

Disk /dev/sda: 12.6 GB, 12582912000 bytes
255 heads, 63 sectors/track, 1529 cylinders, total 24576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000265d8

   Device Boot      Start         End      Blocks   Id  System

[...]

Reiner030 commented at 2014-10-21 08:28:

Sorry, I still have no clue where here the problem is (in my setup) - perhaps someone can test with my environment and see what is missing? => https://github.com/rear/rear/issues/486

=> Yesterday I got in tmpfs size problem when restoring with duply - I done a quickfix by resizing RAM from 2G to 4G in my testing instance.
I would check to fix the TEMP_DIR problem https://github.com/rear/rear/issues/469 but that could be a little easier if this problem and the inital "host not found error" is already solved ;)

The ReaR Backup is a "nice to have" for my setups and I have higher prio tasks next weeks.
But I would try to check/help here to fix it finally.

Reiner030 commented at 2014-10-27 19:10:

When testing it this and vagrant task "together" I think i stumbled over the solution.

  • you where right
  • i where right ;)

Why ?

  • I was testing it always in "autorecovery" mode
  • I bet you were testing it alway in "manual" recovery mode.

=> if the recovery is run in "auto mode" there are some environments/setups missing which e.g. didn't set $HOME so that ssh didn't know about $HOME/.ssh/known_hosts file and somehow grub2 is missing also something.
=> This task can be then closed and we need another issue opened I think?

gdha commented at 2014-10-30 12:02:

@Reiner030 the vagrant setup is very interesting, but I would still like know what the difference is between auto mode and manual mode, especially what it means for the ssh and grub environment.

gdha commented at 2015-01-04 18:27:

@Reiner030 what shall we do with this issue? Not sure where I can help you with?

gdha commented at 2015-02-23 13:42:

added to the release notes so we can close this issue


[Export of Github issue for rear/rear.]