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 - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-29-2010, 12:43 PM   #1
sfxpt
Member
 
Registered: Feb 2008
Distribution: Debian Testing
Posts: 99
Blog Entries: 3

Rep: Reputation: 16
[Urgent] default boot/grub/menu.lst and etc/fstab of HD install


Hi,

Due to my script error my boot/grub/menu.lst and etc/fstab files are ruined without being backed up first.

Anyone, please post the boot/grub/menu.lst and etc/fstab file of Ubuntu 10 LTS installed by default on HD (or whatever).

THANKS A LOT!
 
Old 08-29-2010, 01:06 PM   #2
basheer
Member
 
Registered: Mar 2009
Location: Bangalore, India
Distribution: CentOS6.5, CentOS7, Ubuntu14.04
Posts: 182

Rep: Reputation: 29
Smile

There is no menu.lst in ubuntu 10.04.
Instead it uses grub.cfg.



The contents of my /etc/fstab are,

root@basheer-desktop:/boot/grub# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sdb2 during installation
UUID=a8c16cf5-5503-4553-8d62-fededae69a2a / ext4 errors=remount-ro 0 1
# swap was on /dev/sda8 during installation
UUID=2bcc3bd6-5f0c-4dac-8f01-b040c8b050e3 none swap sw 0 0
# swap was on /dev/sdb9 during installation
UUID=62d3173b-7647-4e75-a1cb-b5b192a00fbc none swap sw 0 0

The contents of my grub.cfg are

root@basheer-desktop:/boot/grub# cat grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
set saved_entry=${prev_saved_entry}
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z ${boot_once} ]; then
saved_entry=${chosen}
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
set locale_dir=($root)/boot/grub/locale
set lang=en
insmod gettext
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro quiet splash
initrd /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
echo 'Loading Linux 2.6.32-24-generic ...'
linux /boot/vmlinuz-2.6.32-24-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
linux /boot/vmlinuz-2.6.32-23-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro quiet splash
initrd /boot/initrd.img-2.6.32-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
echo 'Loading Linux 2.6.32-23-generic ...'
linux /boot/vmlinuz-2.6.32-23-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro quiet splash
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
echo 'Loading Linux 2.6.32-22-generic ...'
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-21-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
echo 'Loading Linux 2.6.32-21-generic ...'
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=a8c16cf5-5503-4553-8d62-fededae69a2a ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd1,2)'
search --no-floppy --fs-uuid --set a8c16cf5-5503-4553-8d62-fededae69a2a
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set b4a438f5a438bc24
drivemap -s (hd0) ${root}
chainloader +1
}
menuentry "Linux (on /dev/sda2)" {
insmod ext2
set root='(hd0,2)'
search --no-floppy --fs-uuid --set 3227e29d-94a1-40ee-be4c-9e09f8e6506f
linux /boot/vmlinuz root=/dev/hda2 ro vt.default_utf8=0 vga = 773
}
menuentry "Ubuntu 9.10, kernel 2.6.31-14-generic (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d01b43a6-2b19-4ad0-a875-38d1c7da8bc5
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=d01b43a6-2b19-4ad0-a875-38d1c7da8bc5 ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu 9.10, kernel 2.6.31-14-generic (recovery mode) (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d01b43a6-2b19-4ad0-a875-38d1c7da8bc5
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=d01b43a6-2b19-4ad0-a875-38d1c7da8bc5 ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu 9.10, kernel 2.6.28-16-generic (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d01b43a6-2b19-4ad0-a875-38d1c7da8bc5
linux /boot/vmlinuz-2.6.28-16-generic root=UUID=d01b43a6-2b19-4ad0-a875-38d1c7da8bc5 ro quiet splash
initrd /boot/initrd.img-2.6.28-16-generic
}
menuentry "Ubuntu 9.10, kernel 2.6.28-16-generic (recovery mode) (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d01b43a6-2b19-4ad0-a875-38d1c7da8bc5
linux /boot/vmlinuz-2.6.28-16-generic root=UUID=d01b43a6-2b19-4ad0-a875-38d1c7da8bc5 ro single
initrd /boot/initrd.img-2.6.28-16-generic
}
menuentry "Ubuntu 9.10, kernel 2.6.24-16-generic (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d01b43a6-2b19-4ad0-a875-38d1c7da8bc5
linux /boot/vmlinuz-2.6.24-16-generic root=UUID=d01b43a6-2b19-4ad0-a875-38d1c7da8bc5 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
}
menuentry "Ubuntu 9.10, kernel 2.6.24-16-generic (recovery mode) (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d01b43a6-2b19-4ad0-a875-38d1c7da8bc5
linux /boot/vmlinuz-2.6.24-16-generic root=UUID=d01b43a6-2b19-4ad0-a875-38d1c7da8bc5 ro single
initrd /boot/initrd.img-2.6.24-16-generic
}
menuentry "Ubuntu 9.10, memtest86+ (on /dev/sda3)" {
insmod ext2
set root='(hd0,3)'
search --no-floppy --fs-uuid --set d01b43a6-2b19-4ad0-a875-38d1c7da8bc5
linux /boot/memtest86+.bin
}
menuentry "openSUSE 11.1 - 2.6.27.7-9 (on /dev/sda5)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 694a7eeb-63ab-43ba-81b6-b38275b97a28
linux /boot/vmlinuz-2.6.27.7-9-pae root=/dev/disk/by-id/ata-ST380215A_9QZ4Q3V3-part5 resume=/dev/disk/by-id/ata-ST380215A_9QZ4Q3V3-part8 splash=silent showopts vga=0x31a
initrd /boot/initrd-2.6.27.7-9-pae
}
menuentry "Failsafe -- openSUSE 11.1 - 2.6.27.7-9 (on /dev/sda5)" {
insmod ext2
set root='(hd0,5)'
search --no-floppy --fs-uuid --set 694a7eeb-63ab-43ba-81b6-b38275b97a28
linux /boot/vmlinuz-2.6.27.7-9-pae root=/dev/disk/by-id/ata-ST380215A_9QZ4Q3V3-part5 showopts ide=nodma apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
initrd /boot/initrd-2.6.27.7-9-pae
}
menuentry "Ubuntu 8.10 (8.10) (on /dev/sda6)" {
insmod ext2
set root='(hd0,6)'
search --no-floppy --fs-uuid --set f775462f-d36b-4f28-b82a-f3f808d09bc9
linux /boot/vmlinuz-2.6.27-7-generic root=/dev/sda6
initrd /boot/initrd.img-2.6.27-7-generic
}
menuentry "Windows 7 (loader) (on /dev/sdb1)" {
insmod ntfs
set root='(hd1,1)'
search --no-floppy --fs-uuid --set c030659230659068
chainloader +1
}
menuentry "Linux (on /dev/sdb3)" {
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set e608ef51-8a59-497b-9ba7-1f3f339deb8d
linux /boot/vmlinuz root=/dev/sdb3 ro vt.default_utf8=0 vga = 773
}
menuentry "CentOS (2.6.18-194.11.1.el5) (on /dev/sdb5)" {
insmod ext2
set root='(hd1,5)'
search --no-floppy --fs-uuid --set 1f86fa82-7e2c-4862-88e4-23f4a6bea470
linux /boot/vmlinuz-2.6.18-194.11.1.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-194.11.1.el5.img
}
menuentry "CentOS (2.6.18-194.el5) (on /dev/sdb5)" {
insmod ext2
set root='(hd1,5)'
search --no-floppy --fs-uuid --set 1f86fa82-7e2c-4862-88e4-23f4a6bea470
linux /boot/vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.18-194.el5.img
}
menuentry "Ubuntu, with Linux 2.6.32-21-generic (on /dev/sdb7)" {
insmod ext2
set root='(hd1,7)'
search --no-floppy --fs-uuid --set d4b84fa7-21f5-4b4e-a85b-ba14aa0793fd
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=d4b84fa7-21f5-4b4e-a85b-ba14aa0793fd ro quiet splash
initrd /boot/initrd.img-2.6.32-21-generic
}
menuentry "Ubuntu, with Linux 2.6.32-21-generic (recovery mode) (on /dev/sdb7)" {
insmod ext2
set root='(hd1,7)'
search --no-floppy --fs-uuid --set d4b84fa7-21f5-4b4e-a85b-ba14aa0793fd
linux /boot/vmlinuz-2.6.32-21-generic root=UUID=d4b84fa7-21f5-4b4e-a85b-ba14aa0793fd ro single
initrd /boot/initrd.img-2.6.32-21-generic
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
 
1 members found this post helpful.
Old 08-29-2010, 01:20 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I don't think copy/pasting the above example file will work.

One thing that needs to be changed: All the unique UUID's need to be changed to the ones you have. The other entries probably need (extensive?) editing too.

You mention Ubuntu, maybe this will help: Recover Grub 2 via LiveCD

Or the complete Ubuntu document about grub: Ubuntu - Grub2

Hope this helps.
 
1 members found this post helpful.
Old 08-29-2010, 06:32 PM   #4
sfxpt
Member
 
Registered: Feb 2008
Distribution: Debian Testing
Posts: 99

Original Poster
Blog Entries: 3

Rep: Reputation: 16
Quote:
Originally Posted by druuna View Post
I don't think copy/pasting the above example file will work.
yes, I know. thanks all the same.

And thanks for the links as well.
 
Old 08-30-2010, 03:19 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@sfxpt: I was just making sure, you never know!

BTW: You're welcome.
 
Old 08-30-2010, 05:44 PM   #6
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Here is another good tutorial on reinstall grub2 to the MBR from the Ubuntu live CD:
https://help.ubuntu.com/community/Gr...ing%20GRUB%202
 
  


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
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
grub menu.lst Won't boot Windows XP tschima Solaris / OpenSolaris 2 07-23-2008 08:35 PM
Right way to edit /boot/grub/menu.lst ? eeried Linux - Software 2 02-07-2007 08:59 AM
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 - Distributions > Ubuntu

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

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