FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-14-2012, 04:40 AM
Gregory Shearman
 
Default About ready to move /usr, /var and /home to LVM.

In linux.gentoo.user, Dale wrote:
> I have ran into a issue here. I copied everything over to sdb, my temp
> drive. When I try to boot it, it still boots from sda which is the
> primary drive. I can not get it to boot from the copy. I did update
> the fstab file to point to the new sdb partitions, I use labels for that
> and they have different names. I also edited grub and told it root was
> sdb2. When I boot, everything mounted is sda.

Did you actually install grub onto your MBR by either:

# grub-install --no-floppy /dev/sdb

or

# grub

grub> root (hd1,0)
grub> setup (hd1)
grub> quit

-------------------------------------------------------------------------

You didn't actually write down these steps. Are you assuming that we
know you've done that?

--
Regards,
Gregory.
 
Old 04-14-2012, 10:32 AM
Dale
 
Default About ready to move /usr, /var and /home to LVM.

Gregory Shearman wrote:
> In linux.gentoo.user, Dale wrote:
>> I have ran into a issue here. I copied everything over to sdb, my temp
>> drive. When I try to boot it, it still boots from sda which is the
>> primary drive. I can not get it to boot from the copy. I did update
>> the fstab file to point to the new sdb partitions, I use labels for that
>> and they have different names. I also edited grub and told it root was
>> sdb2. When I boot, everything mounted is sda.
>
> Did you actually install grub onto your MBR by either:
>
> # grub-install --no-floppy /dev/sdb
>
> or
>
> # grub
>
> grub> root (hd1,0)
> grub> setup (hd1)
> grub> quit
>
> -------------------------------------------------------------------------
>
> You didn't actually write down these steps. Are you assuming that we
> know you've done that?
>


In the past, I never had to install grub to sdb. As long as grub is
installed to one drive, I can boot a OS from any drive. I did this when
I used to have Mandrake and Gentoo installed. I had Mandrake installed
on sda and Gentoo on sdb. I only had one /boot partition which was on
sda1. It had the kernel for both Mandrake and Gentoo in it and sda1 was
used for both.

So, has something changed that if I want to boot from a second drive I
have to install grub to its MBR first? When the BIOS finishes and loads
grub, doesn't it always load from the first drive? If that is true,
doesn't it ignore the MBR on the second drive? It can't load both MBRs
right?

This isn't making sense. I have done this many times in the past with
no problems but now something is different. I need help figuring out
what.

Dale

:-) :-)

--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
 
Old 04-14-2012, 10:38 AM
Dale
 
Default About ready to move /usr, /var and /home to LVM.

Stefan Schmiedl wrote:
> Dale,
>
> Saturday, April 14, 2012, 5:46:44 AM, you wrote:
>
> D> Stefan Schmiedl wrote:
>>> I'd expect to see root (hd1,0) in there somewhere.
>
> D> I tried changing the root line and it still booted sda. Also, note that
> D> I also tried a grub entry that doesn't even have a root line. It just
> D> points directly to sdb.
>
> D>From what I have always been told, the root line points to grub not the
> D> root partition of the OS. Those are two different things. Correct me
> D> if I am wrong here. That's the way I have always been told.
>
> That is correct, "root (hdx,y)" points to partition y on drive x, where
> the kernel is to be found, i.e. the root path for the "kernel" line.
> The kernel uses its root=/dev/whatever to set up the root for the linux
> environment.
>
> D> I'm using grub legacy here.
>
> me too. And the last time I tried, changing the root line made grub boot
> from the other disk. Have you tried editing this line in grub's editor
> during boot?
>
> s.
>
>
>


Yep, it failed many times with a file not found error. I have a copy of
/boot there but it is just a copy of sda. In the past, I have had one
/boot and booted two different Gentoo OSs with no problem.

This is what I don't get, when I point the root=/dev/sda2, it should
point to that and load the fstab file there to mount the rest. For some
reason, it goes back to sda even when told not to.

This is confusing me. When grub is pointed to something, it should go
there and error out if it is not the correct one such as pointing to the
wrong partition.

This is weird.

Dale

:-) :-)

--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
 
Old 04-14-2012, 11:11 AM
 
Default About ready to move /usr, /var and /home to LVM.

On Sat, 14 Apr 2012 05:32:01 -0500
Dale <rdalek1967@gmail.com> wrote:

> Gregory Shearman wrote:
> > In linux.gentoo.user, Dale wrote:
> >> I have ran into a issue here. I copied everything over to sdb, my
> >> temp drive. When I try to boot it, it still boots from sda which
> >> is the primary drive. I can not get it to boot from the copy. I
> >> did update the fstab file to point to the new sdb partitions, I
> >> use labels for that and they have different names. I also edited
> >> grub and told it root was sdb2. When I boot, everything mounted
> >> is sda.
> >
> > Did you actually install grub onto your MBR by either:
> >
> > # grub-install --no-floppy /dev/sdb
> >
> > or
> >
> > # grub
> >
> > grub> root (hd1,0)
> > grub> setup (hd1)
> > grub> quit
> >
> > -------------------------------------------------------------------------
> >
> > You didn't actually write down these steps. Are you assuming that we
> > know you've done that?
> >
>
>
> In the past, I never had to install grub to sdb. As long as grub is
> installed to one drive, I can boot a OS from any drive. I did this
> when I used to have Mandrake and Gentoo installed. I had Mandrake
> installed on sda and Gentoo on sdb. I only had one /boot partition
> which was on sda1. It had the kernel for both Mandrake and Gentoo in
> it and sda1 was used for both.
>
> So, has something changed that if I want to boot from a second drive I
> have to install grub to its MBR first? When the BIOS finishes and
> loads grub, doesn't it always load from the first drive? If that is
> true, doesn't it ignore the MBR on the second drive? It can't load
> both MBRs right?

Yes, if you want to boot from another drive, that drive needs to have
a usable MBR (or GPT equivalent).

The BIOS (or UEFI) dictates which MBR to load first, and GRUB doesn't
come into it until BIOS found it and loaded it. This is usually done
in the "boot sequence" config option in BIOS, although it can be
temporarily overridden at boot time by pressing a suitable key.

> This isn't making sense. I have done this many times in the past with
> no problems but now something is different. I need help figuring out
> what.

There are many ways this can go wrong. Most probably BIOS boot loading
sequence has changed (e.g. if you plug in a USB stick and save boot
sequence where the USB stick is tried first, then what happened when
you remove the stick and reboot is anybody's guess, because the BIOS
will try to outsmart you in guessing what that invalid first boot
device should have been). Or maybe you had /dev/sdb disk as the first
boot disk all along, the previous absence of a bootloader means BIOS
tried the next one silently...

My own safety net is to have /dev/sda1 and /dev/sdb1 pretty much the
same, except the grub.conf has a difference of a useless title line to
indicate which disk it was.

> Dale
>
> :-) :-)
>

Kerwin.
 
Old 04-14-2012, 11:52 AM
Dale
 
Default About ready to move /usr, /var and /home to LVM.

