LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-30-2013, 07:42 AM   #1
SamSlam023
LQ Newbie
 
Registered: Mar 2013
Posts: 22

Rep: Reputation: Disabled
USB GRUB Select different Operating Systems


I recently had the idea to have a USB with with gparted, clonezilla, win 7 install partitions and use GRUB to select which os I want to boot into. This will save me having to burn discs and temporarily install a cd drive into computers.

I have a little experience with linux and even less with GRUB.

Firstly, can this be done?

I have tried many guides on doing this but something always goes wrong.

What I do is, format a ext2 partition on the USB then give it a file system and mount it.

This is when I start to run into problems. I have an Ubuntu server running. I copy /boot/grub into usbmount/boot/

The problem is, the tutorial asks me to edit menu.lst which doesn't exist in my situation. I also cant find some other things that are mentioned in tutorials such as stage1. I have tried looking in the grub folder of mint and ubuntu desktop and still could not find them. I tried just making my own menu.lst file and continue from there but that still did not work.

These are the guides that I have been trying to follow.

http://ubuntuforums.org/showthread.php?t=1163686

http://forums.opensuse.org/english/g...usb-drive.html

Is there a way for me to get this working? Or is there a better way of going about this?
 
Old 05-30-2013, 08:01 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,252

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
Maybe use "syslinux" for that. I think with grub this is also possible, but I did not tested it. First you need to make your flash drive bootable, for example I used "unetbootin" to copy Ubuntu and syslinux to pendrive. Next you should look into config file "syslinux.cfg" in main directory, there are instructions for bootloader what to do. Displaying menu, submenu, colors, etc. you can move system images to own directories and edit config file accordingly.
 
Old 05-30-2013, 09:56 AM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
The first problem you are having is that you are using Ubuntu with Grub2 installed and reading/using tutorials meant for Grub Legacy. Note the dates on the tutorials. Are you wanting to just have the GParted and Clonezilla Live CDs on a flash. That should be pretty easy with either Grub Legacy or Grub2, or Syslinux. Are you planning to use Grub2?

After creating the partition on the flash drive and formatting it, I would suggest you create a boot directory and a grub sub-directory under boot and copy the files from /usr/lib/grub/i386pc to the Grub directory you created. You will need to manually create a grub.cfg file or you can copy the grub.cfg file from your installed system and remove all of the menuentry lines and create new entries for gparted and clonezilla.

After doing that, loop mount gparted and clonezilla and copy the directories/files from each to the root of the flash drive. Open the isolinux.cfg or syslinux.cfg file to look at the entries there. You will need to copy and modify them to work in Grub2.

Below is an entry I used to boot Clonezilla from a flash. You may need to change the set root entry from (hd0,) as well as the bootfrom=/dev/sdb1 is sdb1 is not what your flash shows as.

Quote:
menuentry "Clonezilla" {
set root=(hd0,1)
linux /live-hd/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" ocs_live_keymap=\"\" ocs_live_batch=\"no\" ocs_lang=\"\" ip=frommedia nosplash live-media-path=/live-hd bootfrom=/dev/sdb1 toram=filesystem.squashfs
initrd /live-hd/initrd.img
}
Repeat the process for GParted and then install Grub2 to the mbr of the flash drive.

I'm not sure what you mean by a win 7 install partition, just the install CD??

Last edited by yancek; 05-30-2013 at 11:06 AM.
 
1 members found this post helpful.
Old 05-31-2013, 09:53 PM   #4
SamSlam023
LQ Newbie
 
Registered: Mar 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Thank you, I'll give that a go today.

Yes, just the Windows install CD. Would this be the same process as adding gparted? I imagine this would get kinda messy as we are installing these all on the same partition.

It might also be useful to have an actual install of ubuntu desktop or mint (not a live cd) on the USB. I managed to do this with another USB so I could use this program at school to program my Arduino. Would this be too difficult to get working on the same USB with clonezilla and gparted?

