Difference between revisions of "HOWTO: booting Sabayon CoreCD image from a USB flash with Syslinux"
(Corrected "Unetbooting" to "UNetbootin" and added hyperlink to the UNetbootin home page.)
Latest revision as of 05:36, 30 January 2011
You need +512MB USB flash and .iso of Sabayon CoreCD (here: 5.2 x86).
You get CoreCD installed on one of extended partitions, Sabayon will be working.
It is recommended to backup: HOWTO: separate boot partition with PartedMagic and Clonezilla (dedicated GRUB2 partition)
Install using UNetbootin is a much more preferable way. This HOWTO is about manual install using Syslinux (you have to install Syslinux package during process)
0. Prepare ext4 extended partition to hold CoreCD (here: /dev/sda6). 12GB should be enough.
1. Insert USB flash, run mount:
$ su # mount
to find where your USB flash is mounted (here: /dev/sdb1 on /media/disk). Unmount it
# umount /media/disk
2. (!) From here and ahead, be careful when writing something like /dev/sdb or /dev/sdb1. Because /dev/sda is your first HDD, and many commands here could make it unbootable. Also, there is a difference in /dev/sdb (USB flash device) and /dev/sdb1 (partition of that device), don't spend time changing this.
Create one primary boot partition
# fdisk -cu /dev/sdb
Useful commands of fdisk are: p - partition table d - delete partition n - create partition a - toogle boot flag w - save and exit
# fdisk -lu /dev/sdb Device Boot Start End Blocks Id System /dev/sdb1 * 2048 8000306 3999129+ 83 Linux
Create FAT 32 file system (use FAT 16 for -4GB)
# mkfs.vfat -F 32 /dev/sdb1
3. Install MBR from syslinux on USB flash
# equo install syslinux # dd if=/usr/share/syslinux/mbr.bin of=/dev/sdb
Mount USB flash
# mkdir -p /mnt/usb # mount -t vfat /dev/sdb1 /mnt/usb
Mount .iso (here: Sabayon_Linux_CoreCD_5.2_x86.iso)
# mkdir -p /mnt/cdrom # mount -o loop,ro -t iso9660 /media/sda10/tmp/Sabayon_Linux_CoreCD_5.2_x86.iso /mnt/cdrom
# cp -r /mnt/cdrom/* /mnt/usb # mv /mnt/usb/isolinux/* /mnt/usb # mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg # rm -rf /mnt/usb/isolinux*
Install syslinux on USB flash
# syslinux /dev/sdb1
Test a newly created USB using QEMU
# umount /dev/sdb1 # sync ; echo 3 > /proc/sys/vm/drop_caches ; qemu -usb /dev/sdb1
4. Boot from Sabayon 5.2 CoreCD USB flash.
If it writes something, wait. If it wanting you to select graphical mode, try 800x600 - works for sure. After booting, start installer and follow instructions. Install CoreCD to extended partition (here: /dev/sda6) by choosing a "/" (root) mount point.
(optional) If you followed HOWTO about backup, you already have a separate boot partition (here: /dev/sda1) with GRUB2. So, do not install bootloader to MBR, but install at root.
Reboot to your old Sabayon, open /boot/grub/grub.cfg on CoreCD (!) partition, and find 2 menu entries for CoreCD, they boot from different (hd0,?) and are started at
### BEGIN /etc/grub.d/10_linux ###
Copy them to /etc/grub.d/40_custom. Remove old grub.cfg (make a backup of it!), and generate a new grub.cfg
# rm /media/sda1/boot/grub/grub.cfg # grub-mkconfig -o /media/sda1/boot/grub/grub.cfg
Test changes using QEMU
# sync ; echo 3 > /proc/sys/vm/drop_caches ; qemu -hda /dev/sda