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 > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 08-20-2008, 12:50 AM
Karl Larsen
 
Default Grub and USB

New Subject. I have a running hard drive connected to my computer
via a USB port. I need to put grub in the MBR of the USB hard drive OR
put it on /media/disk/. I have a big problem with this. Grub likes to
work with (hd1,2) and all my experience has been with things that will
match that kind of partition location.

People on this list have said it is a simple matter to get a USB
hard drive to boot if you put the grub root at /media/disk/. I say you
can't do that because /media/disk/ is NOT a partition. You might treat
the whole hard drive as a partition but how? It isn't /dev/sb4 or like
that. In fact I did a df and it calls the USB hard drive /dev/sdb1. now
/dev/sdb1 is (hd1,0) which I can work with. I will try getting grub
running and say:

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

This should work.

Karl

--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 12:58 AM
Karl Larsen
 
Default Grub and USB

Karl Larsen wrote:
> New Subject. I have a running hard drive connected to my computer
> via a USB port. I need to put grub in the MBR of the USB hard drive OR
> put it on /media/disk/. I have a big problem with this. Grub likes to
> work with (hd1,2) and all my experience has been with things that will
> match that kind of partition location.
>
> People on this list have said it is a simple matter to get a USB
> hard drive to boot if you put the grub root at /media/disk/. I say you
> can't do that because /media/disk/ is NOT a partition. You might treat
> the whole hard drive as a partition but how? It isn't /dev/sb4 or like
> that. In fact I did a df and it calls the USB hard drive /dev/sdb1. now
> /dev/sdb1 is (hd1,0) which I can work with. I will try getting grub
> running and say:
>
> grub root (hd1,0)
> grub setup (hd1,0)
> grub quit
>
> This should work.
>
> Karl
>
>
Here is what happened:

[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub> root (hd1,0)

grub> setup (hd1,0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1,0)"... failed (this is not
fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd1,0)"... failed (this is not
fatal)
Running "install /boot/grub/stage1 (hd1,0) /boot/grub/stage2 p
/boot/grub/menu
.lst "... succeeded
Done.

grub>

It appears that (hd1,0) has a boot system in it's MBR and IF the BIOS
can find it it will boot. Now to try it... :-)

Karl


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 01:54 AM
"David Fox"
 
Default Grub and USB

On Tue, Aug 19, 2008 at 5:50 PM, Karl Larsen <k5di@zianet.com> wrote:
> People on this list have said it is a simple matter to get a USB
> hard drive to boot if you put the grub root at /media/disk/. I say you

It should be. Remember that the mount point is a partition - it's
simply mounted at /media/disk, when you go into that directory, you
are basically using the drive and/or partition. It should be a simple
matter for grub to do this by adding the --grub-install /media/disk
/dev/sdb) if that is the right device for your drive and/or stick.

grub should easily figure out everything relative to /dev/sdb being
the root of the new setup, because you're going to be booting off of
it, not the hard drive normally.


> that. In fact I did a df and it calls the USB hard drive /dev/sdb1. now
> /dev/sdb1 is (hd1,0) which I can work with. I will try getting grub

No, the usb hard drive is still /dev/sdb, and the first partition is
on /dev/sdb1, and grub is zero based, so (hd0 = the partition of the
usb stick, which should be /dev/sdb). I don't believe grub actually
references the device, but only relative locations within it.
Otherwise it would be more difficult, because you can't depend that
the usb stick will be /dev/sdb when you try and boot it.


> Karl

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 01:56 AM
James Takac
 
Default Grub and USB

Hi Karl

On Wednesday 20 August 2008 10:50:14 Karl Larsen wrote:
> New Subject. I have a running hard drive connected to my computer
> via a USB port. I need to put grub in the MBR of the USB hard drive OR
> put it on /media/disk/. I have a big problem with this. Grub likes to
> work with (hd1,2) and all my experience has been with things that will
> match that kind of partition location.
>
> People on this list have said it is a simple matter to get a USB
> hard drive to boot if you put the grub root at /media/disk/. I say you
> can't do that because /media/disk/ is NOT a partition. You might treat
> the whole hard drive as a partition but how? It isn't /dev/sb4 or like
> that. In fact I did a df and it calls the USB hard drive /dev/sdb1. now
> /dev/sdb1 is (hd1,0) which I can work with. I will try getting grub
> running and say:
>
> grub root (hd1,0)
> grub setup (hd1,0)
> grub quit
>
> This should work.
>
> Karl
>


I've got it going once or twice and from memory I had to edit the refs in
menu.1st to reflect (hd0,0) as the boot drive is seen as hd0

James

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 01:12 PM
Derek Broughton
 
Default Grub and USB

Karl Larsen wrote:

> New Subject. I have a running hard drive connected to my computer
> via a USB port. I need to put grub in the MBR of the USB hard drive OR
> put it on /media/disk/. I have a big problem with this. Grub likes to
> work with (hd1,2) and all my experience has been with things that will
> match that kind of partition location.
>
> People on this list have said it is a simple matter to get a USB
> hard drive to boot if you put the grub root at /media/disk/.

I've dealt with this issue numerous times, and I've never seen that
suggestion. I think you're confused.

> I say you
> can't do that because /media/disk/ is NOT a partition.

In "grub-install" you have two (important) parameters the --root-directory,
which IS the root directory of the system you're booting. So if the USB
drive is currently mounted on /media/disk, use /media/disk. The other is
the location you're going to install the boot block to, the "device". This
can be a disk MBR or a partition superblock.

> You might treat
> the whole hard drive as a partition but how? It isn't /dev/sb4 or like
> that.

In this case, the MBR is /dev/sb and the partition superblock is /dev/sb4
(or if your device was more normally named /dev/sdb and /dev/sdb4,
respectively)

> In fact I did a df and it calls the USB hard drive /dev/sdb1. now
> /dev/sdb1 is (hd1,0) which I can work with.

Sorry, wrong! The BIOS device you're booting from is HD0! So menu.lst
needs to respect that, though:

> I will try getting grub running and say:
>
> grub root (hd1,0)
> grub setup (hd1,0)
> grub quit
>
> This should work.

It should, but that's why it's easier to use "grub-install" with actual /dev
names, because now you run into the confusion between what is (hd1) _now_
and what will be (hd1) when you boot.

--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 01:24 PM
Rashkae
 
Default Grub and USB

James Takac wrote:
> Hi Karl
>
> On Wednesday 20 August 2008 10:50:14 Karl Larsen wrote:
>> New Subject. I have a running hard drive connected to my computer
>> via a USB port. I need to put grub in the MBR of the USB hard drive OR
>> put it on /media/disk/. I have a big problem with this. Grub likes to
>> work with (hd1,2) and all my experience has been with things that will
>> match that kind of partition location.
>>
>> People on this list have said it is a simple matter to get a USB
>> hard drive to boot if you put the grub root at /media/disk/. I say you
>> can't do that because /media/disk/ is NOT a partition. You might treat
>> the whole hard drive as a partition but how? It isn't /dev/sb4 or like
>> that. In fact I did a df and it calls the USB hard drive /dev/sdb1. now
>> /dev/sdb1 is (hd1,0) which I can work with. I will try getting grub
>> running and say:
>>
>> grub root (hd1,0)
>> grub setup (hd1,0)
>> grub quit
>>
>> This should work.
>>
>> Karl
>>
>
>
> I've got it going once or twice and from memory I had to edit the refs in
> menu.1st to reflect (hd0,0) as the boot drive is seen as hd0
>

I've always used the grub shell.. First you need to determine what
device your USB hard drive is located at. /media/disk is a mount point,
but not the device node. Use the mount command (with no other
arguments) to list all your mounted filesystems.

Assume somewhere is a line that says /dev/sdc1 is mounted on /media/disk

(substitute sdc with whatever matches your system)

Now run grub, and use these commands.

device (hd0) /dev/sdc
root (hd0,0)
setup (hd0)

quit

**Notes:.. (hd0,0 assumes your /boot is on the first partition of your
usb drive, Increment the last 0 as needed

I'm not sure is 'quit' is the right way to get out of the grub shell, it
might be 'exit' instead, or something else,, I'm sure you'll figure it
out

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 01:31 PM
Narcissus
 
Default Grub and USB

Therefore it's a good idea to try "grub>find /grub/menu.lst" if run into such confusion

2008/8/20 Derek Broughton <news@pointerstop.ca>

Karl Larsen wrote:



> In fact I did a df and it calls the USB hard drive /dev/sdb1. now

> /dev/sdb1 is (hd1,0) which I can work with.



Sorry, wrong! *The BIOS device you're booting from is HD0! *So menu.lst

needs to respect that, though:



> I will try getting grub running and say:

>

> grub *root (hd1,0)

> grub *setup (hd1,0)

> grub *quit

>

> This should work.



It should, but that's why it's easier to use "grub-install" with actual /dev

names, because now you run into the confusion between what is (hd1) _now_

and what will be (hd1) when you boot.



--

derek





--

ubuntu-users mailing list

ubuntu-users@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



--
Regards
NarcissusHuang


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 03:32 PM
Karl Larsen
 
Default Grub and USB

David Fox wrote:
> On Tue, Aug 19, 2008 at 5:50 PM, Karl Larsen <k5di@zianet.com> wrote:
>
>> People on this list have said it is a simple matter to get a USB
>> hard drive to boot if you put the grub root at /media/disk/. I say you
>>
>
> It should be. Remember that the mount point is a partition - it's
> simply mounted at /media/disk, when you go into that directory, you
> are basically using the drive and/or partition.
Actually it is the drive. It has just one partition and that is
really simple.
> It should be a simple
> matter for grub to do this by adding the --grub-install /media/disk
> /dev/sdb) if that is the right device for your drive and/or stick.
>
>
That will not work for me. I think it is very sensitive to what is
where reading man grub-install. So I did it right, at last with the grub
system. I used:

grub root (hd1,0)

grub setup (hd1)

and this worked fine. I screwed up and used

grub root (hd1,0)

grub setup (hd1,0)

This worked but the setup was not at the MBR of the hard drive. But alas
it is now correct but it still doesn't work. I think my BIOS is flacky.
And I am tired of trying.

Karl

> grub should easily figure out everything relative to /dev/sdb being
> the root of the new setup, because you're going to be booting off of
> it, not the hard drive normally.
>
>
>
>> that. In fact I did a df and it calls the USB hard drive /dev/sdb1. now
>> /dev/sdb1 is (hd1,0) which I can work with. I will try getting grub
>>
>
> No, the usb hard drive is still /dev/sdb, and the first partition is
> on /dev/sdb1, and grub is zero based, so (hd0 = the partition of the
> usb stick, which should be /dev/sdb). I don't believe grub actually
> references the device, but only relative locations within it.
> Otherwise it would be more difficult, because you can't depend that
> the usb stick will be /dev/sdb when you try and boot it.
>
>
>
>> Karl
>>
>
>


--

Karl F. Larsen, AKA K5DI
Linux User
#450462 http://counter.li.org.
PGP 4208 4D6E 595F 22B9 FF1C ECB6 4A3C 2C54 FE23 53A7


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 08-20-2008, 11:43 PM
elmo
 
Default Grub and USB

Karl Larsen wrote:
> Karl Larsen wrote:
>
>> New Subject. I have a running hard drive connected to my computer
>> via a USB port. I need to put grub in the MBR of the USB hard drive OR
>> put it on /media/disk/. I have a big problem with this. Grub likes to
>> work with (hd1,2) and all my experience has been with things that will
>> match that kind of partition location.
>>
>> People on this list have said it is a simple matter to get a USB
>> hard drive to boot if you put the grub root at /media/disk/. I say you
>> can't do that because /media/disk/ is NOT a partition. You might treat
>> the whole hard drive as a partition but how? It isn't /dev/sb4 or like
>> that. In fact I did a df and it calls the USB hard drive /dev/sdb1. now
>> /dev/sdb1 is (hd1,0) which I can work with. I will try getting grub
>> running and say:
>>
>> grub root (hd1,0)
>> grub setup (hd1,0)
>> grub quit
>>
>> This should work.
>>
>> Karl
>>
>>
>>
> Here is what happened:
>
> [ Minimal BASH-like line editing is supported. For
> the first word, TAB lists possible command
> completions. Anywhere else TAB lists the possible
> completions of a device/filename. ]
>
> grub> root (hd1,0)
>
> grub> setup (hd1,0)
> Checking if "/boot/grub/stage1" exists... yes
> Checking if "/boot/grub/stage2" exists... yes
> Checking if "/boot/grub/e2fs_stage1_5" exists... yes
> Running "embed /boot/grub/e2fs_stage1_5 (hd1,0)"... failed (this is not
> fatal)
> Running "embed /boot/grub/e2fs_stage1_5 (hd1,0)"... failed (this is not
> fatal)
> Running "install /boot/grub/stage1 (hd1,0) /boot/grub/stage2 p
> /boot/grub/menu
> .lst "... succeeded
> Done.
>
> grub>
>
> It appears that (hd1,0) has a boot system in it's MBR and IF the BIOS
> can find it it will boot. Now to try it... :-)
>
> Karl
>
>
>
There are a lot of warnings against trying to install on an external USB
HD.
For a while, I heeded those warnings but got to the point where I just
had to try it.

So, I tried Gparted, went through the regular all routine and lo and
behold, I had UBUNTU 7.10 installed on the external HD. I tried the
same with Debian and it too is installed on the external HD.

I didn't use any tricks, just followed the regular Gparted routine. I
have no explanation, it just worked.

The only possibility might be, my USB external drive is a WD3200AAK
External HD USB Device 320GB (My Passport Essential). I don't know of
any reason why it works, it was an ordinary install using Gparted

I have 2 internal HDs,#1 has 3 partitions, #2 has 2, and the external
USB HD has a few clones + the UBUNTU, 7.10 and Debian (on hd2,2 and hd2,3)

elmo

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 11:32 PM.

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