kwkhui@hkbn.net wrote:
> On Sat, 14 Apr 2012 05:32:01 -0500
> Dale <rdalek1967@gmail.com> wrote:
>
>> Gregory Shearman wrote:
>>> In linux.gentoo.user, Dale wrote:
>>>> I have ran into a issue here. I copied everything over to sdb, my
>>>> temp drive. When I try to boot it, it still boots from sda which
>>>> is the primary drive. I can not get it to boot from the copy. I
>>>> did update the fstab file to point to the new sdb partitions, I
>>>> use labels for that and they have different names. I also edited
>>>> grub and told it root was sdb2. When I boot, everything mounted
>>>> is sda.
>>>
>>> Did you actually install grub onto your MBR by either:
>>>
>>> # grub-install --no-floppy /dev/sdb
>>>
>>> or
>>>
>>> # grub
>>>
>>> grub> root (hd1,0)
>>> grub> setup (hd1)
>>> grub> quit
>>>
>>> -------------------------------------------------------------------------
>>>
>>> You didn't actually write down these steps. Are you assuming that we
>>> know you've done that?
>>>
>>
>>
>> In the past, I never had to install grub to sdb. As long as grub is
>> installed to one drive, I can boot a OS from any drive. I did this
>> when I used to have Mandrake and Gentoo installed. I had Mandrake
>> installed on sda and Gentoo on sdb. I only had one /boot partition
>> which was on sda1. It had the kernel for both Mandrake and Gentoo in
>> it and sda1 was used for both.
>>
>> So, has something changed that if I want to boot from a second drive I
>> have to install grub to its MBR first? When the BIOS finishes and
>> loads grub, doesn't it always load from the first drive? If that is
>> true, doesn't it ignore the MBR on the second drive? It can't load
>> both MBRs right?
>
> Yes, if you want to boot from another drive, that drive needs to have
> a usable MBR (or GPT equivalent).
>
> The BIOS (or UEFI) dictates which MBR to load first, and GRUB doesn't
> come into it until BIOS found it and loaded it. This is usually done
> in the "boot sequence" config option in BIOS, although it can be
> temporarily overridden at boot time by pressing a suitable key.
>
>> This isn't making sense. I have done this many times in the past with
>> no problems but now something is different. I need help figuring out
>> what.
>
> There are many ways this can go wrong. Most probably BIOS boot loading
> sequence has changed (e.g. if you plug in a USB stick and save boot
> sequence where the USB stick is tried first, then what happened when
> you remove the stick and reboot is anybody's guess, because the BIOS
> will try to outsmart you in guessing what that invalid first boot
> device should have been). Or maybe you had /dev/sdb disk as the first
> boot disk all along, the previous absence of a bootloader means BIOS
> tried the next one silently...
>
> My own safety net is to have /dev/sda1 and /dev/sdb1 pretty much the
> same, except the grub.conf has a difference of a useless title line to
> indicate which disk it was.
>
>> Dale
>>
>> :-) :-)
>>
>
> Kerwin.


Well, I installed grub to the second drives MBR. I even changed the
BIOS to see that drive as the main or first drive. It still boots the
old drive. I looked in dmesg and saw where it is supposed to point to
the tmp drive and it still boots the old drive even tho it is told not to.

Let's see, boot a CD, just do a reinstall from scratch and call it a
day. This is ridiculous when you can't tell a boot loader to boot the
second drive and it actually do it. Heaven forbid if I had two Linux
OSs on here.

:-) :-)

--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
 
Old 04-14-2012, 01:24 PM
 
Default About ready to move /usr, /var and /home to LVM.

On Sat, 14 Apr 2012 06:52:20 -0500
Dale <rdalek1967@gmail.com> wrote:

> Well, I installed grub to the second drives MBR. I even changed the
> BIOS to see that drive as the main or first drive. It still boots the
> old drive. I looked in dmesg and saw where it is supposed to point to
> the tmp drive and it still boots the old drive even tho it is told
> not to.
>
> Let's see, boot a CD, just do a reinstall from scratch and call it a
> day. This is ridiculous when you can't tell a boot loader to boot the
> second drive and it actually do it. Heaven forbid if I had two Linux
> OSs on here.
>
> :-) :-)
>

It sounds like GRUB made the MBR on /dev/sdb to use /dev/sda1 as its
root, so maybe something like

# grub --no-floppy
grub> find /boot/grub/stage1
(hd0,0)
(hd1,0)

Then making GRUB install on /dev/sda pointing to /dev/sda1

grub> device (hd0) /dev/sda
grub> root (hd0,0)
grub> setup (hd0)


and now install on /dev/sdb pointing to /dev/sdb1

grub> device (hd0) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)

Then you can quit GRUB by issuing

grub> quit

The point being that once you put in the line "device (hd0) /dev/sdb",
GRUB will *think* that (hd0) refers to the disk /dev/sdb, so the next
command "root (hd0,0)" just means the first partition on this disk
will serve as /boot, rather than (hd1,0) which points to 1st partition
on the *other* disk, which is possibly where GRUB got confused.

Kerwin.
 
Old 04-14-2012, 02:28 PM
Florian Philipp
 
Default About ready to move /usr, /var and /home to LVM.

Am 14.04.2012 13:52, schrieb Dale:
> kwkhui@hkbn.net wrote:
>> On Sat, 14 Apr 2012 05:32:01 -0500
>> Dale <rdalek1967@gmail.com> wrote:
>>
>>> Gregory Shearman wrote:
>>>> In linux.gentoo.user, Dale wrote:
>>>>> I have ran into a issue here. I copied everything over to sdb, my
>>>>> temp drive. When I try to boot it, it still boots from sda which
>>>>> is the primary drive. I can not get it to boot from the copy. I
>>>>> did update the fstab file to point to the new sdb partitions, I
>>>>> use labels for that and they have different names. I also edited
>>>>> grub and told it root was sdb2. When I boot, everything mounted
>>>>> is sda.
>>>>
>>>> Did you actually install grub onto your MBR by either:
>>>>
[...]
>>>
>>> In the past, I never had to install grub to sdb. As long as grub is
>>> installed to one drive, I can boot a OS from any drive.
>>>
[...]
>>>
>>> So, has something changed that if I want to boot from a second drive I
>>> have to install grub to its MBR first?
>>>
[...]
>>
>> Yes, if you want to boot from another drive, that drive needs to have
>> a usable MBR (or GPT equivalent).
>>
[...]
>
> Well, I installed grub to the second drives MBR. I even changed the
> BIOS to see that drive as the main or first drive. It still boots the
> old drive. I looked in dmesg and saw where it is supposed to point to
> the tmp drive and it still boots the old drive even tho it is told not to.
>
> Let's see, boot a CD, just do a reinstall from scratch and call it a
> day. This is ridiculous when you can't tell a boot loader to boot the
> second drive and it actually do it. Heaven forbid if I had two Linux
> OSs on here.
>
> :-) :-)
>

As we are out of rational ideas, have you tried unplugging the old disk?
You don't need it for booting at the moment, right? AS SATA is
hot-plugin capable, you can re-insert it later.

Regards,
Florian Philipp
 
Old 04-15-2012, 12:18 AM
Dale
 
Default About ready to move /usr, /var and /home to LVM.

Florian Philipp wrote:
> Am 14.04.2012 13:52, schrieb Dale:
>> kwkhui@hkbn.net wrote:
>>> On Sat, 14 Apr 2012 05:32:01 -0500
>>> Dale <rdalek1967@gmail.com> wrote:
>>>
>>>> Gregory Shearman wrote:
>>>>> In linux.gentoo.user, Dale wrote:
>>>>>> I have ran into a issue here. I copied everything over to sdb, my
>>>>>> temp drive. When I try to boot it, it still boots from sda which
>>>>>> is the primary drive. I can not get it to boot from the copy. I
>>>>>> did update the fstab file to point to the new sdb partitions, I
>>>>>> use labels for that and they have different names. I also edited
>>>>>> grub and told it root was sdb2. When I boot, everything mounted
>>>>>> is sda.
>>>>>
>>>>> Did you actually install grub onto your MBR by either:
>>>>>
> [...]
>>>>
>>>> In the past, I never had to install grub to sdb. As long as grub is
>>>> installed to one drive, I can boot a OS from any drive.
>>>>
> [...]
>>>>
>>>> So, has something changed that if I want to boot from a second drive I
>>>> have to install grub to its MBR first?
>>>>
> [...]
>>>
>>> Yes, if you want to boot from another drive, that drive needs to have
>>> a usable MBR (or GPT equivalent).
>>>
> [...]
>>
>> Well, I installed grub to the second drives MBR. I even changed the
>> BIOS to see that drive as the main or first drive. It still boots the
>> old drive. I looked in dmesg and saw where it is supposed to point to
>> the tmp drive and it still boots the old drive even tho it is told not to.
>>
>> Let's see, boot a CD, just do a reinstall from scratch and call it a
>> day. This is ridiculous when you can't tell a boot loader to boot the
>> second drive and it actually do it. Heaven forbid if I had two Linux
>> OSs on here.
>>
>> :-) :-)
>>
>
> As we are out of rational ideas, have you tried unplugging the old disk?
> You don't need it for booting at the moment, right? AS SATA is
> hot-plugin capable, you can re-insert it later.
>
> Regards,
> Florian Philipp
>


Well, if I unplug it, how am I going to change the partitions and copy
the OS back over to it? I have not tested the hot plug thingy yet.
Yea, it is supposed to work but . . .

I have done this many times before and never took the sides off the
computer. Has someone broken grub?

Dale

:-) :-)


--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
 
Old 04-15-2012, 02:02 AM
Peter Humphrey
 
Default About ready to move /usr, /var and /home to LVM.

On Friday 13 April 2012 15:51:07 Dale wrote:

> Here is grub:
>
> title=Initramfs-new_drive
> root (hd0,0)
> kernel /bzImage-3.3.1-1 root=/dev/sdb2 init=/sbin/init nox
> initrd /initramfs-3.3.1-1-tmp.img

Your "init=" parameter points to (hd0,0)/sbin/init because of your "root
(hd0,0)" line. I think that's what you need to fix. It should say
"init=(hd1,0)/sbin/init" if I've read this thread aright.

> Is this the init thingy mounting sda stuff and then Gentoo carries on
> from there? If so, how do I tell the init thingy to point to sdb stuff?

By specifying "initrd (hd1,0)/initramfs-3.3.1-1-tmp.img"

I hope I've got this right - it's late at night here.

--
Rgds
Peter
 
Old 04-15-2012, 05:16 AM
Dale
 
Default About ready to move /usr, /var and /home to LVM.

Peter Humphrey wrote:
> On Friday 13 April 2012 15:51:07 Dale wrote:
>
>> Here is grub:
>>
>> title=Initramfs-new_drive
>> root (hd0,0)
>> kernel /bzImage-3.3.1-1 root=/dev/sdb2 init=/sbin/init nox
>> initrd /initramfs-3.3.1-1-tmp.img
>
> Your "init=" parameter points to (hd0,0)/sbin/init because of your "root
> (hd0,0)" line. I think that's what you need to fix. It should say
> "init=(hd1,0)/sbin/init" if I've read this thread aright.
>

I have changed the root line to hd1,0 and it still boots sda. Other
settings result in a failure. It doesn't even try to boot.

>> Is this the init thingy mounting sda stuff and then Gentoo carries on
>> from there? If so, how do I tell the init thingy to point to sdb stuff?
>
> By specifying "initrd (hd1,0)/initramfs-3.3.1-1-tmp.img"
>
> I hope I've got this right - it's late at night here.
>


But the kernel I want to use is on sda1. The OS is on sdb tho.

I'm going to do this another way. I'm going to boot a stick thingy and
just copy it that way. It takes longer but at least it works. Someone
has borked grub tho. This worked just a few years ago. All I changed
back then was the root=/dev/sd** to whatever you want to boot. Now it
acts like it is hard coded to never change once booted. I just hope the
thing boots after I change things around.

May backup my packages first. ;-)

Dale

:-) :-)

--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
 

Thread Tools




All times are GMT. The time now is 04:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org