I will try to just get clonezilla and gparted working today and work on adding windows install and mint later...
 
Old 05-31-2013, 10:18 PM   #5
SamSlam023
LQ Newbie
 
Registered: Mar 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Also I am happy to use any bootloader. I would prefer to use Grub2 as most things use that (I think) so it might be useful learning how that works.
 
Old 05-31-2013, 11:23 PM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Grub2 will work for what you intend. I have no idea about windows as I rarely use it and have never tried to put it on a flash drive.
You should be able to do an actual install of Ubuntu plus the Live CD installs of clonezilla and gparted, even on the same partition. Bear in mind that a full install of Ubuntu or Mint will take about 5GB so you will need an 8GB flash or larger, probably larger if you are going to windows on it although I have no idea how large a windows install CD/DVD is. If you want a full install of Ubuntu/Mint on the flash, just make sure you select the correct drive/partition and install Grub2 to the mbr of the flash which will eliminate the need to do the copying of grub files I refer to above with clonezilla and gparted.

Last edited by yancek; 05-31-2013 at 11:38 PM.
 
1 members found this post helpful.
Old 06-01-2013, 03:43 AM   #7
SamSlam023
LQ Newbie
 
Registered: Mar 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Would I have different partitions for clonezilla and gparted and change the partition in the menu entry where it says "bootfrom=dev/sde1" for each?
 
Old 06-01-2013, 06:52 AM   #8
SamSlam023
LQ Newbie
 
Registered: Mar 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
I installed ubuntu desktop 12.04 to the USB. I made a ext2 partition on the usb (sdd2) and made the filesystem ext2. I mounted that partition and copied all the contents of my cloneszilla live cd onto the sdd2 partition. I then edited the grub.cfg on the ubuntu partition (sdd1) in /boot/grub. This was when I was not sure of. I found a part where it had other menu entries and added the one you made. I changed bootfrom to sdd2 and left hd0. How do I check what root entry to use? Also do I need to edit the grub.cfg to actually display my boot options or something?
 
Old 06-01-2013, 04:25 PM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Quote:
Would I have different partitions for clonezilla and gparted and change the partition in the menu entry where it says "bootfrom=dev/sde1" for each?
I don't have Clonezilla or Gparted iso files to check. What you could do is create a mount point for each and loop mount them and compare the directories/files in the root of each filesystem. In the directory where Clonezilla/Gparted are create the mount point: sudo mkdir clonezilla. sudo mkdir gparted. Then loop mount: mount -o loop clonezilla.iso clonezilla. You need the exact name of the clonezilla iso. The same for gparted. Compare the directories/files. If their are files with the same name, you should put them on separate partitions.

How are you trying to boot the flash drive? Do you set it to first boot priority in the BIOS.
Change the set root to (hd0,2). I'm not sure that will work and don't know why it worked when I did it. If it was on sdb2 the root entry should have been (hd1,2)?? You will need to look in the isolinux.cfg file for Gparted. The entry for clonezilla is not likely to work.

The menu you see when you boot a system with Grub is what you have in the grub.cfg file, the individual menuentry sections so yes, that is what you need to edit.
I remember having more difficulty getting Clonezilla to boot than any other system I tried. About the only thing I could suggest it try different options. You might go to the Clonezilla forums and see what you can find. That's where I got the entry I posted above but, unfortunately I no longer have the link.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting up USB operating systems under Grub katesfb Linux - Newbie 6 05-19-2009 08:25 PM
Installing GRUB with many operating systems. JoseCuervo Linux - Newbie 7 09-07-2008 11:19 AM
GRUB showing 6 operating systems Controlpanel Linux - Newbie 2 09-21-2007 12:33 PM
order of operating systems in GRUB bootlaoder marvelade Linux - General 2 04-06-2007 03:07 PM
GRUB and Multiple operating systems jughead Linux - Software 2 11-21-2005 04:36 PM


All times are GMT -5. The time now is 04:46 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration