Installed to flash drive altered boot sector??

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Bayhawk

Installed to flash drive altered boot sector??

Post by Bayhawk »

Hi. I'm a n00b's n00b and Mint is my first Linux distro. I installed Julia off of a live CD I created, installing to my flash drive thinking I'd be able to take my OS with me everywhere :lol: . Anyway, I installed to my flash drive and something went wrong. I can't use the drive to boot on any computer other than my laptop and if I try to boot without the flash drive in I'm directed to grub rescue? Does anyone know what I did wrong and/or how to fix this?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
gn2

Re: Installed to flash drive altered boot sector??

Post by gn2 »

What you have done wrong is to install to your Flashdrive, it's far better to create a persistent Live USB instead.
Chances are you have written Grub to the internal drive's MBR.
Have you tried booting it with the flash drive inserted?
What operating systems are on the PC that now will not boot?
mick55

Re: Installed to flash drive altered boot sector??

Post by mick55 »

Hi

Unfortunately you have 2 problems.

I will try and make this simple....even though it isn't.

Linux installs Grub2 (GRand Unified Bootloader) which is used to boot your computer.

By default it installs grub2 to the first internal hard drive, which is /dev/sda
under the linux naming convention.

So grub2 is on /dev/sda but the grub.cfg is on your flash drive.

First you have to find out the device name of your flash drive.

Open a terminal and run this command

Code: Select all

sudo fdisk -l
Find your flash drive in the list and make a note of the device name.
It will be something like /dev/sdb.

Next we need to install grub2 to the flash drive.
Open a terminal and run this command--replace x with the flash drive's letter

Code: Select all

sudo grub-install /dev/sdx
If you get any errors with that code then use this command.

Code: Select all

grub-install --recheck /dev/sdx
This will install grub to the flash drive and now you can use it anywhere.

However your laptop will still not boot without the flash drive connected, so we
neeed to install a bootloader to the laptop drive.

Open a terminal and run this command.

Code: Select all

sudo apt-get install lilo
then this one

Code: Select all

sudo lilo -M /dev/sda mbr
This assumes your laptop drive is /dev/sda which it usually is.

If you are confused, then copy/paste the output of the "sudo fdisk -l" command
and I will check it to make sure we are on the right track.

Make sure you run all these commands exactly as instructed,
you can easily break more stuff.


mick
gn2

Re: Installed to flash drive altered boot sector??

Post by gn2 »

mick55 wrote:~ However your laptop will still not boot without the flash drive connected, so we
neeed to install a bootloader to the laptop drive. ~
Would it not be better to first find out what OS(s?) are on the laptop before selecting a bootloader?

If it's a single boot of Windows is Lilo the most appropriate suggestion?

Just asking... :)
mick55

Re: Installed to flash drive altered boot sector??

Post by mick55 »

gn2 wrote:Would it not be better to first find out what OS(s?) are on the laptop before selecting a bootloader?
I can only work with the information provided.

Since the OP says Mint is his first Linux, that suggests that he only has Windows on his laptop.
But perhaps he could fill in the blanks. :wink:
gn2 wrote:[If it's a single boot of Windows is Lilo the most appropriate suggestion?
Lilo is indeed the simplest way to boot Windows.

The alternative would require the original Windows CD and yet more instructions.

Lets wait for the OP to respond before we analyze this any further.



mick
gn2

Re: Installed to flash drive altered boot sector??

Post by gn2 »

mick55 wrote:I can only work with the information provided.
Which is why when there is insufficient information it is perahps best to ask for it?
mick55 wrote:Since the OP says Mint is his first Linux, that suggests that he only has Windows on his laptop.
Which version?
mick55 wrote:Lilo is indeed the simplest way to boot Windows.
Really?
I would have thought that Windows own native bootloader the simplest way.
mick55 wrote:The alternative would require the original Windows CD
Not necessarily, there are a few other ways.
In any case it's the OP's laptop and imo it should be up to the OP how to proceed once the options are explained.
mick55 wrote:Lets wait for the OP to respond before we analyze this any further.
I agree. :)
Bayhawk

Re: Installed to flash drive altered boot sector??

Post by Bayhawk »

I have Windows Vista installed on the laptop.
The laptop will only boot if the flash drive is inserted.
A friend told me that I should be able to fix the problem of the Windows not booting in the absence of the flash drive in question by doing a System Restore using my installation disk. Is this true?

Mick, I did everything you instructed up to installing Lilo, but I don't know what to do next.
libssd
Level 4
Level 4
Posts: 288
Joined: Tue Jun 22, 2010 11:26 am

Re: Installed to flash drive altered boot sector??

Post by libssd »

I may be splitting hairs about the definition of "flash drive", but I installed LMDE this morning to an 8gb SDHC flash memory card, while the internal disk was in place, and it boots just fine with the internal disk removed, so grub2 is installed on the SDHC flash memory card. If you have a machine with a card reader slot, and the BIOS supports booting from a card, I have seen faster performance than with a thumb drive.

