Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Newbie boot and fs mount question
@ 2015-12-22 16:07 Mathew Benson
  2015-12-22 20:09 ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Mathew Benson @ 2015-12-22 16:07 UTC (permalink / raw)
  To: buildroot

How do I mount / from sda1 rather than RAM disk?

Sorry for the simple question and let me know if there is a better forum
for this.  I'm new to buildroot and busybox and haven't compiled a custom
kernel in at least 15 years.  I'm using the latest version of buildroot as
of this weekend, used the predefined i386 config, and built with kernel
version 3.8.17.  It seems to boot just fine but it appears the file system
is mounted from the initial RAM disk.  Any change I make to the file system
is volatile.  What do I need to do to make it mount / from sda1 instead of
the RAM disk?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151222/2cc00e13/attachment.html>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Newbie boot and fs mount question
  2015-12-22 16:07 [Buildroot] Newbie boot and fs mount question Mathew Benson
@ 2015-12-22 20:09 ` Thomas Petazzoni
  2015-12-24  1:04   ` Mathew Benson
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2015-12-22 20:09 UTC (permalink / raw)
  To: buildroot

Dear Mathew Benson,

On Tue, 22 Dec 2015 10:07:35 -0600, Mathew Benson wrote:
> How do I mount / from sda1 rather than RAM disk?

Pass root=/dev/sda1 on your kernel command line.

> Sorry for the simple question and let me know if there is a better forum
> for this.  I'm new to buildroot and busybox and haven't compiled a custom
> kernel in at least 15 years.  I'm using the latest version of buildroot as
> of this weekend, used the predefined i386 config, and built with kernel
> version 3.8.17.  It seems to boot just fine but it appears the file system
> is mounted from the initial RAM disk.  Any change I make to the file system
> is volatile.  What do I need to do to make it mount / from sda1 instead of
> the RAM disk?

We don't have anything like a "predefined i386 config".

However, you can see how to use a root filesystem from storage by
looking/building our Qemu x86-64 configuration:

	make qemu_x86_64_defconfig
	make

And then read board/qemu/x86_64/readme.txt for the details on how to
start this configuration under Qemu. You can see in this readme file
that we're booting the kernel with root=/dev/sda, since the first hard
drive is emulated using the contents of output/images/rootfs.ext2.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Newbie boot and fs mount question
  2015-12-22 20:09 ` Thomas Petazzoni
@ 2015-12-24  1:04   ` Mathew Benson
  2015-12-24  7:30     ` Thomas Petazzoni
  0 siblings, 1 reply; 5+ messages in thread
From: Mathew Benson @ 2015-12-24  1:04 UTC (permalink / raw)
  To: buildroot

I have root=/dev/sda1 on my kernel command line.

Yes, I ran make qemu_x86_64_defconfig followed by make.  I'm eventually going to load this build on a small PC, but for now, temporarily, I'm using virtual box.  I added a shared drive to both my development VM and my simulated PC VM.  I setup the first partition as bootable with grub.  I also enabled the creation of a rootfs.tar file.  After I run make, I mount the shared drive, and untar the rootfs.tar over the mounted drive, and copy the bzImage over.  The file system is still read only.

I have a possible dumb question.  I enabled initrd to be linked into the kernel, thinking boot time might be faster.  I enabled the "remount filesystem" option, thinking that would remount it from the hard drive rather than the linked in rootfs.  Is that an incorrect assumption?

Sent from my iPad

> On Dec 22, 2015, at 2:09 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> 
> Dear Mathew Benson,
> 
>> On Tue, 22 Dec 2015 10:07:35 -0600, Mathew Benson wrote:
>> How do I mount / from sda1 rather than RAM disk?
> 
> Pass root=/dev/sda1 on your kernel command line.
> 
>> Sorry for the simple question and let me know if there is a better forum
>> for this.  I'm new to buildroot and busybox and haven't compiled a custom
>> kernel in at least 15 years.  I'm using the latest version of buildroot as
>> of this weekend, used the predefined i386 config, and built with kernel
>> version 3.8.17.  It seems to boot just fine but it appears the file system
>> is mounted from the initial RAM disk.  Any change I make to the file system
>> is volatile.  What do I need to do to make it mount / from sda1 instead of
>> the RAM disk?
> 
> We don't have anything like a "predefined i386 config".
> 
> However, you can see how to use a root filesystem from storage by
> looking/building our Qemu x86-64 configuration:
> 
>    make qemu_x86_64_defconfig
>    make
> 
> And then read board/qemu/x86_64/readme.txt for the details on how to
> start this configuration under Qemu. You can see in this readme file
> that we're booting the kernel with root=/dev/sda, since the first hard
> drive is emulated using the contents of output/images/rootfs.ext2.
> 
> Best regards,
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Newbie boot and fs mount question
  2015-12-24  1:04   ` Mathew Benson
@ 2015-12-24  7:30     ` Thomas Petazzoni
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2015-12-24  7:30 UTC (permalink / raw)
  To: buildroot

Dear Mathew Benson,

On Wed, 23 Dec 2015 19:04:05 -0600, Mathew Benson wrote:

> I have a possible dumb question.  I enabled initrd to be linked into
> the kernel, thinking boot time might be faster.  I enabled the
> "remount filesystem" option, thinking that would remount it from the
> hard drive rather than the linked in rootfs.  Is that an incorrect
> assumption?

Yes, it is an incorrect assumption. In Buildroot, if you enable
"initial RAM filesystem linked into linux kernel", then the entire
root filesystem lives in RAM, and we never switch to another on-storage
filesystem.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] Newbie boot and fs mount question
@ 2015-12-25  0:41 mathew.benson
  0 siblings, 0 replies; 5+ messages in thread
From: mathew.benson @ 2015-12-25  0:41 UTC (permalink / raw)
  To: buildroot

Got it working. ?Thanks.


Sent via the Samsung Galaxy S? 6, an AT&T 4G LTE smartphone-------- Original message --------From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Date: 12/24/2015  1:30 AM  (GMT-06:00) To: Mathew Benson <mathew.benson@gmail.com> Cc: buildroot at busybox.net Subject: Re: [Buildroot] Newbie boot and fs mount question 
Dear Mathew Benson,

On Wed, 23 Dec 2015 19:04:05 -0600, Mathew Benson wrote:

> I have a possible dumb question.? I enabled initrd to be linked into
> the kernel, thinking boot time might be faster.? I enabled the
> "remount filesystem" option, thinking that would remount it from the
> hard drive rather than the linked in rootfs.? Is that an incorrect
> assumption?

Yes, it is an incorrect assumption. In Buildroot, if you enable
"initial RAM filesystem linked into linux kernel", then the entire
root filesystem lives in RAM, and we never switch to another on-storage
filesystem.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151224/62d7089c/attachment.html>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-12-25  0:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-22 16:07 [Buildroot] Newbie boot and fs mount question Mathew Benson
2015-12-22 20:09 ` Thomas Petazzoni
2015-12-24  1:04   ` Mathew Benson
2015-12-24  7:30     ` Thomas Petazzoni
  -- strict thread matches above, loose matches on Subject: below --
2015-12-25  0:41 mathew.benson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox