Giter Club home page Giter Club logo

Comments (34)

tritonas00 avatar tritonas00 commented on May 27, 2024

Hi. The project doesn't support Grub Legacy, only Grub 2.

You can choose not to install a bootloader, and then when prompted, follow the instructions screen to install grub legacy manually.

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

I want to restore the backup.tar.gz to a new disk,
can I uncompress the backup.tar.gz manually to a new disk and then setup Grub Legacy?
i

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

can I boot into linux rescue mode , mount two disk to /mnt/sda and /mnt/sdb(new disk), then chroot /mnt/sdb, and then uncompress backup.tar.gz?

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

start the restore.sh script normally and don't choose a bootloader.

at the end, the script will tell you what to do (chroot and install grub)

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00 thanks. I will test it soon.

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

Enter the path of the backup file
Path: /Backup-2016-07-26/rhel5.8-64.tar.gz
Checking archive type...
Checking and reading archive (101949 Files)

::SUMMARY
TARGET PARTITION SCHEME:
Partition Mountpoint Filesystem Size Options
/dev/sdb1 / ext3 defaults,noatime

BOOTLOADER:
None (WARNING)

PROCESS:
Mode: Restore
Archive: gzip compressed
System: Fedora based x86_64

ARCHIVER OPTIONS:
--selinux
--acls
--xattrs-include='*'

Continue?
(Y/n):Y

::PROCESSING

::GENERATING FSTAB
cp: cannot stat `/mnt/target/etc/fstab': No such file or directory
./restore.sh: line 2251: /mnt/target/etc/fstab: No such file or directory
cat: /mnt/target/etc/fstab: No such file or directory
ls: /mnt/target/boot/: No such file or directory

Edit fstab?
(y/N):N

::PREPARING CHROOT ENVIRONMENT
Binding /run
mount: mount point /mnt/target/run does not exist
Binding /dev
mount: mount point /mnt/target/dev does not exist
Binding /dev/pts
mount: mount point /mnt/target/dev/pts does not exist
Binding /proc
mount: mount point /mnt/target/proc does not exist
Binding /sys
mount: mount point /mnt/target/sys does not exist

::REBUILDING INITRAMFS IMAGES
grep: /mnt/target/etc/fstab: No such file or directory

Completed. Log: /tmp/restore.log

You didn't choose a bootloader, so this is the right time to install and
update one. To do so:

==>For internet connection to work, on a new terminal with root
access enter: cp -L /etc/resolv.conf /mnt/target/etc/resolv.conf

==>Then chroot into the target system: chroot /mnt/target

==>Install and update a bootloader

==>When done, leave chroot: exit

==>Finally, return to this window and press ENTER to unmount
all remaining (engaged) devices.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

till here, I opened a new terminal,and run chroot;

[root@localhost system-tar-and-restore-5.2]# chroot /mnt/target/
chroot: cannot run command `/bin/bash': No such file or directory

because /mnt/target directory is empty, I cannot change root directory.

so I uncompressed the rhel5.8-64.tar.gz to /mnt/target manually,

but I coundn't install grub:
[root@localhost /]# grub-install /dev/sda
/dev/sda: Not found or not a block device.
[root@localhost /]# grub-install /dev/sda1
/dev/sda1: Not found or not a block device.
[root@localhost /]# grub-install --root-directory=/boot /dev/sda1
Probing devices to guess BIOS drives. This may take a long time.
No suitable drive was found in the generated device map.
[root@localhost /]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext3 42G 2.6G 37G 7% /
sysfs sysfs 42G 2.6G 37G 7% /sys
df: /dev/pts': No such file or directory /dev/sda1 ext3 42G 2.6G 37G 7% /boot df:/dev/shm': No such file or directory
df: /proc/sys/fs/binfmt_misc': No such file or directory df:/proc/fs/vmblock/mountPoint': No such file or directory
sunrpc rpc_pipefs 42G 2.6G 37G 7% /var/lib/nfs/rpc_pipefs

when I reboot the system, Grub cannot find file:

rhel5 8-x64

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

Can you retry and post /tmp/restore.log here please?

We need to see why the script didn't extract the archive first. If we can't resolve this then i will help you do it manually.

Thanks.

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

[root@localhost ~]# cat /tmp/restore.log
====================System Tar & Restore 5.2 {2016-07-26-07:12:10}====================

::SUMMARY
TARGET PARTITION SCHEME:
Partition Mountpoint Filesystem Size Options
/dev/sdb1 / ext3 defaults,noatime

BOOTLOADER:
None (WARNING)

PROCESS:
Mode: Restore
Archive: gzip compressed
System: Fedora based x86_64

