Creando un CD/DVD de rescate de un GNU/Linux Server-Desktop

0
1034

Hoy en dia, existen diferentes maneras de hacer respaldo o full backups de diferentes tipos de datos.
Tambien se respaldan los S.O ya sea en Cintas como se hace en AIX con un mksyb, y en linux no pasa desapercibido el hacer este tipo de respaldos.

Existe una utileria para hacer este tipo de respaldos de S.O muy similar al Ghost de Norton, y se trata de Mondo, una herramienta para hacer discos de rescate para Linux (i386, x86_64, ia64) y FreeBSD (i386) para las diferentes distribuciones tales como RedHat, RHEL, SuSE, SLES, Mandriva, Debian y Gentoo.

Las herramientas a usar son mindi y mondo.

Aqui anexo la secuencia del uso de estas herramientas.

web:~# apt-get install mindi mondo
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
afio buffer cdrecord courier-authdaemon courier-authlib
courier-authlib-userdb courier-base courier-mta dosfstools dvd+rw-tools fam
fuse-utils gawk genisoimage libfam0 libfribidi0 libfuse2 libntfs9
libparted1.7-1 lzop mdadm mindi-busybox mkisofs ms-sys ntfsprogs parted
syslinux wodim
Suggested packages:
courier-doc cdrskin cdrkit-doc libparted1.7-dev libparted1.7-i18n petris acl
attr lilo mondo-doc parted-doc
Recommended packages:
mail-transport-agent
The following NEW packages will be installed:
afio buffer cdrecord courier-authdaemon courier-authlib
courier-authlib-userdb courier-base courier-mta dosfstools dvd+rw-tools fam
fuse-utils gawk genisoimage libfam0 libfribidi0 libfuse2 libntfs9
libparted1.7-1 lzop mdadm mindi mindi-busybox mkisofs mondo ms-sys ntfsprogs
parted syslinux wodim
0 upgraded, 30 newly installed, 0 to remove and 0 not upgraded.
Need to get 6715kB of archives.
After this operation, 18.2MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrors.kernel.org etch/main gawk 1:3.1.5.dfsg-4 [718kB]
Get:2 http://mirrors.kernel.org etch/main afio 2.5-4 [82.0kB]
Get:3 http://mirrors.kernel.org etch/main buffer 1.19-8 [14.8kB]
Get:4 http://mirrors.kernel.org etch/main wodim 9:1.1.2-1 [439kB]
Get:5 http://mirrors.kernel.org etch/main cdrecord 9:1.1.2-1 [1168B]
Get:6 http://mirrors.kernel.org etch/main courier-authlib 0.58-4 [81.4kB]
Get:7 http://mirrors.kernel.org etch/main courier-authdaemon 0.58-4 [6564B]
Get:8 http://mirrors.kernel.org etch/main courier-authlib-userdb 0.58-4 [34.0kB]
Get:9 http://mirrors.kernel.org etch/main libfam0 2.7.0-12 [27.7kB]
Get:10 http://mirrors.kernel.org etch/main courier-base 0.53.3-5 [229kB]
Get:11 http://mirrors.kernel.org etch/main dosfstools 2.11-2.1 [53.9kB]
Get:12 http://mirrors.kernel.org etch/main genisoimage 9:1.1.2-1 [592kB]
Get:13 http://mirrors.kernel.org etch/main mkisofs 9:1.1.2-1 [884B]
Get:14 http://mirrors.kernel.org etch/main dvd+rw-tools 7.0-4 [145kB]
Get:15 http://mirrors.kernel.org etch/main fam 2.7.0-12 [73.8kB]
Get:16 http://mirrors.kernel.org etch/main fuse-utils 2.5.3-4.4 [57.6kB]
Get:17 http://mirrors.kernel.org etch/main libfribidi0 0.10.7-4 [43.5kB]
Get:18 http://mirrors.kernel.org etch/main libfuse2 2.5.3-4.4 [53.5kB]
Get:19 http://mirrors.kernel.org etch/main libntfs9 1.13.1-6+b2 [125kB]
Get:20 http://mirrors.kernel.org etch/main libparted1.7-1 1.7.1-5.1 [186kB]
Get:21 http://mirrors.kernel.org etch/main lzop 1.01-4 [43.3kB]
Get:22 http://mirrors.kernel.org etch/main mdadm 2.5.6-9 [228kB]
Get:23 http://mirrors.kernel.org etch/main mindi-busybox 1.2.1-2 [784kB]
Get:24 http://mirrors.kernel.org etch/main syslinux 1:3.31-4 [330kB]
Get:25 http://mirrors.kernel.org etch/main parted 1.7.1-5.1 [57.5kB]
Get:26 http://mirrors.kernel.org etch/main ms-sys 2.1.0-1 [22.3kB]
Get:27 http://mirrors.kernel.org etch/main mindi 2.20-2 [156kB]
Get:28 http://mirrors.kernel.org etch/main mondo 2.20-1.1 [432kB]
Get:29 http://mirrors.kernel.org etch/main ntfsprogs 1.13.1-6+b2 [273kB]
Get:30 http://mirrors.kernel.org etch/main courier-mta 0.53.3-5 [1425kB]
Fetched 6715kB in 49s (134kB/s)
Preconfiguring packages …
Selecting previously deselected package gawk.
(Reading database … 42087 files and directories currently installed.)
Unpacking gawk (from …/gawk_1%3a3.1.5.dfsg-4_amd64.deb) …
Selecting previously deselected package afio.
Unpacking afio (from …/archives/afio_2.5-4_amd64.deb) …
Selecting previously deselected package buffer.
Unpacking buffer (from …/buffer_1.19-8_amd64.deb) …
Selecting previously deselected package wodim.
Unpacking wodim (from …/wodim_9%3a1.1.2-1_amd64.deb) …
Selecting previously deselected package cdrecord.
Unpacking cdrecord (from …/cdrecord_9%3a1.1.2-1_all.deb) …
Selecting previously deselected package courier-authlib.
Unpacking courier-authlib (from …/courier-authlib_0.58-4_amd64.deb) …
Selecting previously deselected package courier-authdaemon.
Unpacking courier-authdaemon (from …/courier-authdaemon_0.58-4_amd64.deb) …
Selecting previously deselected package courier-authlib-userdb.
Unpacking courier-authlib-userdb (from …/courier-authlib-userdb_0.58-4_amd64.d eb) …
Selecting previously deselected package libfam0.
Unpacking libfam0 (from …/libfam0_2.7.0-12_amd64.deb) …
Selecting previously deselected package courier-base.
Unpacking courier-base (from …/courier-base_0.53.3-5_amd64.deb) …
Selecting previously deselected package dosfstools.
Unpacking dosfstools (from …/dosfstools_2.11-2.1_amd64.deb) …
Selecting previously deselected package genisoimage.
Unpacking genisoimage (from …/genisoimage_9%3a1.1.2-1_amd64.deb) …
Selecting previously deselected package mkisofs.
Unpacking mkisofs (from …/mkisofs_9%3a1.1.2-1_all.deb) …
Selecting previously deselected package dvd+rw-tools.
Unpacking dvd+rw-tools (from …/dvd+rw-tools_7.0-4_amd64.deb) …
Selecting previously deselected package fam.
Unpacking fam (from …/fam_2.7.0-12_amd64.deb) …
Selecting previously deselected package fuse-utils.
Unpacking fuse-utils (from …/fuse-utils_2.5.3-4.4_amd64.deb) …
Selecting previously deselected package libfribidi0.
Unpacking libfribidi0 (from …/libfribidi0_0.10.7-4_amd64.deb) …
Selecting previously deselected package libfuse2.
Unpacking libfuse2 (from …/libfuse2_2.5.3-4.4_amd64.deb) …
Selecting previously deselected package libntfs9.
Unpacking libntfs9 (from …/libntfs9_1.13.1-6+b2_amd64.deb) …
Selecting previously deselected package libparted1.7-1.
Unpacking libparted1.7-1 (from …/libparted1.7-1_1.7.1-5.1_amd64.deb) …
Selecting previously deselected package lzop.
Unpacking lzop (from …/archives/lzop_1.01-4_amd64.deb) …
Selecting previously deselected package mdadm.
Unpacking mdadm (from …/mdadm_2.5.6-9_amd64.deb) …
Selecting previously deselected package mindi-busybox.
Unpacking mindi-busybox (from …/mindi-busybox_1.2.1-2_amd64.deb) …
Selecting previously deselected package syslinux.
Unpacking syslinux (from …/syslinux_1%3a3.31-4_amd64.deb) …
Selecting previously deselected package parted.
Unpacking parted (from …/parted_1.7.1-5.1_amd64.deb) …
Selecting previously deselected package ms-sys.
Unpacking ms-sys (from …/ms-sys_2.1.0-1_amd64.deb) …
Selecting previously deselected package mindi.
Unpacking mindi (from …/mindi_2.20-2_amd64.deb) …
Selecting previously deselected package mondo.
Unpacking mondo (from …/mondo_2.20-1.1_amd64.deb) …
Selecting previously deselected package ntfsprogs.
Unpacking ntfsprogs (from …/ntfsprogs_1.13.1-6+b2_amd64.deb) …
Selecting previously deselected package courier-mta.
Unpacking courier-mta (from …/courier-mta_0.53.3-5_amd64.deb) …
Setting up gawk (3.1.5.dfsg-4) …

