LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-12-2010, 05:39 PM   #1
Mountain
Member
 
Registered: Nov 2007
Location: A place with no mountains
Distribution: Kubuntu, sidux, openSUSE
Posts: 214

Rep: Reputation: 33
using labels in grub2. How?


I want to generate a grub.conf that will search for my /dev/sda1 based on the filesystem label, not the UUID.

I did change /etc/default/grub to so that GRUB_DISABLE_LINUX_UUID="true" and I regenerated grub.cfg.

But I want to go one step further and change the search statements. I notice they still reference the old UUID. I also know grub2 can search by label. Can anyone tell me how to do this? Thanks.

EDIT:

I could use some help understanding this page:
http://www.gnu.org/software/grub/man...ub.html#search

Quote:
12.3.28 search

— Command: search [--file|--label|--fs-uuid] [--set var] [--no-floppy] name
Search devices by file (-f, --file), filesystem label (-l, --label), or filesystem UUID (-u, --fs-uuid).

If the --set option is used, the first device found is set as the value of environment variable var. The default variable is ‘root’.

The --no-floppy option prevents searching floppy devices, which can be slow.

The ‘search.file’, ‘search.fs_label’, and ‘search.fs_uuid’ commands are aliases for ‘search --file’, ‘search --label’, and ‘search --fs-uuid’ respectively.
I'd like my grub.cfg to contain statements similar to this:

Code:
search --no-floppy --label MyLabel --set root
linux /boot/vmlinuz-2.6.3x-xx-generic root=LABEL=MyLabel ro quiet splash
initrd /boot/initrd.img-2.6.3x-xx-generic
Assuming that's the right syntax, how do I make grub2 generate label-based menu entries like that?

Last edited by Mountain; 07-12-2010 at 06:49 PM.
 
Old 07-12-2010, 06:25 PM   #2
Mountain
Member
 
Registered: Nov 2007
Location: A place with no mountains
Distribution: Kubuntu, sidux, openSUSE
Posts: 214

Original Poster
Rep: Reputation: 33
See answer here:
http://forums.linuxmint.com/viewtopic.php?f=46&t=38599

and support here:
http://wiki.archlinux.org/index.php/GRUB2

But I still need to figure out how to do this via the intended grub.d files rather than manually editing grub.cfg. Any help?

Last edited by Mountain; 07-12-2010 at 06:49 PM.
 
Old 07-13-2010, 06:00 PM   #3
Mountain
Member
 
Registered: Nov 2007
Location: A place with no mountains
Distribution: Kubuntu, sidux, openSUSE
Posts: 214

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by Mountain View Post
But I still need to figure out how to do this via the intended grub.d files rather than manually editing grub.cfg. Any help?
Solved here:
http://ubuntuforums.org/showpost.php...1&postcount=19
Updated URL:
http://ubuntuforums.org/showthread.p...64#post9585964

Last edited by Mountain; 07-13-2010 at 06:05 PM. Reason: new url
 
  


Reply

Tags
grub, grub2, labels


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Labels on SVN? your_shadow03 Linux - Newbie 3 06-28-2009 11:21 PM
cd labels? firedance Linux - Software 4 04-14-2008 08:19 AM
1. how to set labels bottom margin? 2. how to set all labels to be right to left typi dfgfdgdf General 0 03-20-2007 09:43 AM
Partition labels Alvision Red Hat 2 02-19-2007 08:25 AM
Anyone have the Solris 9 Cd Labels? enine Solaris / OpenSolaris 2 02-17-2005 09:53 PM


All times are GMT -5. The time now is 11:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration