LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-21-2009, 07:56 AM   #1
lucky1
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Rep: Reputation: 0
Reg boot problem


Hi,

Without my knowledge contents of /boot has been deleted. So, now I am unable to boot linux OS from harddisk but able to boot through OS DVD. Could you please suggest me how to solve that problem?
 
Old 09-21-2009, 08:17 AM   #2
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Please tell us which distro you are using.

Most dvds have a repair or recovery option which will repair your bootloader.
 
Old 09-21-2009, 08:57 AM   #3
lucky1
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Hi,

I am using Suse 10 and I tried many methods for installing grub loader. And atlast I came to knew recover lost partition option.Through Repair Installed system, I tried to recover lost partition. It shows output that it may take lot of time depends on Harddisk speed like that. But after some time, the same window was there, so I given finish and quit. But it didn't do recover.

Quote:
Originally Posted by Larry Webb View Post
Please tell us which distro you are using.

Most dvds have a repair or recovery option which will repair your bootloader.
 
Old 09-21-2009, 09:19 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
If the /boot directory was deleted, then you have no kernel or initrd file----it won't do any good to install the bootloader.

Quote:
Without my knowledge contents of /boot has been deleted
I think this requires that someone have root access on your system---you might want to fix that before proceeding.

I would think that the straightforward solution would be to re-install the OS.
 
Old 09-22-2009, 12:19 AM   #5
lucky1
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
If the /boot directory was deleted, then you have no kernel or initrd file----it won't do any good to install the bootloader.

I think this requires that someone have root access on your system---you might want to fix that before proceeding.

I would think that the straightforward solution would be to re-install the OS.
I have root access. Can you please tell me how to fix it. I want to proceed by avoiding OS reinstall.
 
Old 09-22-2009, 12:34 AM   #6
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by lucky1 View Post
I have root access. Can you please tell me how to fix it. I want to proceed by avoiding OS reinstall.
Sure, you can avoid that. But if you want your computer to work again, you can't.

1. Use a live CD/DVD to save the data in the drive to a separate storage device.

2. Reinstall Linux.

3. Restore your data.

And deal with whatever problem caused your /boot directory to be deleted.
 
Old 09-22-2009, 12:45 AM   #7
lucky1
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by lutusp View Post
Sure, you can avoid that. But if you want your computer to work again, you can't.

1. Use a live CD/DVD to save the data in the drive to a separate storage device.

2. Reinstall Linux.

3. Restore your data.

And deal with whatever problem caused your /boot directory to be deleted.
I don't have much important data but the thing is that, that system is in remote place and configured many things. So, I can't do much on it and can't make someone to do all these things. So if we can fix and access directly means then it would be fine.
 
Old 09-22-2009, 02:22 AM   #8
ak@shdubey
LQ Newbie
 
Registered: Sep 2009
Location: India
Distribution: Redhat/Oracle Ent/CentOS
Posts: 28
Blog Entries: 1

Rep: Reputation: 16
we can repair existing install

Quote:
Originally Posted by lucky1 View Post
Hi,

Without my knowledge contents of /boot has been deleted. So, now I am unable to boot linux OS from harddisk but able to boot through OS DVD. Could you please suggest me how to solve that problem?
Hi Lucky1,

We can first install grub boot loader from your DVD & than copy required files(kernel & initrd) to boot linux .

However before we do that can you pls post output of following commands
#uname -r (to know the existing kernel/os release)
#find / -name *vmlinuz* (to check if kernel image may exist as backup on your system somwhere, my assumption thou)

#find / -name *menu.l* (to check if menu.lst may exist as backup on your system somwhere, my assumption thou)

#find / -name *initrd* (to check if initrd may exist as backup on your system somwhere, my assumption thou)


If we already have these files, all we will need to do is install grub from DVD
1. Boot PC
2. type 'linux rescue' when prompted
3. Accept standard options [Eg English]
4. select your Linux partition used during the original distro installation when Grub was originally installed (Eg SDA1)
5. when prompted, select allow write access [ie, NOT read only]
6. type 'chroot /mnt/sysimage' [as suggested by linux rescue]
7. type 'grub-install /dev/sda' [assuming you wish to use the Primary boot sector of sda - you will wish to use this if you installed it here during the original distro installation]
8. type 'vi grub.conf'
This will open something like,
----------------------------------------------------
#This is a sample file i scracthed from internet
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,1)
# kernel /vmlinuz-version ro root=/dev/hda3
# initrd /initrd-version.img
#boot=/dev/hda1
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.7-10)
root (hd0,0)
kernel /vmlinuz-2.4.7-10 ro root=/dev/hda3 hdc=ide-scsi
initrd /initrd-2.4.7-10.img

----------------------------------------------------
update following entries here,
kernel /<exact vmlinuz file name> ro root=<path to device for vmlinuz file
initrd /<initrd image file name>

9. restart PC

I am also a newbie trying to learn, please get back so that we can solve this issue.

-Akash

Last edited by ak@shdubey; 09-22-2009 at 02:24 AM. Reason: fixed typo errors :(
 
Old 09-22-2009, 08:52 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by lucky1 View Post
I have root access. Can you please tell me how to fix it. I want to proceed by avoiding OS reinstall.
What I meant was that **someone else** has root access.....My concern was that you need to find out who deleted the /boot directory---otherwise, it may happen again.
 
Old 09-23-2009, 02:22 AM   #10
lucky1
LQ Newbie
 
Registered: Sep 2009
Posts: 5

Original Poster
Rep: Reputation: 0
[QUOTE=ak@shdubey;3692481]Hi Lucky1,

We can first install grub boot loader from your DVD & than copy required files(kernel & initrd) to boot linux .

However before we do that can you pls post output of following commands
#uname -r (to know the existing kernel/os release)
2.6.16.21-0.8-default

#find / -name *vmlinuz* (to check if kernel image may exist as backup on your system somwhere, my assumption thou)
/usr/share/YaST2/scrconf/boot_vmlinuz_version.scr
/boot/vmlinuz
/boot/vmlinuz-2.6.16.21-0.8-default
find: WARNING: Hard link count is wrong for /proc/3728: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched.

#find / -name *menu.l* (to check if menu.lst may exist as backup on your system somwhere, my assumption thou)
/boot/grub/menu.lst
/boot/grub/menu.lst.old
find: WARNING: Hard link count is wrong for /: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched.

#find / -name *initrd* (to check if initrd may exist as backup on your system somwhere, my assumption thou)
/lib/mkinitrd
/var/log/YaST2/y2logmkinitrd
/usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/linux/initrd.ph
/usr/share/doc/packages/evms/INSTALL.initrd
/usr/share/man/man4/initrd.4.gz
/usr/share/man/man8/mkinitrd.8.gz
/usr/share/mkinitrd
/usr/include/linux/initrd.h
/boot/initrd-2.6.16.21-0.8-default
/boot/initrd
find: WARNING: Hard link count is wrong for /: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched.
/sbin/mk_initrd
/sbin/mkinitrd

Right now I booted system from DVD. If the output is like above then can we able to continue grub install using ur same steps rather than OS re-install.

Thanks for ur response.

Last edited by lucky1; 09-23-2009 at 02:23 AM.
 
Old 09-23-2009, 06:45 AM   #11
ak@shdubey
LQ Newbie
 
Registered: Sep 2009
Location: India
Distribution: Redhat/Oracle Ent/CentOS
Posts: 28
Blog Entries: 1

Rep: Reputation: 16
[QUOTE=lucky1;3693773]
Quote:
Originally Posted by ak@shdubey View Post
Hi Lucky1,

Right now I booted system from DVD. If the output is like above then can we able to continue grub install using ur same steps rather than OS re-install.

Thanks for ur response.
Per find result
Quote:
#find / -name *vmlinuz* (to check if kernel image may exist as backup on your system somwhere, my assumption thou)
/usr/share/YaST2/scrconf/boot_vmlinuz_version.scr
/boot/vmlinuz
/boot/vmlinuz-2.6.16.21-0.8-default
find: WARNING: Hard link count is wrong for /proc/3728: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched.
It is clear that yout '/boot' folder is intact & you do have the kernel safely stored there
Quote:
/boot/vmlinuz-2.6.16.21-0.8-default
same goes with menu.lst per your output
Quote:
#find / -name *menu.l* (to check if menu.lst may exist as backup on your system somwhere, my assumption thou)
/boot/grub/menu.lst
/boot/grub/menu.lst.old
find: WARNING: Hard link count is wrong for /: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched.
we have the required file safely stored in '/boot/grub/menu.lst' path

same goes with initial ramdesk file 'initrd' it is also intact & already exist.
Quote:
#find / -name *initrd* /boot/initrd-2.6.16.21-0.8-default
/boot/initrd
find: WARNING: Hard link count is wrong for /: this may be a bug in your filesystem driver. Automatically turning on find's -noleaf option. Earlier results may have failed to include directories that should have been searched.
/sbin/mk_initrd
/sbin/mkinitrd
Now i doubt that your grub.conf could also already be there, please try

#find / -name *grub*

if you could locate the grub.conf, no need to install grub again just update the grub.conf per my previous post with kernel name as 'vmlinuz-2.6.16.21-0.8-default' and run the commands per my previous post.

good luck

-Akash

Last edited by ak@shdubey; 09-23-2009 at 06:55 AM. Reason: forgot to type soln :)
 
  


Reply


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
Windows: Which program can track the reg updates at software install and make a reg? frenchn00b General 5 11-20-2008 05:26 PM
Problem with reg exp script abefroman Programming 2 12-19-2005 04:53 PM
Nice surprise Kaffeine plays Reg 1 and Reg 2 disks 1kyle SUSE / openSUSE 1 10-10-2005 05:47 PM
problem reg fdisk Morph Red Hat 3 09-13-2003 06:40 PM
problem reg xpvm linuser Linux - General 0 02-21-2002 07:08 AM


All times are GMT -5. The time now is 10:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration