Article 4YYYX Is there any way around the length limitation in mount options?

Is there any way around the length limitation in mount options?

by
LHLaurini
from LinuxQuestions.org on (#4YYYX)
Greetings.

Say I create a series of directories in the form "elem_###", where ### are the integers from 001 to 454, like so:
Code:$ dirs=$(seq -felem_%03.0f 454 | tr '\n' ' ')
$ mkdir ${dirs}I then use these directories as lowerdir to mount a overlayfs:
Code:$ dirs=${dirs::-1}
$ mkdir mountpoint
# mount overlay -t overlay mountpoint -o lowerdir=${dirs// /:}
# umount mountpointIt works fine. However, if I do:
Code:$ mkdir elem_455
# mount overlay -t overlay mountpoint -o lowerdir=${dirs// /:}:elem_455
mount: /home/username/dir/mountpoint: wrong fs type, bad option, bad superblock on overlay, missing codepage or helper program, or other error.
$ dmesg | tail
(...)
[ 1541.668221] overlayfs: empty lowerdir
(...)It fails.

So here's what's happening: while in the first try the length of the options string is 4094 characters, in the second the length is 4103. Also, judging by the error, the string is truncated at 4095 characters.

Of course,
Code:$ getconf PAGE_SIZE
4096So the options string is apparently limited to the memory page size minus one. Is such limitation imposed by the Linux kernel or is it just the mount program?

Other than stacking mounts, is there any way around that?latest?d=yIl2AUoC8zA latest?i=vVm7OIs6rFs:eIwmg7z-e40:F7zBnMy latest?i=vVm7OIs6rFs:eIwmg7z-e40:V_sGLiP latest?d=qj6IDK7rITs latest?i=vVm7OIs6rFs:eIwmg7z-e40:gIN9vFwvVm7OIs6rFs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments