All of lore.kernel.org
 help / color / mirror / Atom feed
* mount bind /var/lib and package management
@ 2016-05-25 15:07 Martin Townsend
  2016-05-25 15:55 ` Fred Ollinger
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Townsend @ 2016-05-25 15:07 UTC (permalink / raw)
  To: yocto

Hi,

When using a read only rootfs it mount --binds /var/lib into
/var/volatile/lib which lives in tmpfs and makes sense.  The problem
is that I use dpkg but I'm assuming other package management tools use
/var/lib as their admin dir.

Wouldn't this break package updates as the dpkg database files etc
will then be updated in tmpfs so a power cycle would means the changes
are lost? Or am I missing something?

I tried to mount bind all directories except dpkg which I managed to
get working but other systemd services failed as they expected
/var/lib to be writeable (the service that creates /var/lib/machines).
I suppose I could alter this to remount / rw first but gave up at this
point.

The next thing I tried was to use a new admindir for dpkg, ie
/lib/dpkg which I have working but I had to hack a lot of files
changing /var/lib to /lib including files for apt-get native.  I'm not
confident that I've got them all.

Is there another solution I haven't thought of?

Thanks in advance,
Martin.


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

* Re: mount bind /var/lib and package management
  2016-05-25 15:07 mount bind /var/lib and package management Martin Townsend
@ 2016-05-25 15:55 ` Fred Ollinger
  0 siblings, 0 replies; 2+ messages in thread
From: Fred Ollinger @ 2016-05-25 15:55 UTC (permalink / raw)
  To: Martin Townsend, yocto@yoctoproject.org

Bind mount can allow mount to be two places:

From the mount manpage:

"       The bind mounts.
              Since Linux 2.4.0 it is possible to remount part of the file hierarchy somewhere else.  The call is:

                     mount --bind olddir newdir"

If you do this, then you have your files on tmpfs.

Frederick
________________________________________
From: yocto-bounces@yoctoproject.org <yocto-bounces@yoctoproject.org> on behalf of Martin Townsend <mtownsend1973@gmail.com>
Sent: Wednesday, May 25, 2016 8:07 AM
To: yocto@yoctoproject.org
Subject: [yocto] mount bind /var/lib and package management

Hi,

When using a read only rootfs it mount --binds /var/lib into
/var/volatile/lib which lives in tmpfs and makes sense.  The problem
is that I use dpkg but I'm assuming other package management tools use
/var/lib as their admin dir.

Wouldn't this break package updates as the dpkg database files etc
will then be updated in tmpfs so a power cycle would means the changes
are lost? Or am I missing something?

I tried to mount bind all directories except dpkg which I managed to
get working but other systemd services failed as they expected
/var/lib to be writeable (the service that creates /var/lib/machines).
I suppose I could alter this to remount / rw first but gave up at this
point.

The next thing I tried was to use a new admindir for dpkg, ie
/lib/dpkg which I have working but I had to hack a lot of files
changing /var/lib to /lib including files for apt-get native.  I'm not
confident that I've got them all.

Is there another solution I haven't thought of?

Thanks in advance,
Martin.
--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


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

end of thread, other threads:[~2016-05-25 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-25 15:07 mount bind /var/lib and package management Martin Townsend
2016-05-25 15:55 ` Fred Ollinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.