To install grub2 on a USB thumb drive from the start, remove the internal drive, boot from an optical drive, and install from there. Otherwise, you have to install grub2 manually, as described above.
mick55

Re: Installed to flash drive altered boot sector??

Post by mick55 »

Bayhawk wrote:Mick, I did everything you instructed up to installing Lilo, but I don't know what to do next.
If you did everything correctly then you should be able to boot up your laptop without the flash drive connected.



mick
mick55

Re: Installed to flash drive altered boot sector??

Post by mick55 »

@gn2

Is it really necessary to be so smug and condescending? :roll:

I'm just trying to help the OP.

What is your objective?




mick
gn2

Re: Installed to flash drive altered boot sector??

Post by gn2 »

mick55 wrote:@gn2 Is it really necessary to be so smug and condescending?
That was not my intent.
Sorry if you saw it that way.
I was just trying to improve the service you provide to our fellow forum members.
mick55

Re: Installed to flash drive altered boot sector??

Post by mick55 »

gn2 wrote:
mick55 wrote:@gn2 Is it really necessary to be so smug and condescending?
That was not my intent.
Sorry if you saw it that way.
I was just trying to improve the service you provide to our fellow forum members.

My apologies if I overreacted.

It's just frustrating to have your comments dissected and critiqued, when your only goal is to help.


Thanks for taking the time to respond.

mick
gn2

Re: Installed to flash drive altered boot sector??

Post by gn2 »

Bayhawk wrote:A friend told me that I should be able to fix the problem of the Windows not booting in the absence of the flash drive in question by doing a System Restore using my installation disk. Is this true?
No, your friend is perhaps confused, it's not "System Restore" but it can be done with a Vista installation DVD.
What you need to do is re-instate the native bootloader on the internal drive or install a different bootloader.
There are a number of ways of achieving this.
NeoSmart's Vista Recovery CD is perhaps the best tool for the job if you don't have a proper Vista installation DVD.
Here's a how-to.

Or if you prefer you could use Lilo as per Mick55's suggestion.
mick55

Re: Installed to flash drive altered boot sector??

Post by mick55 »

gn2 wrote:NeoSmart's Vista Recovery CD is perhaps the best tool for the job if you don't have a proper Vista installation DVD
+1

The Vista Recovery CD works great.

If LILO did not work for you, then I definitely recommend using this CD.
It is simpler and much faster than using the Vista installation DVD. :wink:




mick
piratesmack

Re: Installed to flash drive altered boot sector??

Post by piratesmack »

gn2 wrote:
mick55 wrote:Lilo is indeed the simplest way to boot Windows.
Really?
I would have thought that Windows own native bootloader the simplest way.
The native bootloader is still used, even with the LILO MBR.

The LILO and Windows MBR both do the same thing, they just load the boot code from the partition that is marked active (bootable). See http://syslinux.zytor.com/wiki/index.php/Mbr

The partition's boot code is what starts the Windows boot manager and loads Windows.
So it's not that important to have the real Windows MBR, the LILO or Syslinux MBR should work fine.

I should also mention that there is a tool that can create Microsoft MBR's from Linux, but it was removed from the repos because it contains Microsoft code:
http://ms-sys.sourceforge.net/
gn2

Re: Installed to flash drive altered boot sector??

Post by gn2 »

Lilo is a bootloader.
The clue is in the name, LInux LOader. :)
rbanavara

Re: Installed to flash drive altered boot sector??

Post by rbanavara »

I thought lilo is obsolete, good to know that it still being used.

Correct me if I am wrong, but it might be possible to install windows boot loader without CD. first boot from grub and select windows to boot. Immediately hit F8 to go to advanced boot menu. Select recovery and from there, do startup repair. I have tried this once and it did not ask for CD (may be because mine is Dell & it has a separate recovery partition).
oobetimer

Re: Installed to flash drive altered boot sector??

Post by oobetimer »

rbanavara wrote:I thought lilo is obsolete, good to know that it still being used.

Correct me if I am wrong, but it might be possible to install windows boot loader without CD. first boot from grub and select windows to boot. Immediately hit F8 to go to advanced boot menu. Select recovery and from there, do startup repair. I have tried this once and it did not ask for CD (may be because mine is Dell & it has a separate recovery partition).
You can use ms-sys program ..

http://packages.ubuntu.com/dapper/ms-sys

http://old-releases.ubuntu.com/ubuntu/p ... /m/ms-sys/

http://ms-sys.sourceforge.net/

Of course LILO can restore windows bootsector if it is not corrupted .. :wink:

http://www.youtube.com/watch?v=oB8NVzkgdEA
Locked

Return to “Beginner Questions”