https://wiki.sabayon.org/index.php?titl ... _Partition
and this:
https://wiki.sabayon.org/index.php?titl ... tore_Grub2
With a try to change the /dev/sdaX names according to my partition table.
_________________________________________________________________________________
My first partition (primary) which is sda1 is windows XP
My second partition (primary) sda2 was another linux distro, here I was testing a lot of them.
My third partition (primary) sda3 was the boot /boot for sabayon, always there, never touched : o )
When testing distros was easy to boot them as I was installing them in /dev/sda2, the "/" grub also included in /dev/sda2 and I had to just mark the /dev/sda2 as bootable.
So, in this way, the MBR was never touched, which is a good thing from my own point of view.
If something went wrong, with the experimental distro from /dev/sda2 then, I could easy revert back,
marking the /dev/sda3 as bootable, as there was the sabayon grub installed expecting me ; o ) and I could easly acces windows, sabayon linux or other distros.
The other partitions are logical.
The first logical partition has the "/" for sabayon which is encrypted. This is a second reason for using a /sda3 for /boot.
The second logical is swap encrypted
The third one is ntfs data related.
Now, I have finished my "distro-testing" and swiching, at least for the moment and I merged sda1 with sda2, making my sda1 larger. So now my first ntfs partition sda1 is bigger and can fit a ubuntu with wubi install.
The problem appeard as sda3 is now called sda2 and sabayon dosen't boot anymore.
I have booted the live cd and hit the installer icon, I reinstalled grub from there but it dosen't work, and I think it touched my mbr. Anayway, I restored my original mbr from a backup, but I need to reinstall the grub because I really wish to boot sabayon linux.
>>> I have gived some tries for restoring grub, with chroot from sabayon live cd and from ubuntu but I wasn't able to restore it.
Please tell me the exact chain commands I have to give in this scenario, I am sure that I am doing something wrong but it don't know what. <<<
- Code: Select all
wolfy@ubuntu:~$ sudo su
[sudo] password for wolfy:
root@ubuntu:/home/wolfy# cd /mnt/
root@ubuntu:/mnt# ls
boot enc
root@ubuntu:/mnt# rm -f enc/
rm: cannot remove `enc/': Is a directory
root@ubuntu:/mnt# man rm
root@ubuntu:/mnt# rm -rf enc/
root@ubuntu:/mnt# ls
boot
root@ubuntu:/mnt# fdisk -lu
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x62d363a6
Device Boot Start End Blocks Id System
/dev/sda1 * 64 142946369 71473153 7 HPFS/NTFS/exFAT
/dev/sda2 142946370 143572904 313267+ 83 Linux
/dev/sda3 143572905 976768064 416597580 5 Extended
/dev/sda5 143572968 227544659 41985846 83 Linux
/dev/sda6 227544723 231737624 2096451 82 Linux swap / Solaris
/dev/sda7 231737688 976768064 372515188+ 7 HPFS/NTFS/exFAT
Disk /dev/sdb: 8016 MB, 8016363520 bytes
255 heads, 63 sectors/track, 974 cylinders, total 15656960 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x72f0e0f4
Device Boot Start End Blocks Id System
/dev/sdb1 * 63 15647309 7823623+ b W95 FAT32
root@ubuntu:/mnt# ls
boot
root@ubuntu:/mnt# mkdir sabayon
root@ubuntu:/mnt# ls
boot sabayon
root@ubuntu:/mnt# rm -rf sabayon/
root@ubuntu:/mnt# mkdir -p sabayon
root@ubuntu:/mnt# ls
boot sabayon
root@ubuntu:/mnt# cd /mnt/
root@ubuntu:/mnt# cryptsetup luksOpen /dev/sda5 encrypted
Enter passphrase for /dev/sda5:
root@ubuntu:/mnt# mount /dev/mapper/encrypted /mnt/sabayon/
root@ubuntu:/mnt# ls
boot sabayon
root@ubuntu:/mnt# cd sabayon/
root@ubuntu:/mnt/sabayon# ls
bin dev home lib media opt root sbin tmp var
boot etc install-data lost+found mnt proc run sys usr z
root@ubuntu:/mnt/sabayon# cd ..
root@ubuntu:/mnt# mount /dev/sda2 /mnt/boot/
root@ubuntu:/mnt# ls
boot sabayon
root@ubuntu:/mnt# mc
root@ubuntu:/mnt# mount -t proc none /mnt/sabayon/proc/
root@ubuntu:/mnt# mount -o bind /dev /mnt/sabayon/dev
root@ubuntu:/mnt# chroot /mnt/sabayon/ /bin/bash
ubuntu / # env-update
>>> Regenerating /etc/ld.so.cache...
ubuntu / # ls
bin dev home lib media opt root sbin tmp var
boot etc install-data lost+found mnt proc run sys usr z
ubuntu / # source /etc/profile
ubuntu / # export PS1="(chroot) $PS1"
(chroot) ubuntu / # grep -v rootfs /proc/mounts > /etc/mtab
(chroot) ubuntu / # cp /proc/mounts /etc/mtab
(chroot) ubuntu / # grub2-install /dev/sda2
/sbin/grub-probe: error: no such disk.
Auto-detection of a filesystem of /dev/mapper/encrypted failed.
Try with --recheck.
If the problem persists please report this together with the output of "/sbin/grub-probe --device-map="/boot/grub/device.map" --target=fs -v /boot/grub" to <bug-grub@gnu.org>
(chroot) ubuntu / #
