HOWTO: Sabayon 5.2 dedicated GRUB2 rescue partition(4 noobs)

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

Post Reply

HOWTO: Sabayon 5.2 dedicated GRUB2 rescue partition(4 noobs)

Post by donnie » Sat Apr 10, 2010 16:13

[EDIT] I couldn't boot to SysRCD's .iso with GRUB 1.98, so be careful
[EDIT # 2] Here is a better solution:
I like it much more than SystemRescueCD + GRUB2, because that way you got maximum available :)

If you are new to Sabayon, there is still a way to backup your system :)

For the purpose of rescue, 300 MB of primary partition space is needed.
It can be a separate partition, or just a free space on existing primary partition.
After following instructions, you will boot from that partition to Sabayon or SystemRescueCD.
From SystemRescueCD you can make backup copy or restore a Sabayon.
Update of Sabayon OS: Entropy, Portage.
Update of SystemRecueCD OS: replace an old .iso with new .iso

I have a small 300 MB partition at /dev/sda2 and my Sabayon's root is located at /dev/sda5.

If you are in a trouble with GUI partitioning tool, type:
man mkfs

Download SystemRescueCD .iso file from:
Use md5sum to verify downloaded file:

Code: Select all

md5sum systemrescuecd-x86-1.5.1.iso

Version number of .iso may differ.

Mount our rescue partition as /mnt/sda2:

Code: Select all

mkdir -p /mnt/sda2
mount -t ext4 /dev/sda2 /mnt/sda2

Move systemrescuecd-x86-1.5.1.iso to /mnt/sda2/

Install GRUB2 on a SystemRescueCD partition and in MBR:

Code: Select all

grub2-install --root-directory=/dev/sda2 /dev/sda

Copy Sabayon's GRUB2 config file to a newely created /mnt/sda2/boot/grub:

Code: Select all

cp /boot/grub/grub.cfg /mnt/sda2/boot/grub

Now we have to edit our new GRUB2 config:

Code: Select all

nano /mnt/sda2/boot/grub/grub.cfg

As we had /dev/sda5 mounted as Sabayon's root during installation, and there was no separate /boot partition, all occurrences of (hd0,5) should be replaced with (hd0,2), so that we will always boot only from /dev/sda2. Do not edit menu entry called Sabayon, it will boot from /dev/sda5 as usual.

Inside a section starting with:

Code: Select all

# This file provides an easy way to add custom menu entries.

Add SystemRescueCD menu entry:

Code: Select all

menuentry "SystemRescueCd (isoloop)" {
   insmod ext2
   set root=(hd0,2)
        loopback loop /systemrescuecd-x86-1.5.1.iso
        linux (loop)/isolinux/rescuecd isoloop=systemrescuecd-x86-1.5.1.iso
        initrd (loop)/isolinux/initram.igz

Version number of .iso may differ! After update of SystemRescueCD check this grub.cfg!

Now, we could reboot.

But its better to check our booting using qemu first, or you can easily boot to GRUB.

Qemu in Entropy didn't worked as it should be, if it is installed remove it, and emerge:

Code: Select all

equo remove qemu --ask
emerge --sync
emerge portge   
emerge qemu

It takes time, but after that you can freeup memory and safely:

Code: Select all

sync ; echo 3 > /proc/sys/vm/drop_caches ; qemu -hda /dev/sda

Reboot to SystemRescueCD.

If bootup is successful you will see an asciiart red logo and a list of possible instructions. Start networking. Mount a partition that will keep your backup image, for Sabayon 5.2 fresh installation, 2-3 GB is needed.

I use my /home on a separate partition /dev/sda10 to keep image, so:

Code: Select all

mkdir -p /mnt/sda10
mount -t ext4 /dev/sda10 /mnt/sda10

Start Partimage:

Code: Select all


Follow instructions. Name of backup image should be /mnt/sda10/lasthope. If you chose bzip2 compression, current version of Partimage displays a message about a bug preventing you from automatically restore MBR. But you need to restore MBR only after installation of Windows.

After partimage started, switch to next tty via Ctrl+Alt+F2 and type:

Code: Select all


Here you can start Firefox, and after time passed, check if all done (Ctrl+Alt+F1). I used Accesories -> xarchiver to add my /home/username to 7z archive too.

Post Reply