ARCHIVER OPTIONS:
--selinux
--acls
--xattrs-include='*'

::TAR/RSYNC STATUS
tar: unrecognized option --xattrs-include='*'' Trytar --help' or `tar --usage' for more information.

::PREPARING CHROOT ENVIRONMENT
Binding /run
mount: mount point /mnt/target/run does not exist
Binding /dev
mount: mount point /mnt/target/dev does not exist
Binding /dev/pts
mount: mount point /mnt/target/dev/pts does not exist
Binding /proc
mount: mount point /mnt/target/proc does not exist
Binding /sys
mount: mount point /mnt/target/sys does not exist

::REBUILDING INITRAMFS IMAGES
grep: /mnt/target/etc/fstab: No such file or directo

+++++++++++++++++++++++

[root@localhost ~]# cat /Backup-2016-07-26/backup.log
====================System Tar & Restore 5.2 {2016-07-26-06:11:47}====================

::SUMMARY
ARCHIVE:
/Backup-2016-07-26/rhel5-64.tar.gz

ARCHIVER OPTIONS:
--exclude=/run/*
--exclude=/dev/*
--exclude=/sys/*
--exclude=/tmp/*
--exclude=/mnt/*
--exclude=/proc/*
--exclude=/media/*
--exclude=/var/run/*
--exclude=/var/lock/*
--exclude=.gvfs
--exclude=lost+found
--exclude=/Backup-2016-07-26
--sparse
--acls
--xattrs
--selinux

HOME DIRECTORY:
Include

FOUND BOOTLOADERS:
Syslinux

::ARCHIVER STATUS
tar: Removing leading /' from member names tar: Removing leading/' from hard link targets
System archived successfully
Elapsed time: 0 hours 5 min 41 sec

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

so thats the problem: tar: unrecognized option --xattrs-include='*'' (old tar or distro version?)

please open restore.sh with a text editor, go to that line https://github.com/tritonas00/system-tar-and-restore/blob/master/restore.sh#L184

and replace "--xattrs-include='*'" with --xattrs save and retry.

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

Thanks @warlock90
Ok, will test it .

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00
Great, till here is right (I didn't select bootloader. ):

You didn't choose a bootloader, so this is the right time to install and
update one. To do so:

==>For internet connection to work, on a new terminal with root
access enter: cp -L /etc/resolv.conf /mnt/target/etc/resolv.conf

==>Then chroot into the target system: chroot /mnt/target

==>Install and update a bootloader

==>When done, leave chroot: exit

==>Finally, return to this window and press ENTER to unmount
all remaining (engaged) devices.

I have a question:
which device should I setup the grub into?

here is my disk info:
before the command chroot /mnt/target:
[root@localhost ~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext3 37G 3.3G 32G 10% /
/dev/sda1 ext3 289M 17M 258M 6% /boot
tmpfs tmpfs 499M 0 499M 0% /dev/shm
/dev/sdb1 ext3 42G 2.6G 37G 7% /mnt/target
[root@localhost ~]# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 38 305203+ 83 Linux
/dev/sda2 39 4964 39568095 83 Linux
/dev/sda3 4965 5221 2064352+ 82 Linux swap / Solaris

Disk /dev/sdb: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 5472 43953808+ 83 Linux

after run the command #chroot /mnt/target:
[root@localhost /]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext3 42G 2.6G 37G 7% /
/dev/sda1 ext3 42G 2.6G 37G 7% /boot
tmpfs tmpfs 499M 124K 499M 1% /dev/shm
sunrpc rpc_pipefs 42G 2.6G 37G 7% /var/lib/nfs/rpc_pipefs

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

the boost loader must go on the target disk (sdb probably) , so check it carefully

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00
after run the command #chroot /mnt/target:
[root@localhost /]# grub-install /dev/sda
The file /boot/grub/stage2 not read correctly.
[root@localhost /]# grub-install /dev/sda1
The file /boot/grub/stage2 not read correctly.

[root@localhost /]# grub-install /dev/sdb
/dev/sdb does not have any corresponding BIOS drive.
[root@localhost /]# grub-install /dev/sdb1
/dev/sdb1 does not have any corresponding BIOS drive.

is my way right to Install and update a bootloader?

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

try grub-install --recheck /dev/sdb

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

[root@localhost /]# grub-install --recheck /dev/sdb
Probing devices to guess BIOS drives. This may take a long time.
The file /boot/grub/stage2 not read correctly.

after run the command #chroot /mnt/target:
the system cannot identify /dev/sdb.

leave chroot: exit
[root@localhost ~]# grub-install --recheck /dev/sdb
Probing devices to guess BIOS drives. This may take a long time.
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/sda (old disk)
(hd1) /dev/sdb (new disk)

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

well this might work but the boot files are in the old disk this way.

can you try grub-install --root-directory=/mnt/target /dev/sdb --recheck ?

i don't have experience with grub legacy, sorry.

Your distro doesn't support grub2?

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

When I reboot , the system says "Grub Hard Disk error", bootloader problem too.

@tritonas00
My system is rhel5.8 x84-64, doesn't support Grub2.

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

Oh, thats too old.

Maybe you want to give syslinux a try.

If you want to retry with grub and don't want to re-run restore.sh:

mkdir /mnt/target
mount /dev/sdb1 /mnt/target
mount --bind /run /mnt/target/run
mount --bind /dev /mnt/target/dev
mount --bind /dev/pts /mnt/target/dev/pts
mount --bind /proc /mnt/target/proc
mount --bind /sys /mnt/target/sys

chroot /mnt/target
install and update grub

umount /mnt/target/dev/pts
umount /mnt/target/proc
umount /mnt/target/dev
umount /mnt/target/sys
umount /mnt/target/run
umount /dev/sdb1

reboot

The bootloader must be installed within chroot for this to work

Also you need to update the config file (menu.lst) after installing as well (also in chroot)

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00
Thanks a lot! I will try it.

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

test to install grub2 to boot the system;
says:
error: no such device : some number for UUID
Entering rescue mode...
grub rescue>

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

you did grub2-mkconfig -o /boot/grub2/grub.cfg in chroot after the grub2-install ?

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00 no, should I do that ?
I just run grub-install /dev/sda.

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

yes.

grub2-install --recheck /dev/sda
grub2-mkconfig -o /boot/grub2/grub.cfg

in chroot

are you sure sda is your new disk?

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

In chroot, there is no grub2-mkconfig command in rhel5 system ;
but when I boot system in rhel7 rescue mode, the rhel5 system can be mounted , really surprise!
The rhel5 rescue mode could not find the system image previously.

rhel7_x64-2016-07-28-21-46-23
rhel7_x64-2016-07-28-21-54-57

rhel7_x64-2016-07-28-21-58-42
rhel7_x64-2016-07-28-22-00-01

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

try grub-mkconfig -o /boot/grub2/grub.cfg

or grub-mkconfig -o /boot/grub/grub.cfg

check ls /boot to find the grub dir name (grub or grub2)

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00 there is no grub-mkconfig command in chroot(rhel5);
should I install some rpms for that command? Now I can mount rhel5 iso .
no grub-mkconfig command found in rhel5.iso rpms;

rhel7_x64-2016-07-28-22-15-54

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

grub-mkconfig is a part of grub2.

how did you install grub2?

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00 , I have a rhel7 system, add a new disk to rhel7, then uncompress rhel5.tar.gz to the new disk, then boot into rhel7 rescue mode , at here I could install grub2 in the added new disk. But, also boot into grub rescue ,
Up to now, the problem is still not resolved.

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

you must install grub2 in the rhel5 system.
you have to chroot in rhel5 (from your rhel7 system), and install and update grub2 in there

if this is not possible. then you have to boot it from rhel7 grub2:

make sure you have os-prober installed and do grub2-mkconfig -o /boot/grub2/grub.cfg so it will find your rhel5 system (in your new disk) and create an entry for it.

no need for rescue mode.

just boot your rhel7 system normally (with rhel5 disk connected) and do the above

also check https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Reinstalling_GRUB_2.html

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00 Thanks! Thanks!Thanks!

The magic os-prober command found the rhel5.8, and then grub2-mkconfig created the entry for rhel5.
Now I can boot into rhel5 system. Wow, GREAT!

Of course, there are some small problems, I couldn't open terminal(error creating the child process for this terminal), the eth0 down(maybe the Dual NIC problem), I think I will solve these problems.

Finally, Thanks you @tritonas00 .

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

Great.

A last question, you extracted the rhel5 system by hand or with the restore.sh script?

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

With the restore.sh script.
But the way extract it by hand will also be effective, I think.

from system-tar-and-restore.

tritonas00 avatar tritonas00 commented on May 27, 2024

ok then.

if you do it by hand, you must also chroot and create new fstab and regenerate initramfs images for your kernel(s)

also now you can boot the rhel5 system, you can install grub legacy in there normally, in the new disk (if you want to boot it from the new disk)

closing the issue now 👍

from system-tar-and-restore.

JohnnyRad avatar JohnnyRad commented on May 27, 2024

@tritonas00

from system-tar-and-restore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.