Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] System boots but the /boot directory is empty...
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Noon
n00b
n00b


Joined: 12 Oct 2016
Posts: 4

PostPosted: Wed Oct 12, 2016 2:03 am    Post subject: [SOLVED] System boots but the /boot directory is empty... Reply with quote

I've been absolutely livid trying to find a solution to this problem, I can't see what I'm doing wrong.

To surmise:
I'm building Gentoo to be used on a Libretto 110CT. Since the libretto does not have enough RAM to handle the install disc (it would take ages even if it did,) I'm using VirtualBox in raw disk mode to install Gentoo onto a CF card, and then swapping that CF card over to the libretto using a CF to IDE adapter.

The problem:
Everything works fine until I boot into the new environment on either platform. In VirtualBox, I load GRUB2 fine and boot into the gentoo environment with no issues. However, I can't ping google.com or do any networking. I figured "whatever, I just want to make sure I can actually use gentoo on the libretto."

I swap the CF card into the libretto and try to boot through GRUB2 and get a kernel panic: http://i.imgur.com/ltrZhPO.jpg
I assume this is because the drive naming conventions have changed in the switching process (though I thought GRUB wouldn't have this issue since it points at the actual device unlike LILO which points to a /dev/ location), so I go ahead and try a manual boot through the GRUB command line: http://i.imgur.com/XFtyWaw.jpg
GRUB refuses to autocomplete with the tab key for file locations so I put everything in manually. However, the Gentoo vmlinuz image isn't found on any of the listed partitions. I try to see what devices are mounted and get this lovely surprise:
Code:
df -h
df: cannot read table of mounted file systems: No such file or directory.


I booted back into the CF card via VirtualBox, and indeed the /boot directory was absolutely empty. I booted back into the build through the livecd and after mounting everything and chrooting, everything was acting normally.

I've tried googling my way to find a solution but to no avail, which is why I'm here.
Here's all of my build information:
4.4.21 Kernel .config: http://pastebin.com/1FL8Y1Jf
Partition table: http://i.imgur.com/DTWIUDK.png
fstab: http://i.imgur.com/658rO20.png

I tried to follow the gentoo handbook to a T for the most part so I'm extremely confused as to what's going on. The closest I could find is that it's most likely an issue with /etc/mtab or the lack thereof. The handbook never mentions /etc/mtab at all though so I'm super lost.


Last edited by Noon on Wed Oct 12, 2016 9:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5765

PostPosted: Wed Oct 12, 2016 2:24 am    Post subject: Reply with quote

/etc/mtab should be a symlink to /proc/self/mounts; if you're getting errors about it then it means /proc/ isn't mounted.

unknown-block(0,0) usually means missing IDE driver. It's unlikely those SATA drivers you have enabled will work in a Pentium 1 machine.
Back to top
View user's profile Send private message
Noon
n00b
n00b


Joined: 12 Oct 2016
Posts: 4

PostPosted: Wed Oct 12, 2016 4:24 am    Post subject: Reply with quote

Thanks for the quick response - I tweaked the kernel .config and added CONFIG_PATA_LEGACY, the libretto is now booting into Gentoo exactly like how the VirtualBox VM was. The mtab problem still persists. On boot I recall seeing several warnings that the system was read only, which could very well be what's keeping it from creating an mtab file. Any ideas on any of this?
Back to top
View user's profile Send private message
Noon
n00b
n00b


Joined: 12 Oct 2016
Posts: 4

PostPosted: Wed Oct 12, 2016 4:30 am    Post subject: Reply with quote

Here are some relevant screen grabs I managed to get that might be useful: http://imgur.com/a/zZdfW
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Wed Oct 12, 2016 7:51 am    Post subject: Reply with quote

Noon,

A few words on the empty /boot. First, a little about the boot process.
The boot process, reads the operating system from the hard drive before there is an operating system installed that can read the hard drive.
Yep, its an infinite recursion - there are several in the boot process and all need to be broken.

First off, the unaided BIOS can read exactly once hard drive block that's LBA 0.
The code here (446 bytes max) uses the BIOS to read more blocks from the hdd.
We have a very simple loader, reading in more capable loaders. This process repeats several times until the grub stage2 loader is read from /boot/grub and grub displays its menu.
Except at this time, its not /boot/grub. That's the kernel filesystem tree reference. The kernel is not yet loaded, root is not mounted and the kernel filesystem tree does not yet exist.
Grub has to make its own arrangements to read the files needed for booting.

Once grub continues, it loads a kernel and optionally an initrd then exits by jumping to the kernel start address.
The kernel reads the root=/dev/... on the command line to find the root of the filesystem tree. It can't read /etc/fstab as root is not mounted.

Long story short, /boot is not mounted to support the boot process and the default Gentoo /etc/fstab has the noauto option on /boot, so its not mounted by the localmount serviece either.
You seem to have removed the noauto option from your /etc/fstab.

During the early part of the boot process, root is deliberately mounted read only, so that rootfsck can run without doing any damage.
If this fails, root stays read only.

dmesg may have something to say about what failed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Noon
n00b
n00b


Joined: 12 Oct 2016
Posts: 4

PostPosted: Wed Oct 12, 2016 9:25 pm    Post subject: Reply with quote

Thanks for the reply,

I went ahead and looked at dmesg and saw several errors related to the CONFIG_LBDAF option being disabled. While I don't have any files or devices to access that are 2TB or bigger, evidently it is required by the ext4 filesystem which all my partitions are running under (details: http://cateee.net/lkddb/web-lkddb/LBDAF.html).

I added CONFIG_LBDAF to my kernel and now it appears that everything is working as it should on both the VM and the Libretto.
As for my fstab configuration, I removed noauto based on this reading from the Gentoo handbook:

Quote:
Some users don't want their /boot/ partition to be mounted automatically to improve their system's security. Those people should substitute defaults with noauto. This does mean that those users will need to manually mount this partition every time they want to use it.


For the sake of convenience I would rather have the /boot partition mounted automatically, manually mounting it each time I want to use the libretto seems like a pain. I'm sure some scripting could be done to make this automatic but at that point is there any difference between mounting with that script or just by relying on the fstab configuration?

Anyways, everything appears to be working now! You guys have been an huge help and I learned a ton from the troubleshooting process as well as everyone's advice and past forum posts. I'm sure I'll have more issues in the future, I'll probably stick around on this forum since Gentoo seems like the optimal OS for the libretto hardware.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43213
Location: 56N 3W

PostPosted: Thu Oct 13, 2016 11:57 am    Post subject: Reply with quote

Noon,

Your /etc/fstab will read something like mine below..
Code:
[code]# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>
UUID=c400b18c-0210-4338-a0fd-f437ecbaaf99 /boot           ext4            noauto,noatime  1 2[/code]

You maf not use UUID but thats not important. Just remove the noauto, option to have /boot auto mounted.

On a 32 bit install CONFIG_LBDAF is required for write access to ext4. I'm pleased you fixed that.
64 bit installs just work that way anyway.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum