buildroot - remount rootfs read only problem

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

is it possible to mount the rootfs read-only with a system that is created with buildroot?

This was at least possible with a former system based on BSP 2.0.

I'm trying this (immediatelly after bootup is finished):
mount -r -o remount /

The result is:
mount: Mounting /dev/root on / failed: Device or resource busy

Is it possible, in general, to boot the rootfs read-only with a buildroot system?

Regards,
Gerhard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you specify 'ro' instead of 'rw' in the bootargs of U-boot you'll get a readonly root.

Markus

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

markus_b wrote:
If you specify 'ro' instead of 'rw' in the bootargs of U-boot you'll get a readonly root.

Markus

ah, I see. Thanks for your reply.

My intention is to have a read-only rootfs after boot-up.
For doing software updates I need to remount the filesystem rw and after the updates remount it ro again.

As mentioned, performing a ro remount was possible with a BSP2.0 based system.
May be the problem lies in using a tmpfs for /dev in the buildroot configuration.

Does anybody have an idea?

Regards,
Gerhard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

suzyq wrote:

For doing software updates I need to remount the filesystem rw and after the updates remount it ro again.
As mentioned, performing a ro remount was possible with a BSP2.0 based system.

I'm having the same problem.
The init scripts of the two versions are different, but are doing more or less the same. Only the tmpfs for /dev is unique to the buildroot version.

I'm quite new to embedded Linux, may be one of the experts can give further help ....

v.m.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

markus_b wrote:
If you specify 'ro' instead of 'rw' in the bootargs of U-boot you'll get a readonly root.

Markus

Unfortunatelly this is not working with the buildroot system.
The boot sequence stops after a
"Warning: unable to open initial console" if the ro option is given.

hce, is there a solution to get a readonly rootfs?

Gerhard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had the opposite problem, a ro root, instead of rw, and found it to be that parameter. However, this was with the 'stock' buildroot system from Atmel. My NGW did boot completely, despite the 'ro' root filesystem. After login I could 'remount -oremount,rw /' and got a writeable root.

Markus

Markus

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

... solved. The problem was that I was using an older busybox version.
Markus, thanks for your inspiration!

Gerhard