LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-28-2010, 11:08 AM   #1
uhcafigdc
Member
 
Registered: Oct 2008
Distribution: Debian Lenny
Posts: 39

Rep: Reputation: 15
Question Generate /boot/grub/menu.lst with UUID instead of mapped name?


I have a Debian Lenny file server here with multiple disks. By default, /boot/grub/menu.lst is configured with a line like
Code:
kernel          /boot/vmlinuz-2.6.26-1-686 root=/dev/sda1 ro
Sometimes, the mapped name of that disk will change (ie: /dev/sda1 and /dev/sdb1 will switch), so I configured /boot/grub/menu.lst with a UUID instead:
Code:
kernel          /boot/vmlinuz-2.6.26-1-686 root=UUID=e2d91dc4-e72c-4529-92e8-3f090472e044 ro

The problem is that when I update the kernel via `apt-get upgrade` or such, it writes a new /boot/grub/menu.lst using the mapped name instead of the UUID.

What is the fix for this? Do I manually rewrite /boot/grub/menu.lst with the UUID every time I update the kernel?
 
Old 07-28-2010, 11:33 AM   #2
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
When your sda1 become sdb1 the disk order can also get changed so you have to edit Grub by changing (hd0) and (hd1).

Each distro has its own arrangement so if you want all in UUID then use Ubuntu as I don't think it uses the traditional device name by default.

Personally I find the traditional device names better as we still have to use them in Linux.
 
0 members found this post helpful.
Old 07-28-2010, 12:51 PM   #3
uhcafigdc
Member
 
Registered: Oct 2008
Distribution: Debian Lenny
Posts: 39

Original Poster
Rep: Reputation: 15
So, your answer to my last question is "yes"?
 
Old 07-28-2010, 01:10 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You can use grub2, which uses UUIDs.
 
1 members found this post helpful.
Old 07-28-2010, 02:04 PM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
AwesomeMachine,

Think Grub1 can use UUID and the OP post #1 shows that is what he is using. He just want the updates automatically have it.

uhcafigdc,

My answer is if you do not want the hassle of editing the UUID every time go with a distro like Ubuntu that has defaulted to UUID.

I go exactly the opposite. I let a distro to use the UUID but if it fails to boot then I alter it back to /dev/sdax. It is easier to control the disk order in the Bios than writing out the long UUID which has no meaning to anyone.
 
0 members found this post helpful.
Old 08-03-2010, 02:41 PM   #6
uhcafigdc
Member
 
Registered: Oct 2008
Distribution: Debian Lenny
Posts: 39

Original Poster
Rep: Reputation: 15
The solution, as AwesomeMachine said, is to go with grub2, which eliminates this problem that I have.

FYI saikee, Ubuntu uses grub2.
 
Old 08-03-2010, 03:40 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
uhcafigdc,

Your Post #1 has command "kernel" which is a Grub1 command.

Grub2 used "linux" in its place.

You might have changed to Grub2 now but your original post is from Grub1.

AFAIK Grub1 was still used in Ubuntu V8.04. In V9.04 it was selectable. Grub2 became the default in V10.04. However you can install Grub2 in any distro and have both of them in one Linux.

Last edited by saikee; 08-03-2010 at 03:47 PM.
 
0 members found this post helpful.
  


Reply



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
[SOLVED] LABEL versus UUID in fstab and menu.lst eldiener Linux - General 7 01-03-2010 11:38 PM
grub 1.97 beta3 , if no /boot/grub/menu.lst frenchn00b Linux - General 15 12-09-2009 01:47 AM
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
Lost boot/grub/menu.lst MRDucks Linux - Newbie 12 12-17-2005 01:44 PM
need to access /boot/grub/menu.lst and /boot/grub/device.map neouto Linux - Newbie 8 09-04-2005 11:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:01 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration