Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The closest question I could find is this one, however it is still quite a bit different from what I am needing: GRUB fails to install

My specific setup and the steps I followed to produce this

I am attempting to build the Linux From Scratch project, using book version 7.2. I have followed every step up along the way, and performed every test that I could do to make sure that everything was operating correctly after building. The largest change I had to make was the partitioning, I have /dev/sda1 (as /), /dev/sda2 (as /home), /dev/sda3 (as swap), and /dev/sdb1 (as /source for compiling).

I am performing the installation on a blank hard drive inside of VirtualBox using a LiveCD as the host OS. So, I have ran into very few problems up until the very end. For compiling the kernel, it is not very specific for what options I need to select, so I selected the default options with one change, I made sure the option in "Device Drivers ---> Generic Driver Options ---> Maintain a devtmpfs filesystem to mount at /dev" was checked.

After following the rest of the instructions on setting up GRUB, after the reboot the boot process freezes with the following output visible:

ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata3.00: ATA-6: VBOX HARDDISK, 1.0, max UDMA/133
ata3.00: 33554432 sectors, multi 128: LBA48 NCQ (depth 31/32)
ata3.00: configured for UDMA/133
scsi 2:0:0:0: Direct-Access ATA VBOX HARDDISK 1.0 PQ: 0 ANSI: 5
scsi 4:0:0:0: CD-ROM VBOX CD-ROM 1.0 PQ: 0 ANSI: 5
List of all partitions:
No filesystem could mount root, tried:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
Pid: 1, comm: swapper/0 Not tainted 3.5.2 #1
Call Trace:
 ? panic
 ? mount_block_root
 ? xen_write_msr_safe
 ? mount_root
 ? prepare_namespace
 ? kernel_init
 ? start_kernel
 ? kernel_thread_helper
atkbd serio0: Spurious ACK on isa0060/serio0. Some program might be trying to access hardware directly.

So, when I first received that, I thought that maybe it was something to do with the kernel, maybe I didn't select what I had to select, and after a bit of googling, I found out that I should make sure that "SATA_SIL" is enabled. I also found a website detailing the kernel options that need to be enabled for a kernel running in VirtualBox (http://en.gentoo-wiki.com/wiki/Virtualbox_Guest). I then restored my machine to the saved state right before I compiled the kernel and recompiled it with the options specified on that website, along with SATA_SIL.

However, after the long compilation of the kernel, I went along with the book and issued the command grub-install /dev/sda. However, this time, rather than installing, GRUB returned the following error:

Path to `/boot/grub' is not readable by GRUB on boot. Installation is impossible. Aborting.

My first thought was that it had something to do with file permissions (because "is not readable" really sounds like file permissions). So, just to see, I set the /boot folder (recursively) to 777. Still no success. After that, I did some googling, but really returned no meaningful results.

So, following along with that, I restored the machine to the version where GRUB was working but wouldn't boot up, used the same configuration and recompiled the kernel there (which, I had to add a new hard drive, /dev/sdc, because there wasn't enough space in /dev/sdb1 to compile the kernel with the new options). After going through the long compilation again, I installed the kernel, rebooted, and ... same error dump as before.

The main question

So, now I am to the point where I think I may need some help, if anyone has any ideas how I may get past this boot error and/or the GRUB installation path error, that would be great!

Extra information

All of my software is the exact version from the LFS version 7.2, a full list may be found here: http://pastebin.com/TiJBhbce

Here is a complete list of the structure and setup of all of the drives in the computer: root:~# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders, total 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xeeeb9d91

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     6293503     3145728   83  Linux
/dev/sda2         6293504     6817791      262144   83  Linux
/dev/sda3         6817792     8388607      785408   83  Linux

Disk /dev/sdc: 17.2 GB, 17179869184 bytes
171 heads, 2 sectors/track, 98112 cylinders, total 33554432 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4c41c1df

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048    33554431    16776192   83  Linux

Disk /dev/sdb: 4294 MB, 4294967296 bytes
43 heads, 32 sectors/track, 6096 cylinders, total 8388608 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd3de256f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     8388607     4193280   83  Linux

And the drive that should start as / upon reboot, here's the contents of /dev/sda1:

drwxr-xr-x 24 root root  4096 Feb 17 20:46 .
drwxr-xr-x  3 root root    60 Feb 17 22:46 ..
drwxr-xr-x  2 root root  4096 Feb 17 13:11 bin
drwxr-xr-x  3 root root  4096 Feb 17 16:00 boot
drwxr-xr-x  2 root root  4096 Feb 17 20:46 build
drwxr-xr-x  2 root root  4096 Feb 16 20:06 dev
drwxr-xr-x 12 root root  4096 Feb 17 15:52 etc
drwxr-xr-x  2 root root  4096 Feb 16 13:11 home
drwxr-xr-x  7 root root  4096 Feb 17 22:11 lib
drwx------  2 root root 16384 Feb 16 13:09 lost+found
drwxr-xr-x  4 root root  4096 Feb 16 20:24 media
drwxr-xr-x  2 root root  4096 Feb 16 20:24 mnt
drwxr-xr-x  2 root root  4096 Feb 16 20:24 opt
drwxr-xr-x  2 root root  4096 Feb 16 20:06 proc
drwxr-x---  3 root root  4096 Feb 17 22:14 root
drwxr-xr-x  3 root root  4096 Feb 17 09:38 run
drwxr-xr-x  2 root root  4096 Feb 17 14:36 sbin
drwxr-xr-x  2 root root  4096 Feb 16 13:11 sources
drwxr-xr-x  2 root root  4096 Feb 16 20:24 srv
drwxr-xr-x  2 root root  4096 Feb 16 20:06 sys
drwxrwxrwt  3 root root 20480 Feb 17 22:12 tmp
drwxr-xr-x 13 root root  4096 Feb 16 18:51 tools
drwxr-xr-x  9 root root  4096 Feb 16 20:24 usr
drwxr-xr-x 11 root root  4096 Feb 16 23:26 var
share|improve this question

1 Answer 1

up vote 1 down vote accepted

I have been able to complete LFS, I believe the reason that GRUB was giving the specified error was because I didn't have everything mounted correctly. This script should mount everything as needed:

export LFS=/mnt/lfs
mkdir -p $LFS
mount -v -t ext4 /dev/sda1 $LFS
mount -v -t ext4 /dev/sda2 $LFS/home
mount -v -t ext4 /dev/sdb1 $LFS/sources
/sbin/swapon -v /dev/sda3
mount -v -t tmpfs -o size=20m tmpfs /tmp
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
chroot "$LFS" /tools/bin/env -i \
    HOME=/root                  \
    TERM="$TERM"                \
    PS1='\u:\w\$ '              \
    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
    /tools/bin/bash --login +h

As for the error about not being able to boot up, that was being caused by the kernel compiling. I was using ext4 for my hard drives, and I have to compile that into the kernel in order for it to work. Here is the kernel setup I had to use:

Device Drivers  --->
    Generic Driver Options -->
        [*] Maintain a devtmpfs filesystem to mount at /dev
File systems  --->
    <*> The Extended 4 (ext4) filesystem
        [*] Use ext4 for ext2/ext3 file systems
        [*] Ext4 extended attributes
            [*] Ext4 POSIX Access Control Lists
            [*] Ext4 Security Labels
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.