LinuxQuestions.org
Review your favorite Linux distribution.
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 01-13-2012, 09:38 AM   #1
mandyapenguin
Member
 
Registered: Nov 2011
Location: India
Distribution: RedHat, Cent OS, Fedora, Debian, Ubuntu
Posts: 106

Rep: Reputation: Disabled
/boot showing only grub folder and other files are not exist


Hi..All,
Today in our office one of the PC(Ubuntu11.04) was not booting up and showing continuous blinking. Then I booted through Ubuntu11.04 Rescue CD and found I was able mount all partitions apart from /boot.
Here is the /boot and / partition details
Code:
/dev/sda1 is /boot  100 MB
/dev/sda2 is /  50 GB
Then I ran
Code:
fsck /dev/sda1
command to check the file system for /boot partition. It was prompting many times(nearly or more than 50 times) as whether yes or no to fix, then I killed the process and used
Code:
fsck -y /dev/sda1
It took a while and stopped itself. Then I mounted the /boot partition and found nothing was inside the /boot partition!!?,
Does this fsck command wiped out everything?
I unmounted the /boot partition and installed the grub using below steps
Code:
mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot
grub-install --root-directory=/mnt /dev/sda
grub got installed successfully, Then I ran the below commands
Code:
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt/ update-grub
Found it updated successfully. Then I unmounted all partitions and rebooted. But it is not booting and giving grub prompt
Code:
grub>
Then I again booted through rescue CD, and mouted /boot and / partitions as above and found apart from "grub" folder, the other files(abi-3.0.0-12-generic, memtest86+.bin, config-3.0.0-12-generic, memtest86+_multiboot.bin, System.map-3.0.0-12-generic, initrd.img-3.0.0-12-generic, vmcoreinfo-3.0.0-12-generic, vmlinuz-3.0.0-12-generic which are exist in the other machine) are not exist in the /boot partition. So please help me what can be done to recover other files and to make the system to boot up again.

Last edited by mandyapenguin; 01-13-2012 at 09:41 AM.
 
Old 01-14-2012, 09:00 AM   #2
FastCode
LQ Newbie
 
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
You should download kernel images for your distro from their site and install them.

the simple way:
Code:
mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt
apt-get install linux-image-XXXX
update-grub
Should do the trick.

Don't forget to replace XXXX with kernel version or simply use aptitude

EDIT:
The {sometimes faster} way:
The other way(after chrooting):
They are already somewhere in pool directory in the rescue disk.
Copy them to /var/apt/cache/archive
And
Code:
mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot
mkdir /mnt/cd
mount --bind /media/cdrom /mnt/cd
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt
cp -r /cd/XXXX/pool/l/XXXX /var/cache/apt/archive
dpkg -i -GE /var/cache/apt/archive/linux-image*.deb
update-grub

Last edited by FastCode; 01-14-2012 at 09:09 AM. Reason: extra -i in dpkg command
 
1 members found this post helpful.
Old 01-15-2012, 03:40 AM   #3
mandyapenguin
Member
 
Registered: Nov 2011
Location: India
Distribution: RedHat, Cent OS, Fedora, Debian, Ubuntu
Posts: 106

Original Poster
Rep: Reputation: Disabled
Thank you very much FastCode
Code:
mount /dev/sda2 /mnt
mount /dev/sda1 /mnt/boot
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt
Could you please guide me that how can I search the linux-image version from the internet for the below command
Code:
apt-get install linux-image-XXXX
Since I don't know the linux-image version, I installed aptitude package and ran the below commands
Code:
aptitude install linux-image
update-grub
Good Fix!, Now I got the grub menu and able to boot both of the O/S. Thanks for your kind assistance.

Last edited by mandyapenguin; 01-15-2012 at 03:41 AM.
 
  


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
Evolution is showing hidden files and folders in the folder tree Cyberman Linux - Software 1 10-11-2010 01:58 AM
Installed Fedora as dual boot but Grub boot menu is not showing up nilocjin Linux - Newbie 4 06-03-2009 03:09 PM
GRUB not showing the graphical boot screen tuxeedo Linux - Newbie 4 03-17-2007 04:29 AM
Grub - Delay before showing boot menu IK81 Linux - General 3 10-02-2006 12:02 PM
watch a folder and then print if files exist bhar0761 Linux - General 2 07-30-2005 03:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:54 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