Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
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.
To be honest, I have no idea how to point it to dev/sdb2.
grub-install only takes path as argument for --root-directory.
/dev/sda1 is NTFS so I thought I'll have to use GRUB4DOS.
I was a little anxious to install GRUB to /dev/sda because it would overwrite NTLDR and I don't want to have to reinstall it.
Is GRUB4DOS a better idea in my case?
Also, does regular GRUB support NTFS? (Being installed on, not booting into Windows)
Last edited by designator; 04-29-2011 at 07:03 PM.
If your /-partition from your Linux install is on /dev/sdb1, boot to a live medium and do:
Code:
mount /dev/sdb1 /mnt
Your /-partition is now mounted as /mnt. To install Grub to your system now type:
Code:
grub-install --root-directory=/mnt /dev/sda
This will install Grub to the MBR of /dev/sda and point it to /dev/sdb1. Of course this will overwrite your MBR, but will otherwise not affect your Windows installation. If you now reboot your system you should have the Grub bootloader starting. It may be possible that it will only see the Linux, but not the Windows installation. This can easily be fixed by booting into Linux and launch the command
Code:
update-grub
This will scan your disk for operating systems and generate a new config-file for Grub.
Keep in mind that all these commands have to be launched as root, so depending on your distribution you will have to use sudo or login as root.
I just realized that since /dev/sdb is a flash card, it may not always be available during boot. If I set that as a root directory and try to boot without it, I'll be locked out from any OS, right?
Does regular grub support NTFS to store config file and images? For some reason, GRUB4DOS doesn't see the flash card.
Last edited by designator; 04-29-2011 at 07:57 PM.
You are right, if the card is not present the bootloader will not start. Normal Grub doesn't support to be installed to NTFS. Simple solution: Shrink your Windows partition, so that you can make a new partition at the end of sda. 500MB should be more than sufficient. Format this partition with a Linux files-system and use it as /boot-partition. This way your system will boot even if the flash-card is not present.
If you do not want to rewrite anything yet try grub2 on cd disk. If you like it then use instructions above to install to hd or use cd every time you want to boot flash.
Unfortunately I'm using a tablet without cd-rom drive, but I'm sure I can do the same with USB drive right?
I've only tested GRUB shell from Linux. I don't want to overwrite MBR without confirming first that GRUB can even see the flash card.
I presume you have Suse or some type of linux on usb stick. If so boot and use command 'fdisk -l' and see if flash card is listed as a /dev. If it is you should be able to boot. I have an old desk top that will not boot usb so this is the method I use to boot usb. You can make a permanent entry in you grub.cfg when you have your /dev for the flash. You may have to use the same port everytime but I presume that should be no problem if it is an internal reader.
After tought:
I chainload mine and they are live cd images, not full installs.
Last edited by Larry Webb; 04-30-2011 at 10:10 AM.
You can install both the MBR and grub to the external device, and edit Window's C:\BOOT.INI file to include an entry to chainload Linux using grub.
For Vista, there isn't a BOOT.INI file, but if you create one, it will use it. I don't know about Windows 7, but it probably will work for that as well. This method will leave the MBR on your main disk untouched. You are only changing a text file. You also need to use dd to copy the MBR of the external device to a file on C:\. This is what will chainload Linux.
I presume you have Suse or some type of linux on usb stick. If so boot and use command 'fdisk -l' and see if flash card is listed as a /dev. If it is you should be able to boot. I have an old desk top that will not boot usb so this is the method I use to boot usb. You can make a permanent entry in you grub.cfg when you have your /dev for the flash. You may have to use the same port everytime but I presume that should be no problem if it is an internal reader.
After tought:
I chainload mine and they are live cd images, not full installs.
There is a /dev/ entry for it, but GRUB doesn't see it.
I tried to dump the first 512B from the MBR of the flash card and then point Windows Loader to the file using BCDEDIT.EXE, but all I get is a black screen.
Also, when I run
Code:
geometry (hd1)
from GRUB shell, I get the SD card geometry, but when I run
You need to chainload it, if it is installed version you need to create a mbr on the flash. If it is a live distro it will chainload without any modifications.
Here is a tutorial on grub2, after reading if you have problems ask back and I will help what I can.
grub2
Last edited by Larry Webb; 05-02-2011 at 07:26 AM.
You need to chainload it, if it is installed version you need to create a mbr on the flash. If it is a live distro it will chainload without any modifications.
I'm guessing you're talking about Linux distro I'm running, right? Flash card has Android-x86, installed version, with GRUB in the MBR.
I installed GRUB2 in the MBR of another usb key and it runs correctly from that, but when I dump the MBR to a file and try to load it using Windows NTLDR, I just get a black screen with text "GRUB" and blinking cursor. It's not accepting any commands.
Also, it seems that dumping 512b wasn't enough because during installation GRUB2 complained that there wasn't enough space in the MBR until I moved the partition starting point to 4096b.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.