Setting up afio (2.5-4) …
Setting up buffer (1.19-8) …
Setting up wodim (1.1.2-1) …

Setting up cdrecord (1.1.2-1) …

Setting up courier-authlib (0.58-4) …
Setting up courier-authdaemon (0.58-4) …
Starting Courier authentication services: authdaemond.

Setting up courier-authlib-userdb (0.58-4) …
Setting up libfam0 (2.7.0-12) …

Setting up courier-base (0.53.3-5) …

Setting up dosfstools (2.11-2.1) …
Setting up genisoimage (1.1.2-1) …
Setting up mkisofs (1.1.2-1) …
Setting up dvd+rw-tools (7.0-4) …
Setting up fam (2.7.0-12) …
Starting file alteration monitor: FAM.

Setting up fuse-utils (2.5.3-4.4) …
creating fuse device node…
udev active, devices will be created in /dev/.static/dev/
creating fuse group…
Adding group `fuse’ (GID 106) …
Done.

Setting up libfribidi0 (0.10.7-4) …

Setting up libfuse2 (2.5.3-4.4) …

Setting up libntfs9 (1.13.1-6+b2) …

Setting up libparted1.7-1 (1.7.1-5.1) …

Setting up lzop (1.01-4) …
Setting up mdadm (2.5.6-9) …
Generating mdadm.conf… done.
update-initramfs: Generating /boot/initrd.img-2.6.18-6-amd64
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
W: mdadm: no arrays defined in configuration file.
W: mdadm: falling back to emergency procedure in initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.18-4-amd64
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
W: mdadm: no arrays defined in configuration file.
W: mdadm: falling back to emergency procedure in initramfs.
Starting MD monitoring service: mdadm –monitor.
Assembling MD arrays…failed (no arrays found in config file or automatically).

Setting up mindi-busybox (1.2.1-2) …

Setting up syslinux (3.31-4) …
Setting up parted (1.7.1-5.1) …
Setting up ms-sys (2.1.0-1) …
Setting up mindi (2.20-2) …
Setting up mondo (2.20-1.1) …

Setting up ntfsprogs (1.13.1-6+b2) …
Setting up courier-mta (0.53.3-5) …
Starting Courier mail server: done.
Starting Courier mail filter: done.
Starting Courier SMTP server: done.

Una vez instalado las herramientas, basta con ejecutar el programa mindi tal como se ilustra a continuacion

web:~# mindi
/usr/sbin/mindi: line 16: /bin/arch: No such file or directory
Mindi Linux mini-distro generator v2.2.0-r881

Latest Mindi is available from http://www.mondorescue.org

BusyBox sources are available from http://www.busybox.net

——————————————————————————
Do you want to use your own kernel to build the boot disk (y/n) ?y
Would you like to use LILO (instead of syslinux)
for your boot CD/floppies (y/n) ?n
Analyzing dependency requirements 92% -Where a re your LVM-Tools? Couldn’t find lvmiopversion
Done.
Making complete dependency list Done.
Analyzing your keyboard’s configuration.

Adding the following keyboard mapping tables: Done.
Assembling dependency files………………………… Done.
The files have been subdivided into 6 directories. Your mountlist will look like this:-
DEVICE MOUNTPOINT FORMAT SIZE (MB) LABEL
/dev/hda5 lvm lvm 285977

Unable to open proc
/dev/mapper/ceuxweb-raiz / xfs lvm
/dev/hda1 /boot reiserfs 188
/dev/mapper/ceuxweb-home /home xfs lvm
/dev/mapper/ceuxweb-tmp /tmp xfs lvm
/dev/mapper/ceuxweb-usr /usr xfs lvm
/dev/mapper/ceuxweb-usrlocal /usr/local xfs lvm
/dev/mapper/ceuxweb-var /var xfs lvm
/dev/mapper/ceuxweb-swap swap swap lvm
Tarring and zipping the groups………………… Done.
Creating data disk #1…#2…#3…#4…#5…#6… Done.
Making 1722KB boot disk…………………Call GetFilesystemToUse() with parameter /boot/vmlinuz-2 .6.18-6-amd64 to get filesystem to use for initrd.

GetFilesystemToUse(): called with parameter: /boot/vmlinuz-2.6.18-6-amd64.

GetFilesystemToUse(): gzip magic found at lvOffset 38888.

GetFilesystemToUse(): Filesytem to use for initrd is initramfs.

Creating initramfs initrd filesystem.

UseCpio (): Creating a gzip’ed cpio (AKA initramfs) initrd image…
5423 blocks
done.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/isolinux.cfg.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/isolinux-H.cfg.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/syslinux.cfg.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/syslinux-H.cfg.

initrd filesystem created.

……1440+0 records in
1440+0 records out
1474560 bytes (1.5 MB) copied, 0.004778 seconds, 309 MB/s
mke2fs 1.40.3 (05-Dec-2007)
cp: writing `vmlinuz’: No space left on device
Failed to copy /boot/vmlinuz-2.6.18-6-amd64 to ramdisk

Warning – failed to create 1.44MB boot/root floppies

Warning – failed to create 1.72MB boot image. Please reduce your kernel’s size

if you want to make a 1.72MB floppy disk.

Making 2880KB boot disk…………………Call GetFilesystemToUse() with parameter /boot/vmlinuz-2 .6.18-6-amd64 to get filesystem to use for initrd.

GetFilesystemToUse(): called with parameter: /boot/vmlinuz-2.6.18-6-amd64.

GetFilesystemToUse(): gzip magic found at lvOffset 38888.

GetFilesystemToUse(): Filesytem to use for initrd is initramfs.

Creating initramfs initrd filesystem.

UseCpio (): Creating a gzip’ed cpio (AKA initramfs) initrd image…
6742 blocks
done.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/isolinux.cfg.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/isolinux-H.cfg.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/syslinux.cfg.

CreateSyslinuxFile(): Writing to file /usr/lib/mindi/syslinux-H.cfg.

initrd filesystem created.

……mkfs.vfat 2.11 (12 Mar 2005)
… 2880 KB boot disks were created OK Done.
In the directory ‘/root/images/mindi’ you will find the images:-
mindi-data-1.img mindi-data-2.img mindi-data-3.img mindi-data-4.img mindi-data-5.img mindi-data-6.img
Would you like to create boot+data floppy disks now (y/n) ?n
Shall I make a bootable CD image? (y/n) y
NB: Mindi’s bootable CD always uses isolinux.

