LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-13-2009, 10:20 AM   #1
niteshadw
Member
 
Registered: Sep 2002
Distribution: CentOS
Posts: 170

Rep: Reputation: 15
Grub on USB with multiple partitions


I have a live linux distro setup on my usb drive using unetbootin. However, I wanted to split the drive and extract windows xp install files so I could use the usb to either install linux (which works) or select from grub menu to install windows.

My problem is how do I point grub to the second partition on the usb (and possibly execute the setup.exe)

My syslinux.cfg looks as:

default vesamenu.c32

prompt 0

menu title UNetbootin

timeout 100



label unetbootindefault

menu label Default

kernel /ubnkern

append initrd=/ubninit file=/cdrom/preseed/mint.seed boot=casper quiet splash --



label ubnentry0

menu label Start Linux Mint

kernel /casper/vmlinuz

append initrd=/casper/initrd.gz file=/cdrom/preseed/mint.seed boot=casper quiet splash --



label ubnentry1

menu label Start Linux Mint in compatibility mode

kernel /casper/vmlinuz

append initrd=/casper/initrd.gz file=/cdrom/preseed/mint.seed boot=casper xforcevesa ramdisk_size=1048576 root=/dev/ram rw noapic noapci nosplash irqpoll --



label ubnentry2

menu label Memory Test

kernel /isolinux/memtest

append initrd=/ubninit



label ubnentry3

menu label Boot from local drive

kernel /ubnkern

append initrd=/ubninit

label ubnentry4
menu label Boot Windows XP Setup
chainloader (hd0,2)

Not sure what to add for ubnentry4?

Thanks!
 
Old 01-15-2009, 05:31 AM   #2
manwithaplan
Member
 
Registered: Nov 2008
Location: ~/
Distribution: Arch || Sidux
Posts: 393

Rep: Reputation: 45
First off your using unetbootlin which I find completely restrictive w/ syslinux. I very recently just built a LiveUSB with multiple utilities, and Sabayon 4 using Grub. First off I would rebuild your LiveUSB with grub. Just as a footnote, Window's only recognizes the first partition of your USB drive.
My setup is as follows:
Quote:
/dev/sdc1 NTFS 2048MB Empty- used for readyboost on Win7
/dev/sdc2 BOOT EXT3 3.5GB Sabayon LiveDVD
/dev/sdc3 EXT3 350MB Partition Magic Linux 3.x
/dev/sdc4 EXT3 100MB Clonezilla
I loaded grub by creating a /boot/grub directory in sdc2, and copied my grub files from my HDD into the folder.
Then I ran this in prompt:
Quote:
# grub --no-floppy

grub> find /boot/grub/stage1
(hd0,0)
(hd2,1)

grub> root (hd2,1)

grub> setup (hd2)
This writes a grub MBR to the USB drive and maps it to the second partition on the USB that has my menu.lst, and grub files.

From there I just edited menu.lst for my additional partitions. Make sure you double check your geometry in grub, and your device.map file in your USB grub folder, to correlate with the menu.lst entries.
Here's some entries from my menu.lst on my USB:
Quote:
default 0
timeout 5
splashimage=(hd0,1)/boot/grub/64254-dangeroustoleanout.xpm.gz

title Sabayon LiveDVD 4.0
root (hd0,1)
kernel /boot/sabayon root=/dev/ram0 aufs init=/linuxrc cdroot=/dev/sdb2 looptype=squashfs max_loop=64 loop=/livecd.squashfs splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 scandelay quiet--
initrd /boot/sabayon.igz
boot

title Clonezilla
root (hd0,2)
kernel /live/vmlinuz1 boot=live union=aufs live-media-path=/live vga=788 toram bootfrom=/dev/sdb3 ip=frommedia
initrd /live/initrd1.img
boot
I would try chainloading the XP setup from Grub
Quote:
title XP Setup
root (hd0,3) ### Wherever your setup files are
chainloader +1

Last edited by manwithaplan; 01-15-2009 at 06:26 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB menu.lst/grub.conf file with multiple partitions dasy2k1 Linux - General 1 04-19-2007 08:42 AM
Mounting USB external drive with multiple partitions, USB bluetooth mouse xmeson Slackware 7 12-17-2006 09:00 AM
How to view the partitions of USB drives in Grub prompt? rajasekaran Linux - Software 1 06-13-2006 03:32 PM
[SOLVED] Making multiple partitions on USB memory stick ctkroeker Linux - Hardware 1 06-16-2005 12:20 AM
Exteral USB hard drive with multiple partitions moxx Linux - Hardware 5 05-02-2004 02:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration