LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reg boot problem (https://www.linuxquestions.org/questions/linux-newbie-8/reg-boot-problem-756750/)

lucky1 09-21-2009 06:56 AM

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?

Larry Webb 09-21-2009 07:17 AM

Please tell us which distro you are using.

Most dvds have a repair or recovery option which will repair your bootloader.

lucky1 09-21-2009 07:57 AM

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 (Post 3691542)
Please tell us which distro you are using.

Most dvds have a repair or recovery option which will repair your bootloader.


pixellany 09-21-2009 08:19 AM

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.

lucky1 09-21-2009 11:19 PM

Quote:

Originally Posted by pixellany (Post 3691634)
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.

lutusp 09-21-2009 11:34 PM

Quote:

Originally Posted by lucky1 (Post 3692400)
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.

lucky1 09-21-2009 11:45 PM

Quote:

Originally Posted by lutusp (Post 3692412)
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.

ak@shdubey 09-22-2009 01:22 AM

we can repair existing install
 
Quote:

Originally Posted by lucky1 (Post 3691523)
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

pixellany 09-22-2009 07:52 AM

Quote:

Originally Posted by lucky1 (Post 3692400)
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.

lucky1 09-23-2009 01:22 AM

[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.

ak@shdubey 09-23-2009 05:45 AM

[QUOTE=lucky1;3693773]
Quote:

Originally Posted by ak@shdubey (Post 3692481)
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


All times are GMT -5. The time now is 08:05 PM.