LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 08-27-2008, 09:12 AM   #1
MainBrain
LQ Newbie
 
Registered: Oct 2004
Location: Frankfurt(Germany)
Distribution: Slackware 10
Posts: 16

Rep: Reputation: 0
empty boot folder


I got a working system from a colleague who has left the company. Now I need some files from the boot folder but it is empty.

Code:
yakut@re ~ $ cd /boot/
yakut@re /boot $ ls -al
total 8
drwxr-xr-x  2 root root 4096 Jun  9  2005 .
drwxr-xr-x 20 root root 4096 Aug 28  2007 ..
-rw-r--r--  1 root root    0 Aug 25  2005 .keep
lrwxrwxrwx  1 root root    1 Jun  9  2005 boot -> .
yakut@re /boot $ cd .keep 
-bash: cd: .keep: Not a directory
yakut@re /boot $ ls
boot
yakut@re /boot $ cat .keep 
yakut@re /boot $
 
Old 08-27-2008, 09:21 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
If the system is running, then restore the /boot/ files from backup. That is where the kernel, initrd and grub files live. You can't boot up or run without them. Don't reboot until the files are restored.

Look in the filesystem. Could you have mounted something else over the /boot directory hiding the contents of the partition that should be mounted there? Look at the output of "mount". Does the device that /boot uses the same as what is listed in /etc/fstab?

Note: It could be that /boot is a subdirectory of the root directory (/) and doesn't have a partition dedicated to it.o
Note also: Check if the kernel and initrd file are in the root directory. Also check for these grub files:

default device.map.old fat_stage1_5 iso9660_stage1_5 menu.lst minix_stage1_5 stage1 ufs2_stage1_5 xfs_stage1_5
device.map e2fs_stage1_5 ffs_stage1_5 jfs_stage1_5 menu.lst.old reiserfs_stage1_5 stage2 vstafs_stage1_5

If they are there, check the menu.lst file and see if the path to the kernel and initrd file are in "/" according to the "kernel ..." and "initrd ..." entries.

Last edited by jschiwal; 08-27-2008 at 09:23 AM.
 
Old 08-27-2008, 12:10 PM   #3
gurses
LQ Newbie
 
Registered: Aug 2008
Posts: 13

Rep: Reputation: 0
I have also a similar problem. My /boot directory is completely empty.
I have both fc6 and xp as operating systems, and xp works without problems.

my /etc/fstab is:
Code:
LABEL=/          /          ext3    defaults 1 1
LABEL=/boot      /boot      ext3    defaults 1 2
devpts           /dev/pts   devpts  gid=5,mode=620 0 0
tempfs           /dev/shm   tmpfs   defaults 0 0
proc             /proc      proc    defaults 0 0
sysfs            /sys       sysfs   defaults 0 0
LABEL=SWAP-sda8  swap       swap    defaults 0 0
/dev/sda5        /DATA      vfat    defaults 1 3
output of mount command is:

Code:
/dev/sda9 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda7 on /boot type ext3 (rw)
tempfs on dev/shm type tmpfs (rw)
/dev/sda5 on /DATA type vfat (rw)
none on /proc/sys/fs/binfmat_misc type binfmat_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
Currently my system does not boot completely, it gives errors and text
mode login screen comes. Then I can login. I tried as a superuser to mount /dev/sda7 as follows:
#mount /dev/sda7 /media/exthd5

Inside the directory I saw required data for /boot directory

Code:
config-2.6.18-1.2798.fc6         lost+found
config-2.6.22.14-72.fc6          System.map-2.6.18-1.2798.fc6
grub                             System.map-2.6.22.14-72.fc6
initrd-2.6.18-1.2798.fc6.img     vmlinuz-2.6.18-1.2798.fc6
initrd-2.6.22.14-72.fc6.img      vmlinuz-2.6.22.14-72.fc6
I plan to copy what is inside of /media/exthd5 to /boot. Is it a good idea to try?
Originally I posted my problem in the following topic:

http://www.linuxquestions.org/questi...th-fc6-665545/

Since I have a similar empty /boot dirctory problem I made this reply here.

thanks,
Ercan

Last edited by gurses; 08-27-2008 at 12:23 PM.
 
Old 08-27-2008, 02:14 PM   #4
MainBrain
LQ Newbie
 
Registered: Oct 2004
Location: Frankfurt(Germany)
Distribution: Slackware 10
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you very much jschiwal.

Quote:
If the system is running, then restore the /boot/ files from backup. That is where the kernel, initrd and grub files live. You can't boot up or run without them. Don't reboot until the files are restored.
The system is running and boots without problems. It is in use for more then a year already.

Quote:
Look in the filesystem. Could you have mounted something else over the /boot directory hiding the contents of the partition that should be mounted there? Look at Look in the filesystem. Could you have mounted something else over the /boot directory hiding the contents of the partition that should be mounted there? Look at the output of "mount". Does the device that /boot uses the same as what is listed in /etc/fstab?the output of "mount". Does the device that /boot uses the same as what is listed in /etc/fstab?
This is what mount tells me:
Code:
/dev/hda6 on / type ext3 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
udev on /dev type tmpfs (rw,nosuid)
devpts on /dev/pts type devpts (rw,nosuid,noexec)
/dev/hda5 on /tmp type ext3 (rw,noexec,noatime)
/dev/hda7 on /home type ext3 (rw,noatime)
/dev/hdb1 on /usr type ext3 (rw,noatime)
/dev/hdb2 on /opt type ext3 (rw,noatime)
/dev/hdb3 on /var type ext3 (rw,noatime)
none on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
and here is whats inside of fstab:
Code:
/dev/hda1		/boot		ext2		noauto,noatime,defaults		1 2
/dev/hda6		/		ext3		noatime			0 1
/dev/hda2		none		swap		sw			0 0
/dev/hda5		/tmp		ext3		noatime,noexec			0 0
/dev/hda7		/home		ext3		noatime			0 0
/dev/hdb1		/usr		ext3		noatime 0 0
/dev/hdb2		/opt		ext3		noatime 0 0
/dev/hdb3		/var		ext3		noatime 0 0
/dev/cdroms/cdrom0	/mnt/cdrom	iso9660		noauto,ro,user		0 0
/dev/fd0		/mnt/floppy	auto		noauto			0 0

# NOTE: The next line is critical for boot!
none			/proc		proc		defaults		0 0

none			/dev/shm	tmpfs		defaults,nodev,nosuid,noexec		0 0

This tells me that /boot should be mounted on its own partition on hda1 but that conflicts with the output of mount right?

Quote:
Note: It could be that /boot is a subdirectory of the root directory (/) and doesn't have a partition dedicated to it.o
Note also: Check if the kernel and initrd file are in the root directory. Also check for these grub files:
No. I can not find any grub files even though I am sure grub is used and not lilo.

Maybe boot is automatically unmounted after booting. Where can I find that kind of startup scripts?
 
Old 08-27-2008, 02:26 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 730Reputation: 730Reputation: 730Reputation: 730Reputation: 730Reputation: 730Reputation: 730
the fstab output says that hda1 does not automatically get mounted to /boot ("noauto" in the 4th column).

I guess the kernel can be running from /dev/hda1 without it being mounted????

Just remove "noauto" from the fstab entry and reboot.
 
Old 08-28-2008, 04:58 AM   #6
MainBrain
LQ Newbie
 
Registered: Oct 2004
Location: Frankfurt(Germany)
Distribution: Slackware 10
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany View Post
the fstab output says that hda1 does not automatically get mounted to /boot ("noauto" in the 4th column).

I guess the kernel can be running from /dev/hda1 without it being mounted????

Just remove "noauto" from the fstab entry and reboot.
Thank you very much! Finally it works.
 
Old 08-28-2008, 05:14 AM   #7
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Quote:
Originally Posted by pixellany View Post
I guess the kernel can be running from /dev/hda1 without it being mounted????
Absolutely. In the case of Lilo the partition only needs to be mounted when 'lilo' is run to update the bootloader; part of the bootloader is written with a table of system names, kernel boot params, and indices to find the kernel and initrd/initramfs (if specified). In the case of 'Grub', it only has to know what partition to look for its 'menu.lst' file and from there it finds out what partition to search for the kernel and initrd.

In both cases there is absolutely no need to have anything in the /boot directory after the kernel and initramfs have been loaded by the bootloader. The kernel is already in memory and the driver modules are in the /lib directory. It is a bit of a nuisance though when you want to update the Grub menu.lst or the lilo bootloader.
 
Old 08-28-2008, 03:28 PM   #8
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I just had a vague memory. I think this was done intentionally to help prevent the kernel from being tampered with, and depends on the fact that grub accesses the drive itself. A hacker could mount it manually however, so it may just protect against automated attacks.

Last edited by jschiwal; 08-28-2008 at 06:46 PM.
 
  


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
how to check if a folder is empty twistadias Linux - Newbie 5 08-11-2008 06:12 AM
empty home folder sigmacunfu Linux - Newbie 4 09-24-2006 05:41 PM
Empty Folder ? wlaw Linux - Networking 1 09-07-2004 04:42 AM
rmdir for non-empty folder Zaius Linux - General 2 01-09-2004 11:09 PM
How do I empty the /tmp folder at boot? Posty Slackware 13 10-12-2003 09:36 PM


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