Re: Reboot after mondorestore crashes with FATAL: No bootable medium found! System halted

"Faustino Nebrera" <[email protected]>
Newsgroups gmane.linux.mondo.devel
Message-ID <[email protected]>
Hi, Bruno,

It's working! Thanks a lot for your unvaluable help. As things have been a
bit tricky, I have prepared a small resume of what I did, just in case can
be useful to some other. Please find it attached.
Thanks again!

Faustino

-----Mensaje original-----
De: Bruno Cornec [mailto:[email protected]] 
Enviado el: martes, 5 de septiembre de 2017 15:56
Para: Mondo mailing list <[email protected]>
Asunto: Re: [Mondo-devel] Reboot after mondorestore crashes with FATAL: No
bootable medium found! System halted

Did you do your backup with the -z option if you use SELinux ?

If not, you'll have to use it so SELinux context are restored correctly.

Bruno.

Faustino Nebrera said on Tue, Sep 05, 2017 at 09:03:47AM +0200:

>Hi, Bruno,
>I almost got it!! Finally Centos 6.9 booted into my VirtualBox VM, and 
>Gnome desktop login showed. Unfortunately, after entering correct 
>username and password, screen got black for a couple of seconds, then 
>came back to the login screen. Probably it's not an issue related to 
>Mondo, but to Centos or VirtualBox, but as you have a lot of experience 
>with this situations, may be you can help me.
>Thanks a lot!
>
>-----Mensaje original-----
>De: Bruno Cornec [mailto:[email protected]] Enviado el: viernes, 1 
>de septiembre de 2017 14:28
>Para: Mondo mailing list <[email protected]>
>Asunto: Re: [Mondo-devel] Reboot after mondorestore crashes with FATAL: 
>No bootable medium found! System halted
>
>Faustino Nebrera said on Fri, Sep 01, 2017 at 12:38:40PM +0200:
>>I have found that VirtualBox uses AHCI disk controller. Is it 
>>supported by Mondo?
>
>Yes. Check that you have indeed the ahci drivers available at restore 
>time (look for your mondoarchive.log file and search for ahci it should 
>be in the moindi boot initrd)
>
>Bruno.
>--
>HPE EMEA EG FLOSS Technology Strategist
http://www.hpe.com/engage/opensource
>Open Source Profession, WW Linux Community Lead
http://github.com/bcornec
>
>FLOSS projects:    http://mondorescue.org
http://project-builder.org
>Musique ancienne?   http://www.musique-ancienne.org
http://www.medieval.org
>
>-----------------------------------------------------------------------
>-----
>--
>Check out the vibrant tech community on one of the world's most 
>engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
>_______________________________________________
>Mondo-devel mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/mondo-devel
>
>
>-----------------------------------------------------------------------
>------- Check out the vibrant tech community on one of the world's most 
>engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
>_______________________________________________
>Mondo-devel mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/mondo-devel

--
HPE EMEA EG FLOSS Technology Strategist http://www.hpe.com/engage/opensource
Open Source Profession, WW Linux Community Lead    http://github.com/bcornec

FLOSS projects:    http://mondorescue.org         http://project-builder.org
Musique ancienne?   http://www.musique-ancienne.org  http://www.medieval.org

----------------------------------------------------------------------------
--
Check out the vibrant tech community on one of the world's most engaging
tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mondo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mondo-devel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Mondo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mondo-devel
MondoCloneCentos6.txt (text/plain, 5.1 KB)
P2V clone of a CentOS Dell server to a VirtualBox VM
----------------------------------------------------

Introduction
------------
The final objective is creating a AWS EC2 AMI of a running CentOS box. By the moment of this writing, EC2 requires converting
an existing compatible image such as VMDK, so the first step should be create a "virtualized" copy of my original system.
The only tool I know that can create an iso image of a running Linux box is Mondo Rescue, so I used it, but it was a bit tricky,
so I will explain here what I did, just in case that can be useful for some other.

Physical Box
------------
Dell PowerEdge R415
12 cores
32GB memory
2x300GB sas disks configured in RAID1

This is the output of "df -h":
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              31G   11G   19G  35% /
tmpfs                  16G  133M   16G   1% /dev/shm
/dev/sda6             211G   47G  154G  24% /home
192.168.0.115:/nfs/SysImages
                      1,8T  736G  1,1T  41% /mnt/wdnas

