#319 Issue closed: Wrong diskrecover on RHEL4 and rear 1.14

Labels: bug, documentation

MarkusRoth opened issue at 2013-10-25 09:27:

I want to recover a RHEL4 system. Backup with rear on a cifs share was successful. I boot the test system (identical hardware) with the rescue ISO. The recover process stops at generating the disklayout.

Found out, that the parted -s /dev/sda mkpart primary for /dev/sda4 is wrong. It must be "extended" instead of "primary" and the End Blocks must be changed.

Although the lines parted -s /dev/sda set /dev/sda3 on and furhter must be deleted.

The command for creating the filesystem on /dev/sda6 (/root2). The tune2fs -U <none> ... had no FS-UUID of this partition. I checked on the original system with tune2fs -l /dev/sda6. There was no FS UUID !

gdha commented at 2013-10-25 10:36:

From the mail of Markus:

Log file:

+++ Print 'Creating partitions for disk /dev/sda (msdos)'
+++ test 1
+++ echo -e 'Creating partitions for disk /dev/sda (msdos)'
+++ parted -s /dev/sda mklabel msdos
+++ parted -s /dev/sda mkpart primary 0 5671
+++ parted -s /dev/sda set 1 boot on
+++ parted -s /dev/sda mkpart primary 5671 53599
+++ parted -s /dev/sda mkpart primary 53599 101527
+++ parted -s /dev/sda set /dev/sda3 on
Error: Expecting a partition number.
2013-10-25 08:21:19 An error occured during layout recreation.
2013-10-25 08:22:03 User selected: 6) Abort Relax-and-Recover
2013-10-25 08:22:03 Error detected during restore.
2013-10-25 08:22:03 Restoring backup of /var/lib/rear/layout/disklayout.conf
2013-10-25 08:22:03 ERROR: There was an error restoring the system layout. See /var/log/rear/rear-daytona2.log for details.

The disklayout looks as follows:

#disk /dev/hda 4294965248
disk /dev/sda 291999055872 msdos
part /dev/sda 5946845184 32256 primary boot /dev/sda1
part /dev/sda 50256460800 5946877440 primary none /dev/sda2
part /dev/sda 50256460800 56203338240 primary  /dev/sda3
part /dev/sda 1024 106459799040 primary  /dev/sda4
part /dev/sda 10075935744 106459831296 logical  /dev/sda5
part /dev/sda 5946845184 116535799296 logical  /dev/sda6
part /dev/sda 11852596224 122482676736 logical  /dev/sda7
part /dev/sda 11720991744 134335305216 logical  /dev/sda8
fs /dev/sda1 / ext3 uuid=8f3bc4f0-d605-4029-8cf2-c8fff9dfb95b label= blocksize=4096 reserved_blocks=4% max_mounts=27 check_interval=180d bytes_per_inode=8177 options=rw
fs /dev/sda6 /root2 ext3 uuid=<none> label= blocksize=4096 reserved_blocks=4% max_mounts=25 check_interval=180d bytes_per_inode=8177 options=rw,noexec,nosuid,nodev,noatime
fs /dev/sda5 /var ext3 uuid=79293447-713d-48e9-be5f-dfe2a680e623 label= blocksize=4096 reserved_blocks=4% max_mounts=37 check_interval=180d bytes_per_inode=8187 options=rw,noexec,nosuid,nodev,noatime
fs /dev/sda2 /opt/avaya ext3 uuid=78f75f71-8e71-403e-a98d-798b6212641d label= blocksize=4096 reserved_blocks=4% max_mounts=31 check_interval=180d bytes_per_inode=8179 options=rw
fs /dev/sda3 /opt/dbase ext3 uuid=58b70eff-daf0-4ab0-9fca-e9f31999970b label= blocksize=4096 reserved_blocks=4% max_mounts=25 check_interval=180d bytes_per_inode=8179 options=rw
fs /dev/sda8 /DVD_OPS ext3 uuid=dd8dd625-1c8d-4ed9-83f8-2ba60fe287d3 label= blocksize=4096 reserved_blocks=4% max_mounts=32 check_interval=180d bytes_per_inode=8177 options=rw
swap /dev/sda7 uuid= label=

fdisk -l on the original system looks:

Disk /dev/sda: 291.9 GB, 291999055872 bytes
255 heads, 63 sectors/track, 35500 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         723     5807466   83  Linux
/dev/sda2             724        6833    49078575   83  Linux
/dev/sda3            6834       12943    49078575   83  Linux
/dev/sda4           12944       35500   181189102+   5  Extended
/dev/sda5           12944       14168     9839781   83  Linux
/dev/sda6           14169       14891     5807466   83  Linux
/dev/sda7           14892       16332    11574801   82  Linux swap
/dev/sda8           16333       17757    11446281   83  Linux

