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 12-29-2007, 12:27 PM
Derek Broughton
 
Default Another Ubuntu on external drive question

I have two laptops that claim to be able to boot from USB (Dell Inspiron and
HP Pavilion pv6000), but neither seems able to find the USB drive from
Grub. Can anybody help?

I successfully (afaict) installed Feisty on an external USB drive, from the
alternate CD. The only glitch being that letting it do automatic
partitioning on the drive created two partitions but failed to put a
filesystem on either, so the install failed as soon as it actually tried to
write to the / partition. I reran with manual partitioning, created an
ext3 (sudden concerns about the value of a journal on an external drive...)
partition and a swap, and everything ran fine until installing Grub (as
expected).

Then I rebooted to my own system, and ran "grub-install /dev/sdb --recheck"
which claimed to be successful (and the map says hd1 is the USB drive). I
rebooted (first resetting the USB HD to have a higher boot priority in the
BIOS) and it booted to the internal drive. If I go into grub:
grub> root (<TAB>
the tab-completion shows only hd0 as an option - so grub doesn't see the
drive (the light is on, but apparently nobody's home :-))

Same situation on the second laptop, same if I install grub to /dev/sdb1.

I've dried adding usb-storage to the initrd - but it seems to me I'm not far
enough into the process to need that anyway.

In absolute desperation, I thought I'd try adding a boot option to the
Windows boot manager (both laptops still have a windows partition). The XP
one (boot.ini) is probably not impossible, but was too complicated at 11pm;
the Vista boot manager seems impossible to modify! I really hate
Windows...
--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-29-2007, 01:37 PM
Peter Garrett
 
Default Another Ubuntu on external drive question

On Sat, 29 Dec 2007 09:27:49 -0400
Derek Broughton <news@pointerstop.ca> wrote:

> If I go into grub:
> grub> root (<TAB>
> the tab-completion shows only hd0 as an option - so grub doesn't see the
> drive (the light is on, but apparently nobody's home :-))

Grub is a finicky little beast

I have recently had to give it several kicks to make it recognise a drive
here ( trying to write an install script for my live CD) I am no grub
expert, far from it, so what follows is probably a horrible hack... and
may not even work for you.

Check what is in /boot/grub/ on the drive concerned. It should look
something like this:

default e2fs_stage1_5 installed-version menu.lst
minix_stage1_5 stage1 stage2_eltorito device.map fat_stage1_5
jfs_stage1_5 menu.lst~ reiserfs_stage1_5 stage2 xfs_stage1_5

Most of this is of course superfluous, but note the "device.map". Now if
the dir doesn't contain all of this stuff, (it was pristinely empty here)
you can give grub a kick thus:

(Take /mnt as your mount point in what follows)

sudo cp -a /mnt/usr/lib/grub/i386-pc/* /mnt/boot/grub/

( obviously the "i386" is arch dependent)

Now make sure the device.map actually exists and points at the right drive:

cat /mnt/boot/grub/device.map

In my case I needed to do:
echo "(hd0) $DRIVE" > /mnt/boot/grub/device.map

( DRIVE being the whole target drive of course, ā la /dev/hda, /dev/sda
etc. and the /mnt is the mountpoint of my chroot, that is, the file
system we are installing to.)

The following may not be necessary, but it can't hurt...

mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev

chroot to the relevant file system, ( sudo chroot /mnt ) and run grub:

grub> root (hd0,1)
# ( substitute according to your device/partition. Note that hd0 refers to the $DRIVE that grub is *on* i.e. it doesn't care that the drive might actually be /dev/sdb from your viewpoint, or whatever)
grub> setup (hd0) # this blats the MBR on $DRIVE - you have been warned. Adjust as needed.
grub> quit

Hopefully, now that grub has a device.map that makes sense, this will
work... you may see some "non-fatal" errors.

If it doesn't appear to work, run around in circles, bash head on keyboard,
tear your hair etc. etc. ad lib. If it looks OK, then, still in the chroot
do

update-grub

This, theoretically, will write a /boot/grub/menu.lst
# (sounds of hollow laughter)

But wait, there's more, as they say... that was not enough - I got an
error 15 on boot. Google led me to some hints that resulted in this: still
in chroot

grub-set-default default

If you have any special parameters, say for "defoptions" ( like vga=791
etc.), then you need to edit /boot/grub/menu.lst now, and then re-run
"update-grub" to make it stick.

If the above incantations work, you should now have a working grub, and it
should boot... I suggest sacrificing a goat and a chicken at the full moon
at about this point...

Hope this helps, and all those conventional sentiments. All care but no
responsibility etc. etc.

Best of luck... I have more or less the above scripted, and so far it
works here in my install script. ( This is not specifically a usb install
script though, but I imagiine grub doesn't actually care or know)

Peter

--
"INX Is Not X" based on Ubuntu 7.04 Live CD: http://inx.maincontent.net
Screenshots slideshow: http://inx.maincontent.net/album/1.png.html
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-29-2007, 02:33 PM
Thilo Six
 
Default Another Ubuntu on external drive question

Derek Broughton wrote the following on 29.12.2007 14:27

> I have two laptops that claim to be able to boot from USB (Dell Inspiron and
> HP Pavilion pv6000), but neither seems able to find the USB drive from
> Grub. Can anybody help?

afaik if your in grub allready then you are allready to far.
My computer has a bios setting for boot order including usb.

Maybe you should check that.

--
Thilo

key: 0x4A411E09


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-30-2007, 01:07 PM
Derek Broughton
 
Default Another Ubuntu on external drive question

Thilo Six wrote:

> Derek Broughton wrote the following on 29.12.2007 14:27
>
>> I have two laptops that claim to be able to boot from USB (Dell Inspiron
>> and HP Pavilion pv6000), but neither seems able to find the USB drive
>> from
>> Grub. Can anybody help?
>
> afaik if your in grub allready then you are allready to far.
> My computer has a bios setting for boot order including usb.
>
> Maybe you should check that.
>
I did say that... They're both set to boot from USB, and they don't.
--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-30-2007, 01:36 PM
Derek Broughton
 
Default Another Ubuntu on external drive question

Peter Garrett wrote:

> On Sat, 29 Dec 2007 09:27:49 -0400
> Derek Broughton <news@pointerstop.ca> wrote:
>
>> If I go into grub:
>> grub> root (<TAB>
>> the tab-completion shows only hd0 as an option - so grub doesn't see the
>> drive (the light is on, but apparently nobody's home :-))
>
> Grub is a finicky little beast
>
> I have recently had to give it several kicks to make it recognise a drive
> here ( trying to write an install script for my live CD) I am no grub
> expert, far from it, so what follows is probably a horrible hack... and
> may not even work for you.
>
> Check what is in /boot/grub/ on the drive concerned. It should look
> something like this:
>
> default e2fs_stage1_5 installed-version menu.lst
> minix_stage1_5 stage1 stage2_eltorito device.map fat_stage1_5
> jfs_stage1_5 menu.lst~ reiserfs_stage1_5 stage2 xfs_stage1_5
>
> Most of this is of course superfluous, but note the "device.map".

That's all there, and device.map =
(hd0) /dev/sda
(hd1) /dev/sdb

> In my case I needed to do:
> echo "(hd0) $DRIVE" > /mnt/boot/grub/device.map
>
> ( DRIVE being the whole target drive of course, ā la /dev/hda, /dev/sda
> etc. and the /mnt is the mountpoint of my chroot, that is, the file
> system we are installing to.)

Now, part of the problem (for me at least) is that I'm never sure what that
drive should be - right now, while running off my hard drive (/dev/sda)
it's /dev/sdc, but on a fresh boot it would be /dev/sdb

> chroot to the relevant file system, ( sudo chroot /mnt ) and run grub:
>
> grub> root (hd0,1)
> # ( substitute according to your device/partition. Note that hd0 refers
> # to the $DRIVE that grub is *on* i.e. it doesn't care that the drive
> # might actually be /dev/sdb from your viewpoint, or whatever)

That's never made any sense to me. Surely, hd0 points to whatever drive the
device.map file calls hd0 - and if we are actually booting direct from the
USB (rather than chaining to the USB from the grub on the internal drive),
I have no idea what the device map should contain - should the external
drive be /dev/sda?

> grub> setup (hd0) # this blats the MBR on $DRIVE - you have been
> warned. Adjust as needed. grub> quit
>
> Hopefully, now that grub has a device.map that makes sense, this will
> work... you may see some "non-fatal" errors.

Ah well, off to try another boot...

> If the above incantations work, you should now have a working grub, and it
> should boot... I suggest sacrificing a goat and a chicken at the full moon
> at about this point...

Damn, Peter, I should have asked this a week ago - it's going to be a while
to the next full moon!

--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-30-2007, 02:09 PM
Derek Broughton
 
Default Another Ubuntu on external drive question

Derek Broughton wrote:

> Thilo Six wrote:
>
>> Derek Broughton wrote the following on 29.12.2007 14:27
>>
>>> I have two laptops that claim to be able to boot from USB (Dell Inspiron
>>> and HP Pavilion pv6000), but neither seems able to find the USB drive
>>> from
>>> Grub. Can anybody help?
>>
>> afaik if your in grub allready then you are allready to far.
>> My computer has a bios setting for boot order including usb.
>>
>> Maybe you should check that.
>>
> I did say that... They're both set to boot from USB, and they don't.

I suppose I should have clarified in the original post that _because_ the
USB drive is being ignored in the actual BIOS process, I'm trying to get to
it from the Grub on the internal drive.
--
derek


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-30-2007, 04:44 PM
Thilo Six
 
Default Another Ubuntu on external drive question

Derek Broughton wrote the following on 30.12.2007 16:09

</snip>

> I suppose I should have clarified in the original post that _because_ the
> USB drive is being ignored in the actual BIOS process, I'm trying to get to
> it from the Grub on the internal drive.

ic
i am not familiar with that part of grub and therefore canīt help there.

--
bye Thilo

key: 0x4A411E09


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-30-2007, 06:23 PM
Kent Paul Dolan
 
Default Another Ubuntu on external drive question

> From: Derek Broughton <news@pointerstop.ca>
> Date: Sun, 30 Dec 2007 10:07:33 -0400

> I did say that... They're both set to boot from
> USB, and they don't.

Are you sure you haven't accidentally installed GRUB
_on_ the USB device, and things are getting confused
_there_? As the prior correspondent said, if you get
to GRUB somehow, you've gone too far already, you
should never see GRUB if you're set to boot from the
USB first.

xanthian.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-30-2007, 11:05 PM
Peter Garrett
 
Default Another Ubuntu on external drive question

On Sun, 30 Dec 2007 10:36:41 -0400
Derek Broughton <news@pointerstop.ca> wrote:

> Peter Garrett wrote:
>
> > On Sat, 29 Dec 2007 09:27:49 -0400
> > Derek Broughton <news@pointerstop.ca> wrote:
> >
> >> If I go into grub:
> >> grub> root (<TAB>
> >> the tab-completion shows only hd0 as an option - so grub doesn't see the
> >> drive (the light is on, but apparently nobody's home :-))
> >
> > Grub is a finicky little beast
[snipped contents of /boot/grub/ etc.]
>
> That's all there, and device.map =
> (hd0) /dev/sda
> (hd1) /dev/sdb

This could be the problem ? Does the USB drive install even need to know
about other drives? Surely udev, hal etc. pick this up on boot?
>
> > In my case I needed to do:
> > echo "(hd0) $DRIVE" > /mnt/boot/grub/device.map
> >
> > ( DRIVE being the whole target drive of course, ā la /dev/hda, /dev/sda
> > etc. and the /mnt is the mountpoint of my chroot, that is, the file
> > system we are installing to.)
>
> Now, part of the problem (for me at least) is that I'm never sure what that
> drive should be - right now, while running off my hard drive (/dev/sda)
> it's /dev/sdc, but on a fresh boot it would be /dev/sdb

Right - I have to confess that I have not done this with a detachable
drive, so I may be off base. As I sent my reply I remember thinking "Wait
a minute, what happens if you have two drives attached?" and so on...
>
> > chroot to the relevant file system, ( sudo chroot /mnt ) and run grub:
> >
> > grub> root (hd0,1)
> > # ( substitute according to your device/partition. Note that hd0 refers
> > # to the $DRIVE that grub is *on* i.e. it doesn't care that the drive
> > # might actually be /dev/sdb from your viewpoint, or whatever)
>
> That's never made any sense to me. Surely, hd0 points to whatever drive the
> device.map file calls hd0 - and if we are actually booting direct from the
> USB (rather than chaining to the USB from the grub on the internal drive),
> I have no idea what the device map should contain - should the external
> drive be /dev/sda?

This is the thorny question... I don't know. I think, as you say, that if
you are chain loading you can just put grub on the root partition and off
you go - but for a direct boot the device would need grub on its MBR,
wouldn't it? Hence the device map is relative to the chroot - the chroot
has no idea that the internal drive exists, at least until it boots, at
which point I would expect /dev/ to be populated, and to show the internal
drive(s) with, for example, fdisk -l from the booted USB drive ( in a
similar manner to the way a live CD works).

Assumption: on boot, the system sees the USB device as the first (and only)
USB device, thus /dev/sda

Hence, if you run grub from a chroot *in* the USB device, the only entry in
device.map would be the (hd0) entry. Another example: I am testing my
install script using a qemu image. My device.map in that image contains
only (hd0) /dev/hda . Grub finds the root partition, specified in
this case as (hd0,1) during the setup of grub. So, I'm guessing that
(hd0) /dev/sda should be the only entry in yours....
in /boot/grub/menu.lst on the USB device's root partition. (note that I
say "I'm guessing" )

Snippets from my script, with wry comments, are attached
[ snippets.grub.derek.txt ]

Actually, all this would probably be easier with isolinux instead of
grub...
>
> > grub> setup (hd0) # this blats the MBR on $DRIVE - you have been
> > warned. Adjust as needed. grub> quit
> >
> > Hopefully, now that grub has a device.map that makes sense, this will
> > work... you may see some "non-fatal" errors.
>
> Ah well, off to try another boot...
>
> > If the above incantations work, you should now have a working grub, and it
> > should boot... I suggest sacrificing a goat and a chicken at the full moon
> > at about this point...
>
> Damn, Peter, I should have asked this a week ago - it's going to be a while
> to the next full moon!

Alternatively, you could sacrifice a couple of virgins - but they are
increasingly hard to find ;p

Peter

--
"INX Is Not X" based on Ubuntu 7.04 Live CD: http://inx.maincontent.net
Screenshots slideshow: http://inx.maincontent.net/album/1.png.html
# $DRIVE is the whole target drive to which we are installing. ( e.g. /dev/hda, /dev/sda )

# Grub can't find what it needs, so we give it a kick in the pants. P.G.
echo -e "
Creating necessary files for the grub bootloader.
"
sleep 2
mkdir /mnt/boot/grub
cp -a /mnt/usr/lib/grub/i386-pc/* /mnt/boot/grub/

# We apparently need to make a device.map too.
echo "(hd0) $DRIVE" > /mnt/boot/grub/device.map

# Not certain this is necessary, but it ain't broke, so... P.G.
echo -e "
Mounting /dev/ and /proc... mount --bind
"
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev


echo -e "
Installing the grub bootloader... Please wait... This can take a few seconds...
"

# grub-install /dev/?da <-- doesn't work. We need to dump stuff on the MBR ... and grub can't find it.
# So we give grub another heartfelt kick...
grub --batch << EOF 2> /dev/null
root (hd0,1) # The root of system happens to be on /dev/?da2 in this case - for /dev/?da1 it would of course read (hd0,0)
setup (hd0)
quit
EOF

# The above grub setup steps probably need to be run from a chroot to the system on the USB in your case, Derek
# i.e. chroot /mnt first, assuming that's where it's mounted.
# [snipped some irrelevant stuff]

echo -e "
Creating bootloader menu file..."
chroot /mnt update-grub -y > /dev/null 2>&1

# Work around the "savedefault" not working (error 15 is the result when it craps out)
echo -e "
Setting default... "
chroot /mnt grub-set-default default > /dev/null 2>&1

# [more snips, including setting up pretty colours ]
# Lots more of course, above and below this, but all irrelevant to the problem at hand!


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 12-31-2007, 01:17 AM
Derek Broughton
 
Default Another Ubuntu on external drive question

Thilo Six wrote:

> Derek Broughton wrote the following on 30.12.2007 16:09
>
> </snip>
>
>> I suppose I should have clarified in the original post that _because_ the
>> USB drive is being ignored in the actual BIOS process, I'm trying to get
>> to it from the Grub on the internal drive.
>
> ic
> i am not familiar with that part of grub and therefore canīt help there.

Well, I may perhaps not have had grub quite correctly installed. After
following Peter's instructions (particularly "run around in circles, bash
head on keyboard, tear your hair etc. etc." - thankfully, I have a lot of
hair), I completely disabled booting from the internal drive on one of the
laptops, and then it _did_ boot off the USB drive. After re-enabling the
internal drive, it still boots off the USB _most of the time_.

I rather suspect though, that the real problem is the quality of the drive.
As I said, I put an ext3 fs on it, and it can't operate for more than a few
minutes before a journal write fails, and the fs gets remounted read-only.
Not much use if it's going to do that...

I wouldn't go to this sort of trouble, usually, but my father-in-law wants
to play with Linux, and I don't dare do anything that affects my
mother-in-law's computer, so I said "why don't I just install a Linux
system on a USB drive for you...". Well, one of my clients wanted to do
this too - he's got a decent USB drive and a corporate laptop that he can't
install Linux on, so maybe I'll offer to set it up for him and if that
works get a better drive for FIL.
--
derek


--
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 10:45 AM.

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