Choose style:

Author Topic: P5 Boot usb stick from GRUB2?  (Read 2440 times)

0 Members and 1 Guest are viewing this topic.

Offline insomniacno1

  • nOOb
  • *
  • Posts: 20
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 5
P5 Boot usb stick from GRUB2?
« on: August 10, 2015, 10:23:18 am »
Hi, I like to edit GRUB2 to allow Booting USB stick - can someone help me with this?

I'm running Peppermint 5 on an old pc without the option to boot from USB - I'm using this pc for testing linux versions that will run on old HW, in order to help friends out that just need a system where they can use netbanking/Java - they have XP which is not supported anymore and no money to buy new pc.

I have a Multiboot USB stick I have set up with 3 different linux versions and other utilities - and its working fine on systems that can boot from USB.

There is no bios update for this pc, so thats not an option.

NOTE: I have Grub-customizer installed for easy editing and update

I already tried pressing C at Grub to get command line and then ls to get drive info but ls only shows (hd0) and the partitions there, it doesn't find (hd1) where the USB normally would be. Running Gparted from within Peppermint  shows the USB at /dev/sdb1 with boot,lba as flags.

I have read this: https://help.ubuntu.com/community/BootFromUSB#Using_an_internal_hard_drive

But its about booting ubuntu for which I'm not trying so I'm not really sure which commands to use instead.
 

Hope someone can help

JBJ 
« Last Edit: August 10, 2015, 11:16:17 am by insomniacno1 »

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: P5 Boot usb stick from GRUB2?
« Reply #1 on: August 10, 2015, 11:15:27 am »
With the USB stick plugged in, open a terminal and run:

Code: [Select]
sudo update-grub

Unless I'm mistaken, the computer should find the operating systems on the USB stick and create boot entries from them.

Offline insomniacno1

  • nOOb
  • *
  • Posts: 20
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 5
Re: P5 Boot usb stick from GRUB2?
« Reply #2 on: August 10, 2015, 11:22:17 am »
With the USB stick plugged in, open a terminal and run:

Code: [Select]
sudo update-grub

Unless I'm mistaken, the computer should find the operating systems on the USB stick and create boot entries from them.

Hi and thank you for the quick answer: )

I have read this, but I'm concerned with it because grub2 uses UUIDs instead of hd(x,y), so that will mean that I can only use that one USB stick because another USB stick will have a different UUID - or am I mistaken?

with kind regards

JBJ

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: P5 Boot usb stick from GRUB2?
« Reply #3 on: August 10, 2015, 11:27:28 am »
Well, if you wanted to use more than one USB stick to do this, you would need any sticks you wanted to use plugged in when you ran the command.  It can only find boot entries for what is present when you run it.  And, say you run the command with one plugged in and it finds the partitions on it, if you unplug it, plug in another and then run the command again, it will forget the first stick entirely.

Offline insomniacno1

  • nOOb
  • *
  • Posts: 20
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 5
Re: P5 Boot usb stick from GRUB2?
« Reply #4 on: August 10, 2015, 11:32:24 am »
Well, if you wanted to use more than one USB stick to do this, you would need any sticks you wanted to use plugged in when you ran the command.  It can only find boot entries for what is present when you run it.  And, say you run the command with one plugged in and it finds the partitions on it, if you unplug it, plug in another and then run the command again, it will forget the first stick entirely.

Isn't there a way to change UUID to the port or drive so that I can use any usb stick?


Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: P5 Boot usb stick from GRUB2?
« Reply #5 on: August 10, 2015, 11:33:26 am »
I have no idea.  You're going to have to wait until someone more knowledgeable of such things gets here to answer that one.   :-\

Offline insomniacno1

  • nOOb
  • *
  • Posts: 20
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 5
Re: P5 Boot usb stick from GRUB2?
« Reply #6 on: August 10, 2015, 11:38:28 am »
I tried what you suggested:

thunder@thunder-VT82C694X ~ $ sudo update-grub
[sudo] password for thunder:
Generating grub configuration file ...
using custom appearance settings
Found background image: /root/Templates/Jpuppy-bliss.jpg
Found linux image: /boot/vmlinuz-3.13.0-55-generic
Found initrd image: /boot/initrd.img-3.13.0-55-generic
Found linux image: /boot/vmlinuz-3.13.0-29-generic
Found initrd image: /boot/initrd.img-3.13.0-29-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
thunder@thunder-VT82C694X ~ $

I will now reboot to see if it worked.

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: P5 Boot usb stick from GRUB2?
« Reply #7 on: August 10, 2015, 12:08:48 pm »
To be honest, I'm curious to see if it will work also.  I figured running update grub would find the installs on the stick and create entries.  Though, looking at that output, I'm not entirely sure it did.  The other question that remains is whether or not your system will find the USB stick at startup and allow booting from it.  Also, depending on the boot order, there is a slight possibility it will try booting from the stick before your internal HD, which would be a bad thing in this instance.

In case you can't tell, I've never tried this exact process before, so I'm mainly guesstimating based on what I know.  I've ran Peppermint from a USB install (full install, not Live) but I've never tried using GRUB to boot other operating systems found on a USB stick.
« Last Edit: August 10, 2015, 12:12:30 pm by scifidude79 »

Offline insomniacno1

  • nOOb
  • *
  • Posts: 20
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 5
Re: P5 Boot usb stick from GRUB2?
« Reply #8 on: August 10, 2015, 12:18:14 pm »
Unfortunately it didn't work, there is no menu entry for the USB stick:(

I have found an article on how to use Plop bootmanager together with Grub2 so I will try that now:)

http://makegadgetswork.blogspot.dk/2012/02/how-to-boot-from-usb-when-bios-does-not.html
« Last Edit: August 10, 2015, 12:23:55 pm by insomniacno1 »

Offline scifidude79

  • Global Moderator
  • Hero
  • *****
  • Posts: 4029
  • Karma: 863
    • View Profile
  • Peppermint version(s): Peppermint 9
Re: P5 Boot usb stick from GRUB2?
« Reply #9 on: August 10, 2015, 12:20:29 pm »
Well, poop.  Sorry about that.  I'm clearly not the person to ask on this subject, so I'm just going to bow out gracefully now.  Good luck with getting this to work.

Offline insomniacno1

  • nOOb
  • *
  • Posts: 20
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 5
Re: P5 Boot usb stick from GRUB2?
« Reply #10 on: August 10, 2015, 12:25:25 pm »
Well, poop.  Sorry about that.  I'm clearly not the person to ask on this subject, so I'm just going to bow out gracefully now.  Good luck with getting this to work.

Well you tried:) Thats the main thing:)

Thanks for your help again:)

JBJ

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5523
  • Karma: 970
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
Re: P5 Boot usb stick from GRUB2?
« Reply #11 on: August 14, 2015, 07:48:20 pm »
Hrm...  I do this all the time.  Here, I'll do it again:

  • I'm booted into my Ubu 15.10 desktop test machine, right now.
  • I took my 'Peppermint Stick' (full Peppermint 6 install on a USB thumb drive) out of my pocket and plugged into my Ubu test machine.
  • I went to 'PCManFM' (file manager) and made sure the USB thumb drive is mounted. Yup, it's mounted.
  • Now, Ill update GRUB on my test machine (using the command above).

Here's the output:

Quote from: CLI
http://vindsl@Zuul:~$ sudo update-grub
[sudo] password for vindsl:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.2.0-040200rc5-generic
Found initrd image: /boot/initrd.img-4.2.0-040200rc5-generic
Found linux image: /boot/vmlinuz-4.2.0-040200rc4-lowlatency
Found initrd image: /boot/initrd.img-4.2.0-040200rc4-lowlatency
Found linux image: /boot/vmlinuz-4.2.0-040200rc3-generic
Found initrd image: /boot/initrd.img-4.2.0-040200rc3-generic
Found linux image: /boot/vmlinuz-4.1.2-040102-generic
Found initrd image: /boot/initrd.img-4.1.2-040102-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 10.10 (10.10) on /dev/sda1
Found Peppermint Six (6) on /dev/sdc5
done
vindsl@Zuul:~$

As you can see, Peppermint Six was added to the GRUB on my Ubu test machine.

My 'Peppermint Stick' will now boot from the GRUB on my Ubu test machine (if I select it) - at least for awhile. 

If I update the GRUB on the Ubu test machine, without first plugging in the thumb drive - or if I alter the GRUB on the USB thumb drive (for instance, install a new kernel) without updating the GRUB on the Ubu test machine afterwards, then I'll need to go through this process again.

That's why I said, "I do this all the time."  I'm always changing everything, all the time. When I get done playing around, I go through the process above, and I'm good until next time.  LoL   :D

The REASON I do this is so I don't need to change the boot order in BIOS, or boot from an alternate device, or any of that other nonsense, when I want to boot from my 'Peppermint Stick'.  I can boot this machine normally, and simply choose 'Pepper Six (6)' from the list in GRUB.

Anyway, I hope this is what you were asking about.  If not, let me know.


ADDENDUM #1

Just wanted to give a POC - new day (in my locale) - new GRUB (for my test machine) - garbage removal:

Quote from: CLI
vindsl@Zuul:~$ TZ='UTC' date
Sat Aug 15 15:41:54 UTC 2015
vindsl@Zuul:~$ sudo update-grub
[sudo] password for vindsl:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.2.0-040200rc6-lowlatency
Found initrd image: /boot/initrd.img-4.2.0-040200rc6-lowlatency
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 10.10 (10.10) on /dev/sda1
Found Peppermint Six (6) on /dev/sdc5
done
vindsl@Zuul:~$

It's an ongoing process...   ;)


ADDENDUM #2

Just installed a new kernel on the 'Peppermint Stick', and did some garbage removal.  So, I had to go through the process again.

Here's how GRUB looks, on the USB thumb drive:

Quote from: CLI
vindsl@Sandman ~ $ TZ='UTC' date
Sat Aug 15 21:51:58 UTC 2015
vindsl@Sandman ~ $ sudo update-grub
[sudo] password for vindsl:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.2.0-040200rc6-lowlatency
Found initrd image: /boot/initrd.img-4.2.0-040200rc6-lowlatency
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Ubuntu 10.10 (10.10) on /dev/sda1
Found Ubuntu Wily Werewolf (development branch) (15.10) on /dev/sda5
done
vindsl@Sandman ~ $

I think I'm okay, until next week...   8)
« Last Edit: August 15, 2015, 06:00:42 pm by VinDSL, Reason: Addendum »