LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 08-05-2017, 09:19 PM   #1
awayand
LQ Newbie
 
Registered: Aug 2017
Posts: 3

Rep: Reputation: Disabled
Wink Booting hard disk partition from syslinux on USB stick


I am trying to get syslinux on an USB stick to boot my linux installation on one of the hard drive partitions.

Since syslinux is booting from the USB stick, I need to tell it that the root/boot device is the hard drive, but cannot find the command responsible for this. In grub, the command would be "root (hd0,0)" for example for the first HD, first partition.

Anyone know how to accomplish this in syslinux?
 
Old 08-07-2017, 03:45 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by awayand View Post
Anyone know how to accomplish this in syslinux?
i'd start by reading syslinux documentation.
stored locally on your machine (man syslinux) or online:
http://www.syslinux.org/wiki/
 
Old 08-07-2017, 05:06 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
http://www.syslinux.org/wiki/index.php?title=Config

"Here is a simple example of a Syslinux configuration file, with one entry to boot a Linux kernel:

DEFAULT linux
SAY Now booting the kernel from SYSLINUX...
LABEL linux
KERNEL vmlinuz.img
APPEND ro root=/dev/sda1 initrd=initrd.img
"

sdxn being relative to your boot order.
 
Old 08-07-2017, 06:48 PM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
@ awayand

since that is your first post, you have done well to know about syslinux but may not know there are dedicated live cds that can boot
--normally the first partition but it can be editted.

a more useful question might be, how did you install linux on your partition
and why did you not try to install a bootloader?

if you care to name the partition and the linux distro you installed, the bigger distros tend to have "recovery" options in their live cds.
 
Old 08-16-2017, 11:19 PM   #5
awayand
LQ Newbie
 
Registered: Aug 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
@jefro

Thanks a lot for your reply. I probably should have been more clear about my question, my apologies. I have seen this configuration snippet, but unfortunately it doesn't work for me. The APPEND option that specifies the root partition is used *AFTER* the kernel becomes active, my problem is I need to tell syslinux *WHERE* the kernel is in the first place. Grub uses the "root(x,y)" command for this, but I couldn't find the equivalent anywhere in the syslinux documentation.

@ondoho

Congratulations on almost 6000 posts, if they are all advice on "rtfm" I am not so sure if that is a real accomplishment.

@aus9

I installed linux with a bootloader in the MBR as part of a dual-boot setup, but when I re-installed Windows, it wiped the MBR and so I never really bothered to mess with it nor did I have time to figure out how to boot back onto my linux partition - until now.

Thanks everyone for replying to my post, especially those that were really trying to help!
 
Old 08-17-2017, 12:47 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by awayand View Post
@ondoho

Congratulations on almost 6000 posts, if they are all advice on "rtfm" I am not so sure if that is a real accomplishment.
i did nothing of the sort, certainly not the 'f' you are implying.
it is your choice to be offended by it, and not my intention.
it is a valid response (which you chose to ignore), and i'm sure somebody else would have pointed it out if i hadn't done so.

congratulations on your second post btw.
if you keep antagonizing people at this rate, i am not so sure you will get much benefit from posting here.
 
Old 08-17-2017, 04:58 AM   #7
awayand
LQ Newbie
 
Registered: Aug 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
no offense taken, but you have to admit, your post did nothing to contribute to the discussion. Sending a link to the syslinux documentation page that can be easily googled is absolutely unnecessary - especially in a linux forum where people usually know what google is. put yourself into my shoes for a second, I am searching online for help, I take the time to register on a forum and type out my question, do you _really_ think that I don't know how to google the _standard documentation_ of syslinux? And if I am supposedly that clumsy that I cannot find the _homepage_ of syslinux, how do you expect me to read through the documentation and understand it? Considering this, wouldn't you agree that my interpretation of your post is at worst passive-aggressive (rtfm), and at best a misguided attempt to help me and thus a waste of time?
I am not offended, but saying you "did nothing of the sort" (rtfm) when your first response to me is "i'd start by reading syslinux documentation." is a little bit of a stretch.

if you really want to help in this forum, why don't you invest the time in actually reading the documentation, if you are so tech-savvy, and share some ideas/pointers instead of simply replying with "i'd start by reading the documentation"? if it turns out that you cannot find the solution, either, wouldn't you agree that "read the documentation" was useless advice to begin with?
 
Old 08-17-2017, 02:04 PM   #8
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
I'm guessing that you need to copy the vmlinuz and initrd files from the linux install onto the USB drive.

From http://www.syslinux.org/wiki/index.php?title=SYSLINUX

SYSLINUX also supports a boot-time-loaded ramdisk (initrd). An initrd is loaded from a DOS file if the option "initrd=filename" (where filename is the filename of the initrd image; the file must be located in the root directory on the boot floppy) is present on the processed command line (after APPEND's have been added, etc.).

If you don't have any means to read the linux install's file system, then we might still be able to provide a suitable vmlinuz/initrd pair that's close enough - if you can remember what distribution+version of linux was installed, as well as whether it was 32 bit or 64 bit. Generally, it's okay to have a vmlinuz/initrd that's a bit older than whatever was the latest the system was updated to.

Personally, though, I'd rescue the system using a liveCD or liveUSB, or even doing a minimal install onto a USB drive from a normal CD install. I have one minimal Debian install on a 1GB USB thumbdrive which is mainly useful for just booting into things. My procedure is:

1) Power down the problem computer

