Grub on a stick
This was posted on the OpenSolaris discuss list, it explains how to install grub on a usb stick in Solaris, figure I would archive it here so I can find it later when I need it, also it may help someone else who knows….
---------- Forwarded message ----------
From: Magnus Forsberg
To: opensolaris-discuss@HIDDEN
Date: Wed, 24 Aug 2005 07:22:16 -0700 (PDT)
Subject: [osol-discuss] HOWTO: Installing GRUB on USB stick
Installing GRUB on USB stick
--------------------------------
tested on Solaris Express Community Release b20
I wrote this guide for installing GRUB on my USB stick. Maybe someone will find it useful. Comments or suggestions for improvement are welcome.
The following steps will install GRUB on a USB stick. If the USB stick is inserted the GRUB menu will appear, if not XP will boot automatically. Remember to configure your BIOS to boot from USB.
Stop Volume Management
----------------------
# svcadm disable -t system/filesystem/volfs
Find USB stick paths
--------------------
# rmformat
...
2. Logical Node: /dev/rdsk/c2t0d0p0
Physical Node: /pci@0,0/pci1014,52e@1d,7/storage@4/disk@0,0
Connected Device: SanDisk Cruzer Micro 0.2
Device Type: Removable
Bus: USB
Size: 977.5 MB
Label:
Access permissions:
...
Create partitions on USB stick
------------------------------
# fdisk /dev/rdsk/c2t0d0p0
Cylinders
Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Active Solaris2 1 97 97 10
2 Win95 FAT32 98 976 879 90
Create FAT-32 filesystem on USB partition 2
-------------------------------------------
# mkfs -F pcfs -o fat=32 /dev/rdsk/c2t0d0p0:c
Construct a new FAT file system on /dev/rdsk/c2t0d0p0:c: (y/n)? y
Create slice for /boot
----------------------
# format -e
1. c2t0d0
/pci@0,0/pci1014,52e@1d,7/storage@4/disk@0,0
...
Part Tag Flag Cylinders Size Blocks
0 root wm 1 - 94 94.00MB (94/0/0) 192512
...
Create UFS filesystem on /boot slice
------------------------------------
# newfs -v /dev/rdsk/c2t0d0s0
Install Master Boot program (is this step actually needed)?
-----------------------------------------------------------
# fdisk -b /usr/lib/fs/ufs/mboot -n /dev/rdsk/c2t0d0p0
Install GRUB on USB stick
-------------------------
bash-3.00# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c2t0d0s0
Updating master boot sector destroys existing boot managers (if any).
continue (y/n)?y
stage1 written to partition 0 sector 0 (abs 2048)
stage2 written to to partition 0, 228 sectors starting 50 (abs 2098)
stage1 written to master boot sector
Create GRUB boot directories
-----------------------------
# mount /dev/rdsk/c2t0d0s0 /mnt/usb
# mkdir -p /mnt/usb/boot/grub
Copy GRUB files to USB stick
----------------------------
# cd /boot/grub
# find . -print -depth | cpio -pdumv /mnt/usb/boot/grub
Mounting the FAT-32 partition
-----------------------------
# mount -F pcfs /dev/dsk/c2t0d0p2 /mnt/fat
Laptop internal HDD Dual Boot partitioning
------------------------------------------
Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Active IFS: NTFS 0 13004 13005 34 (windows xp)
2 Solaris2 13005 18084 5080 13 (main solaris 11)
3 Win95 FAT32 18085 18859 775 2 (shared storage)
Update GRUB boot menu (hd1 is internal HDD0 where Solaris is installed)
-----------------------------------------------------------------------
# cat /mnt/usb/boot/grub/menu.lst
...
title Solaris 11
root (hd1,1,a)
kernel /platform/i86pc/multiboot
module /platform/i86pc/boot_archive
...
title Windows XP Professional
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1
...
留言列表