#2530 Issue closed
: How to create full-backup bootable ISO file using Relax-and-Recover app?¶
Labels: documentation
, support / question
, no-issue-activity
SeyyedKhandon opened issue at 2020-11-27 07:52:¶
I've recently faced a problem in which I need to make a bootable ISO from my current local centos with all its configs and installed apps, so that I can write it on a USB flash drive and install it on some other machines.
I've searched about this, and tried some of them untill I finally found
Relax-and-Recover
(i.e. rear) app which seems to work the way I
want.
The problem however is that, I couldn't make a single ISO
and it
instead generates a 250MB ISO and 1.7GB tar.gz file next to it.
My current config is as follows:
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=iso:///run/media/user/myusb
OUTPUT_URL=file:///run/media/user/myusb/bck
ISO_DIR=file:///run/media/user/myusb/iso
What I want is just 1 bootable ISO which contains the whole backup that
can be bootable on USB stick and be installed on other machines.
How should I do this?
jsmeix commented at 2020-11-27 09:15:¶
Because you wrote bootable on USB stick
I wonder why you don't use the OUTPUT=USB
method, cf.
http://relax-and-recover.org/documentation/getting-started
In any case regardless what method you prefer to use
you must thoroughly test and validate on replacement hardware
that "rear recover" actually works for you as you need it,
see the section "Inappropriate expectations" at
https://en.opensuse.org/SDB:Disaster_Recovery
Regarding OUTPUT=ISO
with BACKUP_URL="iso:///..."
:
One single ISO with the backup included in that ISO works for me with
OUTPUT=ISO
OUTPUT_URL=null
BACKUP=NETFS
BACKUP_URL="iso:///backup"
and also with
OUTPUT=ISO
OUTPUT_URL=file:///other
BACKUP=NETFS
BACKUP_URL="iso:///backup"
In both cases I get the ISO with the backup/backup.tar.gz
included
stored locally at var/lib/rear/output/rear-linux-h9wr.iso
(linux-h9wr
is the hostname of my test system):
# mount var/lib/rear/output/rear-linux-h9wr.iso /mnt
# find /mnt -ls
1856 2 drwxr-xr-x 4 root root 2048 Nov 27 09:35 /mnt
2048 2 drwxr-x--- 2 root root 2048 Nov 27 09:35 /mnt/backup
2054 881 -rw-r--r-- 1 root root 901807 Nov 27 09:35 /mnt/backup/backup.log
2059 1176235 -rw-r--r-- 1 root root 1204463990 Nov 27 09:35 /mnt/backup/backup.tar.gz
1920 4 drwx------ 2 root root 4096 Nov 27 09:35 /mnt/isolinux
1926 2 -r--r--r-- 1 root root 2048 Nov 27 09:35 /mnt/isolinux/boot.cat
1931 20 -rw------- 1 root root 19784 Nov 27 09:35 /mnt/isolinux/chain.c32
1935 273 -rw------- 1 root root 278556 Nov 27 09:35 /mnt/isolinux/hdt.c32
1939 67130 -rw------- 1 root root 68740932 Nov 27 09:35 /mnt/isolinux/initrd.cgz
1943 24 -rw------- 1 root root 24576 Nov 27 09:35 /mnt/isolinux/isolinux.bin
1947 3 -rw------- 1 root root 2064 Nov 27 09:35 /mnt/isolinux/isolinux.cfg
1952 7169 -rw-r--r-- 1 root root 7340112 Nov 24 09:44 /mnt/isolinux/kernel
1956 54 -rw------- 1 root root 54388 Nov 27 09:35 /mnt/isolinux/menu.c32
1960 1 -rw------- 1 root root 267 Nov 27 09:35 /mnt/isolinux/message
1964 1183 -rw------- 1 root root 1210611 Nov 27 09:35 /mnt/isolinux/pci.ids
1968 1 -rw------- 1 root root 239 Nov 27 09:35 /mnt/isolinux/poweroff.com
1972 1 -rw------- 1 root root 961 Nov 27 09:35 /mnt/isolinux/rear.help
1977 1 -rw------- 1 root root 812 Nov 27 09:35 /mnt/isolinux/reboot.c32
1984 149 -rw------- 1 root root 151740 Nov 27 09:35 /mnt/isolinux/vesamenu.c32
In the latter case with OUTPUT_URL=file:///other
that one must be
a separatedly mounted thing so I do # mount /dev/sda6 /other
in my
case
so I get the ISO from var/lib/rear/output/rear-linux-h9wr.iso
also copied there at /other/linux-h9wr/rear-linux-h9wr.iso
i.e. I have the ISO now two times on my local disk.
In the former case with OUTPUT_URL=null
I get the ISO only
stored locally at var/lib/rear/output/rear-linux-h9wr.iso
but not duplicated as a copy somewhere else.
With
OUTPUT=ISO
ISO_DIR=/other/myISOdir
OUTPUT_URL=null
BACKUP=NETFS
BACKUP_URL="iso:///backup"
I get the ISO only
stored locally at /other/myISOdir/rear-linux-h9wr.iso
but not duplicated as a copy somewhere else.
CAUTION WITH BIG FILES IN THE ISO
There is a limit of the ISO 9660 file system that is 2GiB or 4GiB
according to
https://en.wikipedia.org/wiki/ISO_9660#The_2/4_GiB_file_size_limit
Under normal circumstances files greater or equal 2GiB should not appear
in the ISO.
An exception is when the backup is included in the ISO with
BACKUP_URL=iso://
where the backup archive file (e.g. backup.tar.gz) could be greater or
equal 2GiB.
When there is a 2GiB file size limit a backup.tar.gz that is greater
than 2GiB
will get corrupted in the ISO so backup restore via "rear recover" would
fail
which is a dead end because the backup in the ISO got corrupted.
"man mkisofs"
(at least on my SLES12-SP5 for /usr/bin/mkisofs from the
cdrkit-cdrtools-compat RPM)
reads (excerpts):
-allow-limited-size
... files larger than 2GiB ... cannot be represented in ISO9660 level 1 or 2
Wich indicates in practice that limit is 2GiB (and not 4GiB).
Usually 'mkisofs' is called with '-udf -allow-limited-size'
cf. usr/share/rear/prep/ISO/GNU/Linux/320_verify_mkisofs.sh
but only if the '--help' output of ISO_MKISOFS_BIN shows
'-allow-limited-size'
so there are cases where ISO 9660 level 1 or 2 is used that has a 2GiB
file size limit.
For example when 'ebiso' is used there is a 2GiB file size limit
but also other tools that are specified by ISO_MKISOFS_BIN could have
that limit.
Accordingly to be on the safe side pay special attention when there are
files
to be included in the ISO that are greater or equal 2GiB.
When your ISO making tool has a 2GiB file size limit
but your backup.tar.gz is greater or equal 2GiB
your "too big" backup it will get included in the ISO
but it gets corrupted there so your backup is lost.
See also
https://github.com/rear/rear/pull/2525
SeyyedKhandon commented at 2020-11-27 10:33:¶
@jsmeix Thank you very much, it did create a 2.7g iso. I tried to
install it and everything went well in manual installing, but in
automatic installation it will face with access denied
error.
And the second problem which is i'm worried about is, the OS Configs
like privacy etc. has been lost, how can i keep them?
jsmeix commented at 2020-11-27 11:11:¶
@jsmeix
the crucial thing is not the size of the whole ISO
but the size of the files inside the ISO.
Currently I cannot comment on the automatic mode
because I almost never use it (long ago I had tested it once).
What do you mean with
the OS Configs like privacy etc. has been lost
?
Could you explain in more detail what exact OS configs
you mean
and where they have been lost (i.e. where you would expect them to
be).
The ReaR recovery system (basically kernel and initrd in your ISO)
is a totally different thing than your original system so if you
expect
the ReaR recovery system would have same OS configs
as your original system it is not true. The basic config
of the ReaR recovery system is in usr/share/rear/skel/
plus some generated things during "rear mkrescue".
gdha commented at 2020-11-27 11:51:¶
@jsmeix nice description - would like to add it to our ReaR User Guide in a separate section with plenty of examples (https://relax-and-recover.org/rear-user-guide/)
jsmeix commented at 2020-11-27 12:02:¶
@gdha
many thanks in advance for enhancing our ReaR User Guide!
Please also have a look at my comments in the code in
https://github.com/rear/rear/pull/2525/files
SeyyedKhandon commented at 2020-11-27 12:27:¶
@jsmeix os configs
I was wrong, and i did a double check, and it was
the same as the original one.
Can I select the "usb" as destination for the generated iso? with this
config?
OUTPUT=ISO
OUTPUT_URL="file:///run/media/swall/USB"
BACKUP=NETFS
BACKUP_URL="iso:///backup"
What I did:
# mkdir /other
# umount /dev/sdb1
# mount /dev/sdb1 /other
then used below, and it did worked for me:
OUTPUT=ISO
OUTPUT_URL=file:///other
BACKUP=NETFS
BACKUP_URL="iso:///backup"
And as you told, I tested the only one copy version of iso( only into the usb) as below and it did worked:
OUTPUT=ISO
ISO_DIR=/other
OUTPUT_URL=null
BACKUP=NETFS
BACKUP_URL="iso:///backup"
Thank you @jsmeix
SeyyedKhandon commented at 2020-11-27 13:33:¶
Is there any way for 100gb iso? or should we use another config for rear?
jsmeix commented at 2020-11-27 13:46:¶
@SeyyedKhandon
I don't have much personal experience with huge ISOs.
Personally I use basically always
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://your.NFS.server.IP/path/to/your/rear/backup
as in the usr/share/rear/conf/examples/SLE*-example.conf files
i.e. with a small rear-hostname.iso and separated backup.tar.gz
on a NFS server.
In general regarding BACKUP_URL=iso
:
This includes the whole backup (which can be several GiB up to some
TiB)
into the ISO image and that calls for various troubles in general.
So my first and foremost question would be:
Why is it a must that a user has his whole backup inside the ISO?
That is not normal (I know nobody who does it nowadays)
and it does not make sense under normal circumstances.
In exceptional cases it may make sense so it is possible
but the admin has to know what it means when doing it.
Normal usage of ReaR keeps the backup separated from
the ReaR recovery system (in this case the ISO).
Having the whole backup inside the ISO has generic drawbacks:
To boot the ReaR recovery system on replacement hardware
means to boot from a huge ISO which may not always work.
The backup is no longer separatedly accessible
(e.g. to restore a few files directly from the backup)
but somewhat buried into the ISO
(ok. one can just mount the ISO if needed).
Also see usr/share/rear/conf/default.conf about
ISO_MAX_SIZE and its additional specific drawbacks.
Some more info FYI:
Regarding "Creating bootable USB from ReaR ISO" see also
https://github.com/rear/rear/issues/2210
If you need a UEFI bootable thingy, see
https://github.com/rear/rear/issues/2394#issuecomment-627226008
why isohybrid cannot be used to make a "normal"
non-UEFI-bootable ISO image UEFI bootable.
To get a UEFI bootable thingy you could
alternatively use OUTPUT=RAWDISK
, cf.
https://github.com/rear/rear/issues/2500
therein starting at
https://github.com/rear/rear/issues/2500#issuecomment-724280432
and subsequent comments.
But I am not a OUTPUT=RAWDISK
user so currently I cannot tell
if it is possible to get the backup.tar.gz included in the RAWDISK
image
so that you could get an "all-in-one" UEFI bootable RAWDISK image
that contains the ReaR recovery system plus the backup.tar.gz.
@OliverO2
is our OUTPUT=RAWDISK
developer
so probably he could help here (as far as his time permits).
SeyyedKhandon commented at 2020-11-27 14:11:¶
I really just want to backup the whole os, I'm not sure how should I
recover from that if there will be .iso
, .tar.gz
separated from each
other.
Let's say we have a os and want to backit up on a local external hdd,
how can i do it, and restore it(lets say we want the normal method which
just will create a 250mb iso and a .img file with huge 50gb size), how
should we do that?
jsmeix commented at 2020-11-27 14:36:¶
In my case with
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://your.NFS.server.IP/path/to/your/rear/backup
with a small rear-hostname.iso
and separated backup.tar.gz
on a NFS
server
I boot the rear-hostname.iso
(that contains the ReaR recovery
system)
on my replacement hardware (my "hardware" are KVM/QEMU virtual
machines)
log in as root into the booted ReaR recovery system and only run
rear recover
to recreate my original system on my replacement hardware
(I did that hundreds of times for testing various things).
The ReaR recovery system is specific for the original system
where it had been made with rear mkbackup
or rear mkrescue
.
With the ReaR recovery system in rear-hostname.iso
separated from the backup in backup.tar.gz
one can create an updated ReaR recovery system separatedly
with rear mkrescue
(only new rear-hostname.iso
on the NFS server)
or one can create an updated backup separatedly
with rear mkbackuponly
(only new backup.tar.gz
on the NFS server)
depending on what is needed to update
e.g. update the backup each day but update the ReaR recovery system
only when needed via rear checklayout || rear mkrescue
Regarding updating the backup see the section
"Relax-and-Recover versus backup and restore" at
https://en.opensuse.org/SDB:Disaster_Recovery
The ReaR recovery system contains the needed info to get the right
backup.tar.gz
from the NFS server because the recovery system contains
/etc/rear/local.conf with
BACKUP=NETFS
BACKUP_URL=nfs://your.NFS.server.IP/path/to/your/rear/backup
so it mounts that specific NFS share and restores the backup directly
from there
(i.e. no need to move the backup around in a ISO or on a medium).
As far as I know
OUTPUT=ISO
BACKUP=NETFS
BACKUP_URL=nfs://your.NFS.server.IP/path/to/your/rear/backup
is the normal method that is used by most SUSE Linux Enterprise
customers
who use Relax-and-Recover as their disaster recovery framework.
For now I would most recommend the section
"First steps with Relax-and-Recover"
https://en.opensuse.org/SDB:Disaster_Recovery#First_steps_with_Relax-and-Recover
In general I would recommend to read through the whole long
https://en.opensuse.org/SDB:Disaster_Recovery
article and pick out what is of particular interest for you.
Perhaps some "relaxing leisure time reading" over the weekend?
For certain meaning of "relaxing leisure time" ;-)
Now it's weekend - at least for me :-)
I wish you a relaxed and recovering weekend!
github-actions commented at 2021-01-27 02:12:¶
Stale issue message
[Export of Github issue for rear/rear.]