LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-08-2013, 04:13 AM   #1
anjohn
LQ Newbie
 
Registered: Nov 2012
Posts: 16

Rep: Reputation: Disabled
Create bootable disk image with linux kernel


Hi,

I need help for creating a bootable diskimage. I have a filesystem and a kernel included in a file rootfs.ext2 (or rootfs.tar, I have both).

I made a bootable image by using dd,fdisk and mkfs.ext2, but at the end the kernel allways complains that the root filesystem could not be mounted. The kernel is configured to use ext4 for ext2/ext3.

What could I do wrong, how would you get the filesystem to boot?

My last error was:
List of all partitions:
0800 4013856 sda driver: sd
0801 64228 sda1 1d702457-01
0810 2000376 sdb driver: sd
0811 2000344 sdb1 0f93c873-01

No filesystem could mount root, tried: ext3 ext2 ext4 vfat ...
Kernel panic - not syncing: VFS: unable to mount root fs on unknown-block(8,1)

I don't know what to do with this error.

Please help me, thanks!
 
Old 08-08-2013, 07:17 PM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
I can't give you exact solutions as I have no time to trouble shoot your kernel but

1) assuming bootable disk image means an iso image for an optical disk
you need to specify what bootloader you are using
---some people use syslinux other use other things
---some people use http://unetbootin.sourceforge.net/

b) if you mean an bootable drive image....same deal altho the actual commands may differ

2) the kernel must have INBUILT support for each partition its trying to boot
---so automatically fails if a module
hint....recompile to add full ext2/3/4 as in built pls

3)
Quote:
I have a filesystem and a kernel included in a file rootfs
I hope this is just poor wording
kernel must be outside rootfs (initrd)

good luck
 
Old 08-15-2013, 06:33 AM   #3
anjohn
LQ Newbie
 
Registered: Nov 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thank you for your answer.

1) I mean a bootable drive image. Our customers have industrial pcs and those boot systems on compact flash cards. They can get new images with a bootable partition on it from us when there are updates.

2) I build the system with "buildroot" and marked the ext4 option and the option to use ext4 for ext2 and ext3 in the kernel configuration.

3) I get a filesystem for example in a tar-File. There I can browse through the folders /boot , /dev and so on .....
There exists a file bzImage in /boot which is actually the kernel image.
I am currently using grub as bootloader. For installing grub you have to set the path to the kernel image in the root filesystem. I set /boot/bzImage.

I thought that you don't need to have initrd?
 
Old 08-16-2013, 05:36 AM   #4
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by anjohn View Post
1) I mean a bootable drive image. Our customers have industrial pcs and those boot systems on compact flash cards. They can get new images with a bootable partition on it from us when there are updates.
So actually you just need the filesystem, the partition table and a way to get this on the flash, right? In that case just install everything on a system. Then make a backup of the mbr and the filesystem. Then create some livecd which all gets this to the flash card. Maybe check out clonezilla live cd.

Quote:
Originally Posted by anjohn View Post
2) I build the system with "buildroot" and marked the ext4 option and the option to use ext4 for ext2 and ext3 in the kernel configuration.
Okay so the kernel now is able to use the ext family of filesystem. More important is what the filesystem of your root filesystem is. That is definitely to be going into the kernel as well.

Quote:
Originally Posted by anjohn View Post
3) I get a filesystem for example in a tar-File. There I can browse through the folders /boot , /dev and so on .....
There exists a file bzImage in /boot which is actually the kernel image.
I am currently using grub as bootloader. For installing grub you have to set the path to the kernel image in the root filesystem. I set /boot/bzImage.
grub needs a "root" device to know where it is to look out for the kernel and/or initrd. This is set with set root='(/dev/sd#,partitionnumber). Technicaly this is not needed but if you would give any path info to the kernel option you would have to state the root device as well.
So to actually boot a kernel grub only needs one line: linux (device)/boot/bzImage root=/dev/sd#
the root= here is the actuall path of the device that holds your root filesystem. It could also be given using UUID syntax.


Quote:
Originally Posted by anjohn View Post
I thought that you don't need to have initrd?
Actually you don't need an initrd as long as the kernel has all the features compiled into it that are needed to get the root file system up. That is y in kernel configuration and not m like in module.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create bootable image from installed Linux or VM Bankaifan Linux - Newbie 6 02-22-2013 07:16 PM
how to create a kernel bootable image aloktiagi Linux - Newbie 1 04-23-2010 07:15 AM
create bootable floppy image with only kernel and initrd ta0kira Slackware 1 04-02-2009 09:26 PM
How to create a CD bootable ISO image for 2.6.16 kernel vb_sridevi Linux - Newbie 4 06-25-2008 01:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:52 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
Open Source Consulting | Domain Registration