Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Boot USB stick from GRUB on hard disk? [WORKED-AROUND]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1272
Location: Edinburgh, UK

PostPosted: Fri Oct 06, 2006 11:34 am    Post subject: Boot USB stick from GRUB on hard disk? [WORKED-AROUND] Reply with quote

Hi all,

I always thought my laptop was able to boot off USB devices, but it now looks like it can't. :(

I'm still interested in using some LiveUSB stuff, and I'm wondering: Is it possible to boot the stick from within the hard-drive-installed GRUB? If so, will the LiveUSB contents need to be modified at all?

Thanks in advance :D


Last edited by Havin_it on Mon Oct 09, 2006 10:37 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54851
Location: 56N 3W

PostPosted: Fri Oct 06, 2006 8:46 pm    Post subject: Reply with quote

Havin_it,

I think it depends on what you have on the hard drive.
Grub alone - it may be difficult, since the BIOS would need to show the USB stick to grub.
Grub and kernel, then mount root and everything else from the USB stick ?
That should be fairly easy.
Your kernel will need all the USB bits and pieces built in, including USB-Storage and SCSI disk.
You will ned an extra kernel line parameter in grub .... rootdelay=<secs> <secs> in the range 7..30 is reported to be good. This allows the USB subsystem to initialise before you attempt to use it to mount root.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1272
Location: Edinburgh, UK

PostPosted: Sun Oct 08, 2006 12:24 pm    Post subject: Reply with quote

Hi NeddySeagoon, thanks for clearing that up. I guess this means I am defeated then, as what I was hoping for was just a GRUB option to say: "Boot whatever kernel is on the USB". But when I think about it, obviously that won't work if the BIOS can't see it in the first place. Oh well...

I'll tell you why I was asking: I need to resize my root partition, and found that I need GParted for this (well, that or some command-line futzing that scared the bejaysus off me). And being a typical Scot tightwad, I don't want to waste a whole CD on a 30MB LiveCD that only does one thing. (Yes, I suppose I could hunt down a full-featured LiveCD that includes GParted, but I got too many of them too...) So I was hoping to use their LiveUSB distro instead.

Alternative scheme: If I place the LiveUSB contents into my /boot partition and point GRUB at the correct thing, could I boot it from there and use it to operate on the / partition?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54851
Location: 56N 3W

PostPosted: Sun Oct 08, 2006 1:14 pm    Post subject: Reply with quote

Havin_it,

Lets look at this problem from another angle. You need more space for root.
There are several ways around this. Resizing the partion is only one.

Another, lower risk one is to move things off of root.
/home, /var, /usr and /tmp are all candidates.
You move the contents of one of these directories onto another partition, delete the orignal files and mount the extra partition using the old directory name as a mount point.

You can also remove the contents of /usr/portage/distfiles - thats all the sources you have ever downloaded.

I reccomend you do not try resizing partitons withou a full validated backup. It might not work.
Not all file systems can be resized either.

I know a little about the Scots. Put my location in Google, if you don't know where it is.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1272
Location: Edinburgh, UK

PostPosted: Mon Oct 09, 2006 12:28 am    Post subject: Reply with quote

Valid suggestions, but I tend against partitioning any more extensively than I can avoid. I prefer keeping my options open, so more parts of the filesystem can grow/shrink as needed. I only really have multiple partitions at all because I'm dual-booting with Windows. My full map is like this (in actual order on disk):

hda2 : /boot (Ext2, 55MB)
hda1 : /win_c (NTFS, ~14GB)
hda3 : / (Ext3, ~10GB)
hda5 : SWAP, 768MB
hda6 : /win_d (FAT32, ~4GB)

Everything valuable gets rsync'd to my trusty server box regularly, so no worries there. Basically, after my last reinstall of Windurrrrz I decided - since I've been using it less and less - to shrink it a bit and give the rest to Linux. I got as far as the shrinking part with QTParted on a Knoppix disc, then spent nearly an hour wondering why it wouldn't let me then move and expand the / partition. :oops:

The teeny /boot partition, which normally I keep unmounted, is bigger than it needs to be for holding GRUB plus two kernels, but it has just enough space left to squeeze-in the Gparted LiveCD/USB, if I can make it work. Expediency, don'tcher know...?

According to Google Maps, you live on the Rosyth-Zeebrugge Superfast Ferry! AICMFP :wink:
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1272
Location: Edinburgh, UK

PostPosted: Mon Oct 09, 2006 10:36 am    Post subject: Reply with quote

Yaaaaahhhh - got a result, after a bit of foraging in the GParted forums.

I extracted the contents of the LiveCD iso to /boot, and added the following entry to menu.lst:
Code:
title=GParted LiveCD-on-HD
root (hd0,1)
kernel /isolinux/linux root=/dev/ram0 init=/linuxrc initrd=/isolinux/initrd.gz ramdisk_size=65000
initrd /isolinux/initrd.gz


Note that during the boot process it's necessary to specify the boot partition (hda2 in my case) otherwise it'll puke because it's looking for the CD in the CD drive. Once running, everything went very smoothly :)

Other note: Although I planned to use the LiveUSB, I switched to the LiveCD just because it has fewer files in the root level (just the boot-image and everything else in a subfolder) whereas the LiveUSB has all its files at the root. This saves me having /boot more cluttered with files.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54851
Location: 56N 3W

PostPosted: Mon Oct 09, 2006 11:16 am    Post subject: Reply with quote

Havin_it,

Hmm - I'm glad it worked. I'm not a fan of everything in a single partiton and changing sizes on the drive like that.
If you ever do another install, have a look at Logical Volume Manager, LVM2 now.
It provides another layer of hard drive abstraction, so you can move space around 'on the fly'.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Mon Oct 09, 2006 11:54 am    Post subject: Reply with quote

Havin_it wrote:
Yaaaaahhhh - got a result, after a bit of foraging in the GParted forums.

I extracted the contents of the LiveCD iso to /boot, and added the following entry to menu.lst:
Code:
title=GParted LiveCD-on-HD
root (hd0,1)
kernel /isolinux/linux root=/dev/ram0 init=/linuxrc initrd=/isolinux/initrd.gz ramdisk_size=65000
initrd /isolinux/initrd.gz



hmm, nice idea. Silly I never thought of doing that. Saves grubbing around that live CD when I need to do some maintainance on root.

Personally I go along with Neddy, I like a little root that only contains system stuff so that I can easily clone it every few days. That way if portage drops a bollock as sometimes happens I can just reboot to a know stable system rather than having to unravel the mess.

BTW, how much did that increase the footprint of your boot. 8)

[Disclaimer: all perceived puns are the result of the jargon and not my fault.]
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1272
Location: Edinburgh, UK

PostPosted: Tue Oct 10, 2006 12:04 am    Post subject: Reply with quote

Gentree wrote:
BTW, how much did that increase the footprint of your boot. 8)


Well, I can modestly say I filled my boot :twisted:

LVM does sound like a nice compromise if you want partitioning without the pain, but I don't think it'd be much good for my system. For a start, I'm guessing Windows doesn't speak it, so it wouldn't help with the operation I've just done. Also it's a laptop, so the oft-touted virtue of "easy chop-n-change of physical devices" doesn't really apply either.

It seems to me that any part of the system will fluctuate with how much (and what type of) programs are added/removed. And imaging/cloning? Too time-consuming, I waaaay prefer a selective rsync every now and then.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Tue Oct 10, 2006 12:21 am    Post subject: Reply with quote

my root is 7.8GB and takes about 10m to clone once I've booted to another medium. rsync sounds good if you permnenlty hooked up to another machine.

Mine's basically a stand alone, one disk box, that's why I liked your gparted in /boot idea, so seriously, how much space did it need?

Thx.
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1272
Location: Edinburgh, UK

PostPosted: Tue Oct 10, 2006 12:40 am    Post subject: Reply with quote

Seriously? The ISO is 28.5MB, the LiveUSB once extracted is 28.2MB.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum