LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 06-29-2013, 08:09 PM   #1
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 205

Rep: Reputation: 20
Making a raw disk bootable


Hi, everyone!

I am trying to run my fresh-baked LFS which resides in a raw disk image. For now, QEMU is the best option.

The only problem is that the disk image is currently not bootable. It seems to be impossible to be done with grub, since (as far as I know, correct me if I'm wrong) grub doesn't really deal with disk images.

Does anyone know any possible way to put a bootloader on a raw disk image?

Thank you
 
Old 06-30-2013, 06:35 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,020

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Hi there,

Quote:
Originally Posted by TKH View Post
The only problem is that the disk image is currently not bootable.
then I wonder how you manage to boot it inside QEMU. If you managed that, you should easily install GRUB from within QEMU.

Quote:
Originally Posted by TKH View Post
It seems to be impossible to be done with grub, since (as far as I know, correct me if I'm wrong) grub doesn't really deal with disk images.
I've never tried, but I don't see a reason why GRUB shouldn't install into a disk image file instead of, say, /dev/sda. After all, that's the Unix philosophy: "Everything is a file." It might be troublesome to juggle with the right partition references, but ...
A quick search on Google gave me two recipes on how it can be done:

http://ebroder.net/2009/08/04/instal...-a-disk-image/
http://www.slideshare.net/sukhdotin/...images-5094625

Neither of them is bleeding-edge; they seem to deal with GRUB legacy instead of GRUB2. But anyway, they outline the basic procedure.

[X] Doc CPU
 
Old 06-30-2013, 03:44 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 11,722

Rep: Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445
Raw in this case I'd assume is only a term used by qemu to refer to how it uses a virtual hard drive file. Raw, QCOW some other image format won't change how you install a loader. You'd install a loader per LFS documentation. In searches, you don't need to use the term raw. It will give you a different set of results.
 
1 members found this post helpful.
Old 07-01-2013, 05:19 PM   #4
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 205

Original Poster
Rep: Reputation: 20
Hello, all.

Thank you for your replies.
I might have included some extra info for this matter.

First of all, I built the system from the host system. This is the system I'm using to run QEMU on. I put the entire thing on a loop mounted disk image (which I mentioned earlier as the "raw disk image" on the first post).

With this, I want to run the newly built system on VM on the same host used as the one that built this system.

The problem is that I don't know how to make this disk image bootable.
 
Old 07-01-2013, 05:21 PM   #5
TKH
Member
 
Registered: Jul 2011
Location: Milky Way
Distribution: Ubuntu, LFS, Slackware, Fedora
Posts: 205

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by jefro View Post
Raw in this case I'd assume is only a term used by qemu to refer to how it uses a virtual hard drive file. Raw, QCOW some other image format won't change how you install a loader. You'd install a loader per LFS documentation. In searches, you don't need to use the term raw. It will give you a different set of results.
I will start looking with this.
Thank you for your advice.
 
Old 07-01-2013, 07:47 PM   #6
jefro
Guru
 
Registered: Mar 2008
Posts: 11,722

Rep: Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445Reputation: 1445
Qemu can use a virtual hard drive file either as the bootable disk or a secondary. It can also boot to some live cd or LFS type cd to help you.

I don't know how you built this on the host and then transferred it so there may be an issue there.

You make a linux disk (real or virtual) bootable by installing some sort of loader. There are a few choices and some may be difficult after the fact on a LFS built system. Not sure what you have exactly.
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make bootable CDROM to format a raw disk? Barzan Linux - Networking 2 08-19-2004 12:36 PM
How to make bootable CDROM to format a raw disk? Barzan Linux - Distributions 1 08-19-2004 11:30 AM
How to make bootable CDROM to format a raw disk? Barzan Linux - Software 1 08-19-2004 06:22 AM
Making a bootable floppy disk SMB3Master General 4 10-26-2003 06:25 AM
making a bootable disk udayan Programming 2 07-15-2002 11:03 AM


All times are GMT -5. The time now is 01:05 PM.

Main Menu
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