Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

Grub and Disk ID

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
maltheus
Tux's lil' helper
Tux's lil' helper
Posts: 125
Joined: Sat Aug 14, 2004 6:23 pm
Location: Colorado Springs

Grub and Disk ID

  • Quote

Post by maltheus » Tue Mar 31, 2009 5:39 pm

Is there any way to make grub boot off of a disk id (like udevs /dev/disk/by-id) rather than using the hd0 syntax? I want to install Gentoo on a USB drive that can be booted from a boot CD or a vmware image, and run on any computer, so the hard drive number will be different depending on how I run it.
Top
danomac
l33t
l33t
User avatar
Posts: 881
Joined: Sat Nov 06, 2004 6:30 am
Location: Vancouver, BC

  • Quote

Post by danomac » Tue Mar 31, 2009 5:51 pm

I've seen grub boot by UUID, although I've never actually tried setting it up myself. I do believe ubuntu is one of the distros that boots like that.

Perhaps a quick search of 'grub+uuid' may find better results?
Top
maltheus
Tux's lil' helper
Tux's lil' helper
Posts: 125
Joined: Sat Aug 14, 2004 6:23 pm
Location: Colorado Springs

  • Quote

Post by maltheus » Tue Mar 31, 2009 6:33 pm

Interesting. That gets me half way there. It lets me pass the root drive's uuid to the kernel, but grub still seems to use the BIOS drive number to locate the kernel itself. Anybody have any ideas on specifying the boot partition with a unique id?
Top
DONAHUE
Watchman
Watchman
User avatar
Posts: 7651
Joined: Sat Dec 09, 2006 4:27 pm
Location: Goose Creek SC

  • Quote

Post by DONAHUE » Wed Apr 01, 2009 2:58 pm

Please post your grub.conf and fstab. What are you seeing that makes you say
but grub still seems to use the BIOS drive number to locate the kernel itself
??
Top
maltheus
Tux's lil' helper
Tux's lil' helper
Posts: 125
Joined: Sat Aug 14, 2004 6:23 pm
Location: Colorado Springs

  • Quote

Post by maltheus » Wed Apr 01, 2009 3:07 pm

I haven't put together the system yet, I'm still planning it out. But that was the clear impression I got from googling around. Here's a grub example (and fstab isn't a problem for me):

Code: Select all

title     Ubuntu intrepid (development branch), kernel 2.6.27-7-generic
root      (hd0,0)
kernel    /boot/vmlinuz-2.6.27-7-generic root=UUID=a8aa4adb-b3e6-4e1d-b4ad-e6cd704788b2 ro  
initrd	 /boot/initrd.img-2.6.27-7-generic
You can pass in the root drive UUID to the kernel with the root=UUID= notation, but on the line above it, you still have to specify the hard drive bios number with the (hd0,0) notation (i.e. you can't specify the boot drive UUID). As I understand it, grub itself doesn't really understand UUIDs itself, it can only pass them on.
Top
DONAHUE
Watchman
Watchman
User avatar
Posts: 7651
Joined: Sat Dec 09, 2006 4:27 pm
Location: Goose Creek SC

  • Quote

Post by DONAHUE » Wed Apr 01, 2009 4:57 pm

The (hd0,0) passed by bios to grub is virtually always the drive selected as boot drive by you in your BIOS.
Assuming your motherboard has choices to allow booting a usb drive you can select it in BIOS and use (hd0,0) in the grub root line and root=UUID= in the grub kernel line. This will save trouble with the kernel device naming.
Top
maltheus
Tux's lil' helper
Tux's lil' helper
Posts: 125
Joined: Sat Aug 14, 2004 6:23 pm
Location: Colorado Springs

  • Quote

Post by maltheus » Wed Apr 01, 2009 5:06 pm

DONAHUE wrote:The (hd0,0) passed by bios to grub is virtually always the drive selected as boot drive by you in your BIOS.
Assuming your motherboard has choices to allow booting a usb drive you can select it in BIOS and use (hd0,0) in the grub root line and root=UUID= in the grub kernel line. This will save trouble with the kernel device naming.
Sure, but I want to be able to boot this on any system and I also want to be able to boot this in vmplayer. I'm thinking now, that the way to do this is to put the kernel on the boot CD and everything else on the USB drive. It'll be a pain to have to burn out a new boot CD with every kernel upgrade, but it seems to be the only option here.

Thanks for the tips.
Top
azlan
Guru
Guru
User avatar
Posts: 381
Joined: Mon Nov 11, 2002 6:09 am
Location: Seattle WA USA
Contact:
Contact azlan
Website

  • Quote

Post by azlan » Thu Apr 02, 2009 4:53 am

you can get the UUID of a device by using this method.

Code: Select all

ls -l /dev/disk/by-uuid
just cut and paste that into a console and you will get all of your disk id's then just try it and see what happens.. (make sure you create a new grub entry so that you can always boot into your old one)
there is no crazy, only violet and non violet..
Top
whig
l33t
l33t
Posts: 973
Joined: Sat Nov 27, 2004 8:36 am
Location: New Zealand

  • Quote

Post by whig » Thu Apr 02, 2009 5:02 am

As it stands current kernels don't support root mount by uuid/label. The ubuntu config above did it by using an initrd, which is a small o/s that scans all devices for identifiers. I used the genkernel scripts to build my own initrd for a usb flash only system.
Top
Post Reply

9 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic