# Boot USB stick from GRUB on hard disk? [WORKED-AROUND]

## Havin_it

Hi all,

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

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   :Very Happy: Last edited by Havin_it on Mon Oct 09, 2006 10:37 am; edited 1 time in total

----------

## NeddySeagoon

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.

----------

## Havin_it

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?

----------

## NeddySeagoon

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.

----------

## Havin_it

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.    :Embarassed: 

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: 

----------

## Havin_it

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:

```
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  :Smile: 

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.

----------

## NeddySeagoon

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'.

----------

## Gentree

 *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:
> 
> ```
> ...

 

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.  :Cool: 

[Disclaimer: all perceived puns are the result of the jargon and not my fault.]

----------

## Havin_it

 *Gentree wrote:*   

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

 

Well, I can modestly say I filled my boot   :Twisted Evil: 

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.

----------

## Gentree

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.

----------

## Havin_it

Seriously?  The ISO is 28.5MB, the LiveUSB once extracted is 28.2MB.

----------