2) Plug in my minimal debian 1GB USB thumbdrive

3) Power on and tell the BIOS to boot from it (if necessary)

4) Log in as root; run the following statements:

Code:
update-grub
shutdown -r now
"update-grub" will autodetect any linux and Windows installs on any internal or external drives, and create boot menu entries for all of them.

"shutdown -r now" just tells the machine to reboot now.

5) Select the desired boot option in GRUB

6) Fix stuff as necessary. If I'm reinstalling the linux bootloader, the commands would be:

Code:
grub-install /dev/sda
update-grub
Before doing "update-grub", removing the USB thumbdrive can be convenient so it does NOT add a menu entry for it.
 
Old 08-17-2017, 02:44 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I feel my solution would work if you corrected the naming to your situation.

On a side note.... Let's try to keep LQ professional please
 
Old 08-18-2017, 01:48 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by awayand View Post
Sending a link to the syslinux documentation page that can be easily googled is absolutely unnecessary - especially in a linux forum where people usually know what google is. put yourself into my shoes for a second, I am searching online for help, I take the time to register on a forum and type out my question, do you _really_ think that I don't know how to google the _standard documentation_ of syslinux? yada yada...
but i don't know that.
you would be surprised how many posters do exactly that.
they are too lazy to look it up, put their noses into it so to speak, and regularly come to this and many other forums to request step-by-step walkthrough instructions tailored to their individual setup - not because tehy are helpless noobs, but because they are lazy.
that's why it is always important to include "what i have done already, and where and how exactly it failed" etc.
taking the time and effort to lay it all out also helps you to see your problem better.

me, i don't know exactly what your problem is with syslinux, but if I had a similar problem, I know what I would have tried to fix it. and that is exactly what i posted.
the art is not knowing all possible linux commands and configurations by heart, but instead knowing how to help oneself and where to find already existing (locally and online) help. called documentation.
that is why i hardly ever start a help thread myself.

and it has nothing to do with my post count - that just shows that i'm spending WAY TOO MUCH TIME on LQ.
 
Old 08-18-2017, 02:57 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Please don't add comments to post that are not directly in relation to the original question.
Per the LQ rules.

"* Do not post if you do not have anything constructive to say in the post.
* When posting in an existing thread, ensure that what you're posting is on-topic and relevant to the thread. "
 
Old 08-18-2017, 04:40 PM   #12
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
If you simply want to boot a presently not bootable Linux installation then the Super Grub 2 iso is the simplest option. It will scan your disk partitions for OSs and can boot virtually any OS. There are auto and manual modes of operation. You won't have to create any boot stanzas. It will use the config files already in the installation. If your system booted successfully before the MBR was overwritten by Windows the Super Grub2 disk will get it running again.

http://www.supergrubdisk.org/super-grub2-disk/

Once you boot back into linux run grub2-install /dev/sdX (or grub-install depending on dist) to put GRUB back on the MBR.

Once this is fixed use dd to back up the 512 byte MBR to a file somewhere or on a flash drive. If this happens again you can use dd again to restore the GRUB MBR.

Quote:
I installed linux with a bootloader in the MBR as part of a dual-boot setup, but when I re-installed Windows, it wiped the MBR and so I never really bothered to mess with it nor did I have time to figure out how to boot back onto my linux partition - until now.
This is a very common mishap. An alternate approach without Super Grub 2 is if you have the live distribution of your OS then you can chroot into your SSD/HDD and re-install grub. There are many guides online on how to do this.
 
Old 08-19-2017, 08:27 PM   #13
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
Since syslinux is booting from the USB stick, I need to tell it that the root/boot device is the hard drive, but cannot find the command responsible for this. In grub, the command would be "root (hd0,0)" for example for the first HD, first partition.

Anyone know how to accomplish this in syslinux?
Unfortunately syslinux is far less powerful than grub2 and can't access files on a different partition. So if syslinux was on the usb drive partition it couldn't access the kernel and intird on your HDD partition like grub2 easily could. The only way to do it with syslinux would be with chainloading a bootloader installed to a partition. This is hard to do currently with grub2.

Forget about using syslinux and use a grub based solution since you are using grub to boot you Linux installation. The two I mentioned would be the simplest. The Super Grub2 iso is a bootable grub less than 20MB to download. It has scripts which detect all Linux installations (and other OSs) on a disk and will load your current grub2.cfg and allow you to boot from it. Once booted fixing your MBR is a one line command as described.

Quote:
I'm guessing that you need to copy the vmlinuz and initrd files from the linux install onto the USB drive.
This is reason enough for not attempting to use syslinux at all.

Last edited by tofino_surfer; 08-19-2017 at 08:28 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syslinux copyright screen is all that apears when booting Ubuntu from a USB stick Fuzzer37 Linux - Software 1 04-05-2014 04:01 PM
SYSLINUX on fat32 USB-Stick partition ? Vilius Linux - Software 4 05-07-2010 08:14 PM
Booting Linux on an external USB hard drive (not a memory stick, a hard drive) comcastuser Linux - Hardware 4 01-13-2010 06:59 PM
LXer: A much easier way to install Ubuntu on a USB device (Stick or Hard Disk)! LXer Syndicated Linux News 0 06-01-2008 11:20 PM
booting from usb hard disk moulavi Linux - Hardware 2 12-15-2007 01:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 06:25 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
Open Source Consulting | Domain Registration