Has anybody a hint why the creation of the extended partition /dev/sd4 fails?

regards,
Markus

gdha commented at 2013-10-25 10:37:

This issue is linked with another issue #263

To further investigate we would like to see:

  1. parted -v
  2. parted -m -s /dev/sda print
  3. parted -s /dev/sda print
  4. sfdisk -l /dev/sda
  5. disklayout.conf
  6. rear -d savelayout output (you may attach it via Gist)

MarkusRoth commented at 2013-10-25 10:49:

GNU Parted 1.6.19
Output of parted -s /dev/sda print is:

Disk geometry for /dev/sda: 0.000-278472.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 5671.384 primary ext3 boot
2 5671.384 53599.680 primary ext3
3 53599.680 101527.976 primary ext3
4 101527.976 278470.458 extended
5 101528.007 111137.167 logical ext3
6 111137.199 116808.552 logical ext3
7 116808.583 128112.099 logical linux-swap
8 128112.130 139290.139 logical ext3

Output of sfdisk -l /dev/sda is

Disk /dev/sda: 35500 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 722 723- 5807466 83 Linux
/dev/sda2 723 6832 6110 49078575 83 Linux
/dev/sda3 6833 12942 6110 49078575 83 Linux
/dev/sda4 12943 35499 22557 181189102+ 5 Extended
/dev/sda5 12943+ 14167 1225- 9839781 83 Linux
/dev/sda6 14168+ 14890 723- 5807466 83 Linux
/dev/sda7 14891+ 16331 1441- 11574801 82 Linux swap
/dev/sda8 16332+ 17756 1425- 11446281 83 Linux

See also Gist: https://gist.github.com/MarkusRoth/7192428/

gdha commented at 2013-10-28 12:46:

In the debug output I clearly see the following:

+++ sfdisk -c /dev/sda 4
++ declare partition_id=5
++ [[ 5 = @(5|f|85) ]]
++ sed -i '/^4 /s/ primary / extended /' /tmp/rear.fdgeeRpDvd29698/tmp/partitions
++ read partition_nr size start type flags junk

The question is now why a bit further down in the logging I see (reading input from $TMP_DIR/partitions:

++ echo 'part /dev/sda 1024 106459799040 primary  /dev/sda4'

@jhoekx Jeroen - can you see it? Why wasn't it saved properly in partitions (extended keyword) - don't get it. If I do it by hand it works.

gdha commented at 2013-11-15 11:47:

@jhoekx could you do me a favor and have a quick look at the following piece of code change - does it makes sense or was there a specific reason you wrote it as it is?

diff ./20_partition_layout.sh ~/projects/rear/usr/share/rear/layout/save/GNU/Linux/20_partition_layout.sh
99c99,103
<             if (( $partition_nr < 4 )) ; then
---
>             if (( $partition_nr > 4 )) ; then
>                 ### logical
>                 has_logical=1
>                 sed -i /^$partition_nr\ /s/$/\ logical/ $TMP_DIR/partitions
>             else
103,109d106
<             elif (( $partition_nr = 4 )) ; then
<                 declare type="extended"
<                 sed -i /^$partition_nr\ /s/$/\ extended/ $TMP_DIR/partitions
<             else
<                 ### logical for $partition_nr > 4
<                 has_logical=1
<                 sed -i /^$partition_nr\ /s/$/\ logical/ $TMP_DIR/partitions

image

jhoekx commented at 2013-11-15 12:06:

The reason is that /dev/sd*4 can be a primary partition. The first four can be primary or extended.

gdha commented at 2013-11-15 13:22:

@jhoekx Ok thanks for the clarification - the code mentioned just above makes no sense then. Agreed.
However, 3 text boxes above it was shown it should have changed it, but it didn't and I couldn't find the reason.

jhoekx commented at 2013-11-15 13:25:

I'm also puzzled why it fails.

I don't have a RHEL 4 system anymore to test... I really should spend some more time on Rear :-)

gdha commented at 2013-11-25 07:56:

@MarkusRoth Sorry, 'till now we didn't find the reason why it was not changed properly. We don't have a RHEL4 anymore to try to reproduce this behavior and more recent versions seem to work fine. As said we're puzzled!

gdha commented at 2013-12-03 15:25:

will make a note in the release notes about this.

gdha commented at 2014-04-02 08:27:

added to release notes


[Export of Github issue for rear/rear.]