Although /dev/sda6 used space is 47GB, I only need a couple of directories, so I will exclude the rest from the backup,
and I will need only about 5GB in this partition in my "cloned" system. As a total, I will require at most a 30GB virtual disk.

This is the output of fdisk -k /dev/sda (sorry, output is in spangish):
Disco /dev/sda: 299.4 GB, 299439751168 bytes
255 heads, 63 sectors/track, 36404 cylinders
Units = cilindros of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xdad54d24

Disposit. Inicio    Comienzo      Fin      Bloques  Id  Sistema
/dev/sda1               1           5       32812   de  Utilidad Dell
La partici  n 1 no termina en un l  mite de cilindro.
/dev/sda2   *           5         266     2097152    b  W95 FAT32
La partici  n 2 no termina en un l  mite de cilindro.
/dev/sda3             266        4345    32768000   83  Linux
/dev/sda4            4345       36405   257522688    5  Extendida
/dev/sda5            4345        8425    32768000   82  Linux swap / Solaris
/dev/sda6            8425       36405   224752640   83  Linux

Please note that Dell servers always create two small partitions at the start of the disk. I'm not sure what are
they used for, but I discovered that you will need equivalent partitions in your target VM, or your restored system 
will not boot (at least this is my experience).

Target VM
---------
VirtualBox 5.1.26 running onto a Windows server.
New VM with 2048MB memory, 30 GB VMDK disk.

Backup
------ 
First of all, you have to install Mondo (obvious).

I do not want to backup my nfs share, so I'll use -N flag when backing up.

My original disk is sas (scsi), and my destination VirtualBox VM uses ahci and emulates scsi, so, before proceding
with the backup, I will force mindi to include some modules in the image. Edit /usr/sbin/mindi and find "FORCE_MODS",
enter FORCE_MODS="ahci mptsas mptspi". 

I found problems with SElinux not allowing login after boot in the target system, so I edited /etc/selinux/config
and changed "SELINUX=enforcing" to "SELINUX=disabled". This is a bit drastic solution, and Bruno Cornec suggested
me to use the -z flag with the backup (thanks, Bruno). Unluckly, this advice came after I had my target running quite
well, so now I do not have SELinux, but that's not a problem, as far as this is only a disaster recovery solution.

To generate my iso image, I ran the following command:

nohup mondoarchive -O -V -N -G -i -s 8960m -l GRUB -d /home/sysimg -I / -E "/home/comunytek|/home/sysimg" -9 <&- >mondo.log 2>&1 &

I ran it in background, cause it took more than 1 hour to execute. It worked without errors, I copied the resulting "mondorescue-1.iso"
to my target box, and attached it to the DVD of the VM I had prepared.

Restore
-------
Make sure that your VirtualBox VM has been configured with:
- Network adapter configured as bridge to your physical NIC.
- Vitual DVD pointing to mondorescue-1.iso (or whatever you named your image).

Start your VM. iso image will boot and present you with mondorestore prompt. Proceed as follows:

boot: expert
fdisk /dev/sda
Create following partitions:

Device 		Start 	End 	Id
/dev/sda1	1	6	de
/dev/sda2	7	307	b
/dev/sda3	308	2208	83
/dev/sda4	2209	3916	5
/dev/sda5	2209	2509	82
/dev/sda6	2510	3916	83

(this is my example, you'll probably need a different configuration)

mondorestore
Interactive
DVD
Editing Mountlist <OK>
Continue anyway? YES
Partition hard disks? NO
Format hard drives? YES
Restore all of your data? YES
Initialize the bootloader? YES
Regenerate initrd? YES
..rebuild..your initrd..? OK
cd /boot
mkinitrd --force initramfs-2.6.32-696......img 2.6.32-696..... (use your own images)
mkinitrd --force initrd-2.6.32-696......img 2.6.32-696.....
exit
Did you changed the mountlist...? YES
Confirm boot device: /dev/sda
You will now edit... OK
.. remove references to any nfs mount ..
.. edit grub menu, if you like ..
.. wait to system prompt ..
stop VM
remove DVD .iso from the VM
start VM
Your new CentOS box should boot now, and you can work on it as a clon of your original box.

Hope this my help some other people :-)

Faustino Nebrera 2017/09/06
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.