Re: overlayfs v22 on kernel 3.15.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 23, 2014 at 2:15 PM, Klaus Kreil <klaus.kreil@xxxxxxxxxxxx> wrote:
> On Mi, 23.07.2014, 14:02, Miklos Szeredi wrote:
>> On Wed, Jul 23, 2014 at 1:57 PM, Klaus Kreil <klaus.kreil@xxxxxxxxxxxx>
>> wrote:
>>
>>>> You need to give absolute paths:
>>>>
>>>> mount -t overlayfs overlayfs -o
>>>> lowerdir=/mnt/root_ro,upperdir=/mnt/root_rw/upper,workdir=/mnt/root_rw/work
>>>> /mnt/root
>>>>
>>> Thanks Miklos,
>>> I had tried that before, but that did not/does not work as well. The new
>>> command (adjusted to my environment and from within the rescue-shell and
>>> all within a single line) was:
>>> # mount -t overlayfs overlayfs -o
>>> lowerdir=/mnt/root_ro,upperdir=/mnt/root_rw,workdir=/mnt/root_rw/.work
>>> /mnt/root
>>>
>>> The new error message from dmesg now reads:
>>> [ 1369.069178] overlayfs: workdir and upperdir must be separate subtrees
>>
>> Exactly. Observe that I used upperdir=/mnt/root_rw/upper.
> I see what you mean and I have to admit, that slipped my eye.
>
> This however triggers an additional question: Would this now require me to
> create an new "virtual" root directory (in your case named "upper") on my
> upperdir filesystem and move everything that was in the real root of the
> existing upperdir filesystem to the new virtual root directory?

Yes.  And in adition you need to run the following script (upperdir
given as a single argument) to convert whiteouts from the old format
to the new:

--- overlayfs-fixup.sh ---
#! /bin/bash

upper=$1
tmpdir=`mktemp -d`
tmp=$tmpdir/wh
find "$upper" -type l -print0 | while IFS= read -r -d $'\0' name; do
        iswh=`getfattr -h -ntrusted.overlay.whiteout --only-values
"$name" 2> /dev/null`
        if test "$iswh" = y; then
                echo "changing whiteout <$name> from symlink to chardev"
                mknod -m0 $tmp c 0 0
                mv -f $tmp "$name"
        fi
done
rmdir $tmpdir
--- cut here ---

> In other words now - and contrary to the old behaviour - overlaying one
> root directory of a filesystem onto another root directory of another
> filesystem is no longer possible.

Not at this time.

> If that's the case, I guess lost+found should nevertheless stay in the
> real root directory of the upperdir?

Yes.

>
> Furthermore that would als mean that the workdir is never visible from
> within the combined tree and therefore I could go away with the .work and
> rename the workdir to work.

Yes.

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux