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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-23-2011, 07:41 PM
|
#1
|
LQ Newbie
Registered: Mar 2011
Posts: 3
Rep:
|
Chainloading from Grub2 to syslinux on a USB drive
Alright, what I thought would be a simple task has me tied in knots.
I wanted to make a multiboot USB flash drive that I could easily manipulate to switch to various distros easily. My plans were:
1. Partition my 8GB drive to one large first partition (5GB) so that windows could access it. (P.S. GParted didn't partition correctly, needed to use fdisk. THIS MIGHT BE IMPORTANT IN SOLVING THE PROBLEM BECAUSE THERE MIGHT BE A BLOCK ERROR). I then made an extended partition with 5 500MB logical partitions.
2. Install Grub2 to MBR from Ubuntu
3. Expand ISO's of varios distros (Acronis Recovery, Puppy linux, etc.)
to the partitions, and create syslinux.cfg files for each (from the isolinux.cfg files that were already there)
4. Install syslinux to each partition's boot sector
Code:
#syslinux /dev/sdb5...
5. make grub.cfg on /dev/sdb1 chainload each partition.
THE GRAND PROBLEM:
Grub2 loads, but when selecting what I want to boot, I get the error
Boot error
which is syslinux, not grub2. So I know it's chainloading, but syslinux doesn't seem to find ldlinux.sys.
Any ideas?
P.S. I'm not asking for other ways to make a multiboot drive, I know I can just direct boot from Grub2, but I want to be able to pass the boot to the boot loaders on the other logical partitions.
|
|
|
03-24-2011, 05:39 PM
|
#2
|
LQ Newbie
Registered: Mar 2011
Posts: 3
Original Poster
Rep:
|
Anybody?
I found this page that someone has got this to work with a similar method:
http://comptb.cects.com/67-multi-boo...x-and-grub4dos
I followed his instructions to no avail...
Maybe my bios is messed up and won't forward CHS information in a chain boot.
|
|
|
03-24-2011, 06:00 PM
|
#3
|
LQ Veteran
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
|
If I understand what you are trying to do you can test each procedure. Test one of your distros installed by itself and make sure it will boot on startup. That should eliminate any bios questions. I can not help because I still have problems building single distro usb live from scratch. It seems each one has its odd ways.
|
|
|
03-24-2011, 08:10 PM
|
#4
|
Member
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174
Rep:
|
Well this howto you're referring to strikes me as a very messy one.
Another thing I don't get: why use Windows and GRUB4DOS to accomplish things which are easier to accomplish using native linux utils and from Linux itself?? Especially when all the thing is about booting various Linux distros?
Finally, why not try to use GRUB2 to boot directly from the ISO? That would take only 1 partition.This approach works fine for me to boot multiple distros without resorting to this highly suspectful configuration with multiple partitions on a USB drive, some of them even being logical discs...
OK, since you're set to stick to this idea, there is one thing you must try:
When you boot from the stick (after configuring your BIOS to boot from USB stick), you get into GRUB2 menu.
Good! Then you can press C to get into the GRUB prompt and from here you'll be able to actually see what can work and what can't.
So, in GRUB2 prompt you type `help`, which gives you the list of commands. You can print them out first from the online man page, though.
Then you have the `ls` command to list all available drives. OK, much better now!
Then you can `ls (hdX,Y)/` to see what's there on the drive. Just like searching the directory from BASH.
Thus you will be able to see which partitions are visible to your GRUB, and which (alas!) are not.
Once you make sure that ALL your partitions are visible to GRUB, that's a great relief.
Then try to issue your commands from your grub.cfg, but now from command line. You'll see which command fails. When you finally give your command `chainloader +1`(for example), GRUB will either swallow it, or give off error. If no error, the you type `boot` and see what happens. If it doesn't, then you'll have to spend I don't know how much time trying to figure out what is wrong with syslinux loader on the given partition...
then if nothing helps you can try the trick with installing syslinux into MBR and copying the bootsector into GRUB config folder and reinstall GRUB. It will point to the needed files on the partition to boot, given the partition is available to boot from.
But I must admit, the idea of booting from LOGICAL DISKS seems to be the most vulnerable point here. I never use logical disk even on HDD, let alone USB sticks, let alone making them bootable.
|
|
|
03-28-2011, 03:39 AM
|
#5
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,639
Rep: 
|
Quote:
Originally Posted by kostya
...the idea of booting from LOGICAL DISKS seems to be the most vulnerable point here. I never use logical disk even on HDD, let alone USB sticks, let alone making them bootable.
|
I do that since the paleolithic at least  . No honestly, no problem at all with that. And Linux does need no bootable flag at all. "fdisk" even complained recently that I should cease and desist with this deprecated cr*p (it found an old flag on a disk I just wanted to reorganize...). For win* you can use GRUB's "map" and or "hide" command(s) to tell it which partition is "C:\"
Last edited by JZL240I-U; 03-28-2011 at 03:41 AM.
|
|
|
03-29-2011, 06:28 AM
|
#6
|
Member
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174
Rep:
|
Quote:
Originally Posted by JZL240I-U
I do that since the paleolithic at least  . No honestly, no problem at all with that.
|
Really? Well for you  . Well I got done with logical disks after I changed my big HDD partition table into GPT. Just read about it online and liked the idea right away; and also I'm a great fan of new technologies, so I do it all rather for the fun of it, than for real necessity... So now I can have as many primary partitions as I like. Cool!
(And everything except Solaris and Windows XP can boot from a GPT partition. And one hardly needs Solaris on one of his GPT partitions, as the coolest feature of Solaris is their ZFS, which makes sense with really LARGE disks...)
Quote:
And Linux does need no bootable flag at all. "fdisk" even complained recently that I should cease and desist with this deprecated cr*p (it found an old flag on a disk I just wanted to reorganize...). For win* you can use GRUB's "map" and or "hide" command(s) to tell it which partition is "C:\"
|
Yeah, GRUB is cool. It took me about 1 year to get used to it, but then I understood its advantages. Meantime the developers made it more usable... And GRUB2 is even cooler than GRUB legacy. It can even boot from an ISO mapping a loopback mounted image to a "drive". Instead of "find" command it has "ls" command, which is more handy when you're booting from the prompt and are not sure about the name of the kernel image, which can be something like "vmlinuz-image-generic-2.6.38.22-2.fc13.i686.img" and you just didn't look it up before your bootloader crashed. And the grub "find" command doesn't support wildcards  .
BTW, since you have that great experience: is it possible to save boot sector of a *iso CD/DVD image? Or, alternatively, how can the boot image code be found on the CD? That would make multibooting from USB stick way easier to organize.
Last edited by kostya; 03-29-2011 at 06:36 AM.
|
|
|
03-29-2011, 09:32 AM
|
#7
|
LQ Newbie
Registered: Mar 2011
Posts: 3
Original Poster
Rep:
|
Alright, I actually got this to work.
There's a known bug that both grub legacy and grub 2 are affected by. They don't share CHS information with bootloaders that reside in logical partitions. There was a patch written back in 2008, but I don't have the patience to recompile grub.
http://bugs.gentoo.org/230905
BUT....
Grub4DOS can do this becasue it's not affected by this bug. So I'm just using syslinux as the MBR bootloader (so I can retain CHS info), then chainloading to grub from syslinux, and then chainloading from grub4dos to all other partitions, and it works.
|
|
|
04-04-2011, 04:15 AM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,639
Rep: 
|
Quote:
Originally Posted by kostya
...BTW, since you have that great experience: is it possible to save boot sector of a *iso CD/DVD image? Or, alternatively, how can the boot image code be found on the CD? That would make multibooting from USB stick way easier to organize.
|
I'm not really experienced, I just like to learn and so my number of posts is just due to lots of curious questions  .
AFAIK an iso (CD/DVD) doesn't have any boot sector. An optical disk is made bootable with programs like isolinux http://syslinux.zytor.com/wiki/index.php/ISOLINUX. HTH.
<edit> Here http://www.dedoimedo.com/computers/kiwi.html is another nice article with lots of links </edit>
Last edited by JZL240I-U; 04-04-2011 at 06:10 AM.
|
|
|
All times are GMT -5. The time now is 02:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|