For a bootable CD w/LILO, please use Mondo.

Finished.

Boot and data disk images were created.

La imagen generada del S.O se localiza en /root/images/mindi

web:~# ls
crea-users.sh images phpMailer_v2.1.0beta2.tar.gz phpmailer.resp
web:~# cd images/
web:~/images# ls
mindi
web:~/images# ls -la
total 8
drwxr-xr-x 3 root root 18 May 5 18:13 .
drwxr-xr-x 10 root root 4096 May 5 18:13 ..
drwxr-xr-x 2 root root 4096 May 5 18:15 mindi
web:~/images# cd mindi/
web:~/images/mindi# ls
1.tar.gz 4.tar.gz all.tar.gz mindi-data-2.img mindi-data-5.img
2.tar.gz 5.tar.gz initrd.img mindi-data-3.img mindi-data-6.img
3.tar.gz 6.tar.gz mindi-data-1.img mindi-data-4.img mindi.iso
web:~/images/mindi#
web:~/images/mindi# ls -la
total 50764
drwxr-xr-x 2 root root 4096 May 5 18:15 .
drwxr-xr-x 3 root root 18 May 5 18:13 ..
-rw-r–r– 1 root root 1321400 May 5 18:14 1.tar.gz
-rw-r–r– 1 root root 1299180 May 5 18:14 2.tar.gz
-rw-r–r– 1 root root 1266758 May 5 18:14 3.tar.gz
-rw-r–r– 1 root root 1308783 May 5 18:14 4.tar.gz
-rw-r–r– 1 root root 1327859 May 5 18:14 5.tar.gz
-rw-r–r– 1 root root 888735 May 5 18:14 6.tar.gz
-rw-r–r– 1 root root 7410471 May 5 18:14 all.tar.gz
-rw-r–r– 1 root root 1338537 May 5 18:15 initrd.img
-rw-r–r– 1 root root 1474560 May 5 18:14 mindi-data-1.img
-rw-r–r– 1 root root 1474560 May 5 18:14 mindi-data-2.img
-rw-r–r– 1 root root 1474560 May 5 18:14 mindi-data-3.img
-rw-r–r– 1 root root 1474560 May 5 18:14 mindi-data-4.img
-rw-r–r– 1 root root 1474560 May 5 18:14 mindi-data-5.img
-rw-r–r– 1 root root 1474560 May 5 18:14 mindi-data-6.img
-rw-r–r– 1 root root 26949632 May 5 18:15 mindi.iso

web:~/images/mindi#

Finalmente se necesita grabar la imagen ISO con el siguiente comando ( se asume que en nuestro servidor se tiene un
CD/DVD-RW)

cdrecord dev=0,0,0 speed=8 -v -eject mindi.iso

LEAVE A REPLY

Please enter your comment!
Please enter your name here