All of lore.kernel.org
 help / color / mirror / Atom feed
* live rootfs from squashfs and read write ability
@ 2014-05-21 12:51 Vasiliy Tolstov
       [not found] ` <CACaajQsj71mL4BciOPaNTx2wN_A2SiBM=babpsUK5QGzQ2Yreg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Vasiliy Tolstov @ 2014-05-21 12:51 UTC (permalink / raw)
  To: initramfs

Hello! I'm very happy with dracut (i'm create live squashfs image and
boot it), but as i see i have my root in read only mode. How can i get
route in read/write mode (in ram).
My cmdline like:
bond=bond0:eth0,eth1:mode=6 net.ifnames=0 ip=bond0:auto6 rd.bootif=0
rd.md=0 rd.dm=0 rd.lvm=0 rd.luks=0 rd.shell
root=live:http://[2001:db8:0:f101:92e2:baff:fe31:44e]/image/mh-vm/image.squashfs
console=tty0 console=ttyS1,115200 rw

-- 
Vasiliy Tolstov,
e-mail: v.tolstov-+9FY0jupvH6HXe+LvDLADg@public.gmane.org
jabber: vase-+9FY0jupvH6HXe+LvDLADg@public.gmane.org

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

* Re: live rootfs from squashfs and read write ability
       [not found] ` <CACaajQsj71mL4BciOPaNTx2wN_A2SiBM=babpsUK5QGzQ2Yreg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-05-22  9:59   ` Dave Young
       [not found]     ` <20140522095925.GG1859-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Young @ 2014-05-22  9:59 UTC (permalink / raw)
  To: Vasiliy Tolstov; +Cc: initramfs

On 05/21/14 at 04:51pm, Vasiliy Tolstov wrote:
> Hello! I'm very happy with dracut (i'm create live squashfs image and
> boot it), but as i see i have my root in read only mode. How can i get
> route in read/write mode (in ram).
> My cmdline like:
> bond=bond0:eth0,eth1:mode=6 net.ifnames=0 ip=bond0:auto6 rd.bootif=0
> rd.md=0 rd.dm=0 rd.lvm=0 rd.luks=0 rd.shell
> root=live:http://[2001:db8:0:f101:92e2:baff:fe31:44e]/image/mh-vm/image.squashfs
> console=tty0 console=ttyS1,115200 rw

I don't think there's easy solution for read-write mount since it need stacked fs like
unionfs. But maybe you can try mount some folder as tmpfs such as /tmp, /var etc.
and only write to the specific folders.

I imagine a simpe implement for unionfs specific for initramfs use.. 

Thanks
Dave

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

* Re: live rootfs from squashfs and read write ability
       [not found]     ` <20140522095925.GG1859-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
@ 2014-05-22 10:00       ` Vasiliy Tolstov
  2014-05-22 21:04       ` Vasiliy Tolstov
  1 sibling, 0 replies; 7+ messages in thread
From: Vasiliy Tolstov @ 2014-05-22 10:00 UTC (permalink / raw)
  To: Dave Young; +Cc: initramfs

2014-05-22 13:59 GMT+04:00 Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
> I don't think there's easy solution for read-write mount since it need stacked fs like
> unionfs. But maybe you can try mount some folder as tmpfs such as /tmp, /var etc.
> and only write to the specific folders.
>
> I imagine a simpe implement for unionfs specific for initramfs use..
>
> Thanks


Now i'm try to implement such thing via overlayfs.  But i'm get base
from livenet and try to run my own stuff, but i have loop in
wait_for_dev -n /dev/root =(


-- 
Vasiliy Tolstov,
e-mail: v.tolstov-+9FY0jupvH6HXe+LvDLADg@public.gmane.org
jabber: vase-+9FY0jupvH6HXe+LvDLADg@public.gmane.org

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

* Re: live rootfs from squashfs and read write ability
       [not found]     ` <20140522095925.GG1859-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
  2014-05-22 10:00       ` Vasiliy Tolstov
@ 2014-05-22 21:04       ` Vasiliy Tolstov
       [not found]         ` <CACaajQvz1e=nYW1C49ExcWAAZHCy9e=tZMMJbtevFAA=37t3gQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Vasiliy Tolstov @ 2014-05-22 21:04 UTC (permalink / raw)
  To: Dave Young; +Cc: initramfs

2014-05-22 13:59 GMT+04:00 Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
>
> I don't think there's easy solution for read-write mount since it need stacked fs like
> unionfs. But maybe you can try mount some folder as tmpfs such as /tmp, /var etc.
> and only write to the specific folders.
>
> I imagine a simpe implement for unionfs specific for initramfs use..
>
> Thanks


I'm try to implement overlayfs mount (backend squashfs, frontend tmpfs).
Can you check https://github.com/haraldh/dracut/pull/20.patch or
https://github.com/haraldh/dracut/pull/20 and give to me some
suggestion, how can i best do this?


-- 
Vasiliy Tolstov,
e-mail: v.tolstov-+9FY0jupvH6HXe+LvDLADg@public.gmane.org
jabber: vase-+9FY0jupvH6HXe+LvDLADg@public.gmane.org

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

* Re: live rootfs from squashfs and read write ability
       [not found]         ` <CACaajQvz1e=nYW1C49ExcWAAZHCy9e=tZMMJbtevFAA=37t3gQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-05-29  6:39           ` Dave Young
       [not found]             ` <20140529063926.GJ2068-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Young @ 2014-05-29  6:39 UTC (permalink / raw)
  To: Vasiliy Tolstov; +Cc: initramfs

On 05/23/14 at 01:04am, Vasiliy Tolstov wrote:
> 2014-05-22 13:59 GMT+04:00 Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
> >
> > I don't think there's easy solution for read-write mount since it need stacked fs like
> > unionfs. But maybe you can try mount some folder as tmpfs such as /tmp, /var etc.
> > and only write to the specific folders.
> >
> > I imagine a simpe implement for unionfs specific for initramfs use..
> >
> > Thanks
> 
> 
> I'm try to implement overlayfs mount (backend squashfs, frontend tmpfs).
> Can you check https://github.com/haraldh/dracut/pull/20.patch or
> https://github.com/haraldh/dracut/pull/20 and give to me some
> suggestion, how can i best do this?

Sorry I'm not familar with livenet I can not comment anything now.
BTW, overlayfs is not in mainline kernel yet.

What I would like to see is something like squashinitramfs, a squashed initrd can be
automatilly recognized and union mounted while kernel booting without any userspace
hacks. But seems nobody is doing like this.

Thanks
Dave

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

* Re: live rootfs from squashfs and read write ability
       [not found]             ` <20140529063926.GJ2068-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
@ 2014-05-29  8:37               ` Vasiliy Tolstov
  2014-06-05 18:28               ` Will Woods
  1 sibling, 0 replies; 7+ messages in thread
From: Vasiliy Tolstov @ 2014-05-29  8:37 UTC (permalink / raw)
  To: Dave Young; +Cc: initramfs

2014-05-29 10:39 GMT+04:00 Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
> Sorry I'm not familar with livenet I can not comment anything now.
> BTW, overlayfs is not in mainline kernel yet.
>
> What I would like to see is something like squashinitramfs, a squashed initrd can be
> automatilly recognized and union mounted while kernel booting without any userspace
> hacks. But seems nobody is doing like this.


Can you please give me the link to union mount without haks? Wikipedia
says that it can be doing with aufs or something like this...


-- 
Vasiliy Tolstov,
e-mail: v.tolstov-+9FY0jupvH6HXe+LvDLADg@public.gmane.org
jabber: vase-+9FY0jupvH6HXe+LvDLADg@public.gmane.org

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

* Re: live rootfs from squashfs and read write ability
       [not found]             ` <20140529063926.GJ2068-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
  2014-05-29  8:37               ` Vasiliy Tolstov
@ 2014-06-05 18:28               ` Will Woods
  1 sibling, 0 replies; 7+ messages in thread
From: Will Woods @ 2014-06-05 18:28 UTC (permalink / raw)
  To: Dave Young; +Cc: Vasiliy Tolstov, initramfs

On Thu, 2014-05-29 at 14:39 +0800, Dave Young wrote:
> On 05/23/14 at 01:04am, Vasiliy Tolstov wrote:
> > 2014-05-22 13:59 GMT+04:00 Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>:
> > >
> > > I don't think there's easy solution for read-write mount since it need stacked fs like
> > > unionfs. But maybe you can try mount some folder as tmpfs such as /tmp, /var etc.
> > > and only write to the specific folders.
> > >
> > > I imagine a simpe implement for unionfs specific for initramfs use..
> > >
> > > Thanks
> > 
> > 
> > I'm try to implement overlayfs mount (backend squashfs, frontend tmpfs).
> > Can you check https://github.com/haraldh/dracut/pull/20.patch or
> > https://github.com/haraldh/dracut/pull/20 and give to me some
> > suggestion, how can i best do this?
> 
> Sorry I'm not familar with livenet I can not comment anything now.
> BTW, overlayfs is not in mainline kernel yet.
> 
> What I would like to see is something like squashinitramfs, a squashed initrd can be
> automatilly recognized and union mounted while kernel booting without any userspace
> hacks. But seems nobody is doing like this.

You can also look at modules.d/90dmsquash-live, which makes a
squashfs-compressed filesystem writeable by using device-mapper to
redirect writes to a different block device (like a loop device backed
by a file on tmpfs).

Note, though, that this requires a filesystem image *inside* squashfs.
The trouble with squashfs is that it's not writeable - it doesn't even
support the "write()" system call. So you can't just tell device-mapper
"send writes over here", because writes aren't allowed.

So instead you put (e.g.) an ext3 filesystem image inside squashfs, and
create an overlay file in tmpfs to use as the write device, and it looks
like this:

squashfs.img -> /rootfs.img -> /dev/loop0 
tmpfs        -> /overlay    -> /dev/loop1
/dev/loop0 + /dev/loop1     -> /dev/mapper/live-rw

See dmsquash-live-root.sh for how it's actually done.

If you just want to try it out, you can do this:

1) make a dracut initramfs that contains the 'dmsquash-live' module
2) make a ext3 image named 'rootfs.img' that contains your real root
3) make a squashfs image that contains '/rootfs.img'
4) put the squashfs image in the initramfs (say at /squashfs.img)
5) boot with 'root=live:/squashfs.img'[1]

It's not super-pretty, but it gets the job done.
(This is how the RHEL/Fedora installer runs, btw.)

Hope that's useful somehow...

-w

[1] You can also do stuff like "root=live:http://.../squashfs.img" or 
    root=live:LABEL=LIVEDEV (if the image is at /LiveOS/rootfs.img)



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

end of thread, other threads:[~2014-06-05 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-21 12:51 live rootfs from squashfs and read write ability Vasiliy Tolstov
     [not found] ` <CACaajQsj71mL4BciOPaNTx2wN_A2SiBM=babpsUK5QGzQ2Yreg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-22  9:59   ` Dave Young
     [not found]     ` <20140522095925.GG1859-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
2014-05-22 10:00       ` Vasiliy Tolstov
2014-05-22 21:04       ` Vasiliy Tolstov
     [not found]         ` <CACaajQvz1e=nYW1C49ExcWAAZHCy9e=tZMMJbtevFAA=37t3gQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-29  6:39           ` Dave Young
     [not found]             ` <20140529063926.GJ2068-4/PLUo9XfK+sDdueE5tM26fLeoKvNuZc@public.gmane.org>
2014-05-29  8:37               ` Vasiliy Tolstov
2014-06-05 18:28               ` Will Woods

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.