Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [overlayfs]

For questions concerning the Overlay Filesystem, which was included in Linux kernel 3.18.

0
votes
0answers
20 views

How do I remount / on my live CD to include /mnt/sda1/overlaytest as upperdir?

How do I remount / on my live CD to include /mnt/sda1/overlaytest as upperdir? I tried: { mountpoint /mnt/sda1 && sudo mkdir /mnt/sda1/overlaytest && mount -v -o remount -t ...
1
vote
1answer
56 views

Overlayfs over archivemount

I am trying to apply an overlay using overlayfs over a filesystem mounted with archivemount: mkdir -p {upper,work,mount} tar zcf somefile upper/ work/ mount/ mkdir tmp archivemount -o allow_root -o ...
0
votes
2answers
38 views

Overlayfs inside archivemount

I am trying to mount an overlayfs inside an archivemount (as a follow-up to Layered or Virtual filesystem on Linux). I am doing this: mkdir -p {upper,work,mount} tar zcf somefile upper/ work/ mount/ ...
0
votes
0answers
143 views

What are the consequences of specifying same directory overlay upper/workdir and merged?

I wanted to have a simple RO overlay of my root for use in my container, but for whatever reason it didn't work: $ sudo mount -t overlay overlay -o lowerdir=/ /var/lib/machines/test/ mount: /var/lib/...
1
vote
0answers
150 views

Why overlayfs increases boot time?

Recently, I started using overlay filesystem. I'm using initram script (init=/sbin/myint) as described in Raspberry blog - raspberry overlay, yet, I noticed that it increases boot time significantly (...
0
votes
0answers
171 views

Overlayfs mounted, but get “read-only file system” on any write

I try a simple overlay example by mounting: sudo mount -t overlay -o lowerdir=/tmp/lower,upperdir=/tmp/upper/upper, workdir=/tmp/upper/workdir none /tmp/overlay (I run the full script from example ...
0
votes
0answers
373 views

Modify Ubuntu overlayroot @ boot time

The overlayroot package for Ubuntu is great, it really simplifies using overlayfs to protect the root volume from writes. I am trying to mirror what I've been doing previously and cannot seem to do ...
0
votes
0answers
131 views

Modify existing overlay mount

Is it possible to insert additional lower layers to an existing overlayfs mount? The idea is to add new features to a running "chroot" so that they immediately see these changes in their root fs ...
0
votes
1answer
105 views

(user error) OverlayFS - files deleted in current merged dir (mountpoint) reappear when merged dir remounted as lower

On Debian Stretch (running as root) this the current behaviour: # Create base directory mkdir base touch base/example # Create merge, upper and work directories for 2 layers mkdir layer1 layer1....
1
vote
1answer
1k views

using overlay2 on CentOS 7.4

How do I install and enable the overlay2 storage driver on CentOS 7? I have done many google searches on this and I see that version 7.4 is required. So I typed the following commands to confirm ...
1
vote
1answer
70 views

Apache does not see files under overlay mount

have mounted overlay fs: overlay on /srv/www/site type overlay (rw,relatime,lowerdir=/srv/www/site_orig,upperdir=/srv/www/site_custom,workdir=/srv/www/overlay_workdir) I can see and edit files under ...
1
vote
2answers
1k views

Mount /var/logs as tmpfs, with help of overlayfs to save changes sometimes

Instead of just mounting tmpfs on /var/log I want to use overlayfs. /var/log are writable tmpfs, but containing files were there before tmpfs mount. This old files are not in memory of tmpfs but in ...
4
votes
1answer
1k views

Mount root as overlayfs

I've been trying mount root (/) as overlayfs. OS is booting over NFS to RAM. I've added a premount script in initrd, which creates the 'work', 'upper' and 'lower' directories. During the boot ...
0
votes
1answer
509 views

Can not mount overlayfs inside initrd

I am trying to use read-only overlayfs(no workdir and upperdir) inside custom initrd. This works fine in completely booted OS: mkdir /tmp/ovl1 /tmp/ovl2 /tmp/merged mount -t overlay none -o lowerdir=...
0
votes
1answer
306 views

OverlayFS over read only rootfs fail

I need to keep one system as much intact as possible. Only soldering of HW stuff is allowed :-). I need to install a test software package and this package must not stay there in the future. I have a ...
2
votes
3answers
3k views

Merge changes to upper filesystem to lower filesystem in Linux Overlay (OverlayFS) mount

I would like to be able to merge changes from the upper filesystem of an overlay mount to a lower filesystem. I am interested both online (i.e. merge while the overlay is mounted) and offline (...
1
vote
2answers
99 views

Does overlayfs redirect opened files automatically on the fly?

or I should close file - then mount overlay - and then re-open file again? i.e. #!/bin/bash my_background_process >log.txt & ... pkill my_background_process mount overlay my_background_process ...
8
votes
1answer
4k views

Unionfs vs Aufs vs Overlayfs vs mhddfs, which one do I use

I have randomly been reading about union file system which enables a user to mount multiple filesystems on top of one another simultaneously. However, am finding trouble deciding on which one to use(...
4
votes
2answers
746 views

Why can't /proc be a layer of a overlay file system (overlayfs) on linux?

Run the following commands on linux (4.4.59 and 4.9.8 are tested) and it will fail: mkdir -p /tmp/proc mount -t overlay overlay -o lowerdir=/proc:/tmp/proc /tmp/proc and there is a error message in ...
3
votes
0answers
112 views

Proper way to create “persistent” RAM fs

I'm going to reduce SSD writes, so I'd like to keep changes to some directories (like /var/log or browser cache) in memory and syncing to permanent storage periodically. I should reduce memory size as ...
1
vote
1answer
396 views

Limit the size of tmpfs with overlayroot

Recently I found out that it's possible to use overlayroot with tmpfs to create stateless readonly root. However I couldn't find any info about limiting the size of tmpfs. Is it possible?
1
vote
0answers
259 views

Fedora 25 Live Persistent Overlay Not Working

I have just created a fresh Fedora 25 Xfce 32-bit Live USB using the following command: livecd-iso-to-disk --noverify --reset-mbr --format --msdos \ --overlay-size-mb 1024 --home-size-mb 512 --...
1
vote
1answer
504 views

Why mounting overlayfs with root as lowerdir produce an empty /proc in mergedir?

Here's the test case: #!/bin/bash more="$@" saved="$EUID" if [ "$EUID" = "0" ]; then echo "don't run as root" exit fi m="/tmp/mount-point" exec sudo unshare -m /bin/bash <<UNSHARED ...
1
vote
1answer
447 views

Can overlayFS support more than two layers?

As far as i read documentation the overlayFS supports two layers - upper and lower. But is there possibility to increase it to three layers?
0
votes
1answer
1k views

mounting /var as overlayfs

I'm running a read only filesystem on a raspberry pi so far everything works fine until i tried to mount /var as overlayfs for nginx and other services to work using this: VAROVRL="-o lowerdir=/var,...
6
votes
1answer
1k views

OverlayFS Seamlessly Edit File in Lower Directory

I'm trying to set up a PXEboot environment in which the base system (served over NFS to the PXE clients) is read only, and the root filesystem is an overlayfs filesystem with the read-only NFS base ...
2
votes
0answers
648 views

creating an overlay directly over a mount (systemd-fstab-generator causes error)

I would like to create an overlay over my /var directory. I am using debian/stretch with a recent kernel and install. systemd 232. I am using something along the lines of (all lines with an implied ...
1
vote
1answer
788 views

Why is my overlayfs command not working?

The commands below should be creating a root overlay, such that any modifications to root will appear in /tmp/upper However as you can see it does not appear to be working. Can anyone suggest what I ...
2
votes
1answer
1k views

Docker and OverlayFS

I'm trying to learn about docker and the overlayFS, as suggest by the official website, I installed the last kernel: 4.8.11-1.el7.elrepo.x86_64 and as suggest by them to ensure that overlay is good ...
27
votes
2answers
8k views

Linux Filesystem Overlay - what is workdir used for? (OverlayFS)

OverlayFS has a workdir option, beside two other directories lowerdir and upperdir, which needs to be an empty directory. Unfortunately the kernel documentation of overlayfs does not talk much about ...
6
votes
2answers
8k views

How to use OverlayFS to protect the root filesystem?

How do I correctly use OverlayFS to protect my root filesystem? I have an embedded system that boots and runs from an SD card. Since it will experience sudden power loss, I want to protect the root ...
1
vote
1answer
373 views

linux - OOM / swap not being used

I am getting Out of Memory errors while my swap isn't touched. I have 4GB of ram and 4GB of swap space. I enabled the swap via swapon and when doing free, I see the swap listed there. I'm thinking ...
2
votes
0answers
757 views

Is there anyway to modify one file and sync to the lower directory in OverlayFs?

I know about the overlayfs that it treats lower directory as a read-only and copy_up when we want to modify the lower file so is there any way to modify the lower file and it can copy the modified ...
1
vote
1answer
183 views

Mount unionfs (or aufs) branches fed from stdin?

Is it possible to feed the branch paths from stdin to the mount (or mount_unionfs) command, instead of supplying them as arguments or from a file? cat ~/dirs_with_photos.txt | mount -t unionfs I don'...
5
votes
1answer
905 views

Can I use a read-write root filesystem disk image as an OverlayFS upperdir?

Is it possible to union-mount an existing disk image containing a root filesystem to the upperdir of an overlayfs mount for read-write access? I'm trying to union-mount some old disk images to a /tmp/...
2
votes
1answer
2k views

How can I delete changes from an overlay fs?

I have an embedded device running BusyBox, there are a number of directories mounted with overlayfs with work and data directories mounted on separate UBI partitions using the following style of ...
1
vote
0answers
338 views

How to reflect changes made to original LXC container on overlayFS snapshots?

In order to make updates easier and limit there size, I created a base LXC container, let's say c1, where i installed and configure a few default packages (using apt) which are common to all my ...
4
votes
1answer
435 views

Mounting Overlayfs in a user namespace

Is it possible to mount an Overlayfs filesystem as an unprivileged user in a user namespace in Linux kernels >4.3.3; it seems that the fix to this vulnerability has blocked this functionality entirely....
2
votes
2answers
1k views

what occupy space at overlayfs

I have a linux with a read only root filesystem and a read-write overlayfs mounted over it: # mount overlayfs on / type overlayfs (rw,relatime,lowerdir=/root_ro/,upperdir=/root_rw/) ... The ...
2
votes
1answer
254 views

Mount a large squashfs in a way that allows random writes (to a separate filesystem)?

I just received a few-dozen-gigabyte squashfs that contains a PostgreSQL database. In order to be able to conveniently query it, I need to have a write access, which makes it complicated. Is there a ...
5
votes
1answer
2k views

Merge two NFS shares with OverlayFS

I have two directories (a and b), which are NFS shares with files foo.txt and bar.txt: I want merge this two directories to directory merge (does not have to be writable) this is possible by command:...
5
votes
2answers
10k views

overlayfs: missing 'workdir' on CloneZilla start

I would clone my partition /dev/sda1 on Ubuntu 14.04. I've downloaded Clonezilla in order to clone this partition and be able to reinstall it later. As recommended on the CloneZilla's website, I used ...
3
votes
0answers
132 views

overlay-filesystem that can differentiate between metadata and file content?

AFAIK with aufs when a file is touched (ie. only it's metadata changed, not it's contents), then the copy-on-write mechanism of the file system will copy the whole file into the r/w layer, essentially ...
6
votes
1answer
2k views

How to modify a lower file through an OverlayFS directory?

I want Linux's OverlayFS to behave like AUFS when writing to a lower file. I want it to write through to the lower directory. For example, I have two files named L/lower and U/upper. mount -t ...
4
votes
0answers
293 views

OverlayFS: Is mounting /foo/lower:/foo/upper to /foo safe?

Consider the following union mount: mount -t overlay -o lowerdir=/.pre-foo/lower,upperdir=/.pre-foo/upper,workdir=/.pre-foo/work overlay /foo I would like to obfuscate that /.pre-foo to minimize the ...
3
votes
2answers
4k views

OverlayFS doesn't work with unprivileged user namespace

OverlayFS mount works weird when accessed from within the unprivileged user namespace. Best to be explained in example: ~# uname -a Linux host 4.1.0-1-amd64 #1 SMP Debian 4.1.3-1 (2015-08-03) x86_64 ...
1
vote
0answers
90 views

Light file copy with diff

Is there a way to copy a file by creating another instance of it, that is not created as a hard copy, but by a link with the difference that any edit to that file will be saved in an diff file? I ...
4
votes
0answers
2k views

OverlayFS - How to make changes to upper filesystem persistent without unmounting?

I am using an USB drive to start a linux system which needs changes from time to time and also writes some logs. Flash drives tend to fail early if there are many write operations. That brought me to ...
1
vote
0answers
581 views

Using tar to backup and restore a path mounted with overlayfs

I have a system running OpenWRT with Linux 2.6.39.2. In my filesystem, I have symlinks contained in /etc/rc.d on ROM and more symlinks contained in /overlay/etc/rc.d in flash. overlayfs does a union ...
3
votes
1answer
774 views

overlayfs with a lot of directories

Say I have an arbitrary number of directories, labeled by numbers. I also have the directory merge. I can do mount -t overlay -olowerdir=1:2:50 overlay merge to get the contents of 1, 2, and 50 in ...