LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-20-2016, 12:38 PM   #1
dvadell
LQ Newbie
 
Registered: Aug 2010
Posts: 6

Rep: Reputation: 0
Can't mount / as an overlayfs (maybe rightfully)


Hi everybody,
I was toying with overlayfs and mount namespaces. I was trying to mount one filesystem with it's /usr, /var, etc over the rootfs. The idea is to have several applications or versions of the same application as filesystems, and mount one or another. Let's say a kind of package manager. Nothing new, I think.
So I created a tmpfs with three dirs (upper, work, lower), a new mount namespace, and mounted them over the rootfs:
Quote:
# New mountspace
unshare -m

# Work in a differente fs.
mkdir /tmp/testfs
mount -t tmpfs tmpfs /tmp/testfs
cd /tmp/testfs

# /tmp/testfs/{lower|upper|work}
export LOWER=lower
export UPPER=upper
export WORK=work
mkdir $LOWER $UPPER $WORK
mount -t overlay -olowerdir=$LOWER,upperdir=$UPPER,workdir=$WORK overlayfs /
This should make a mess, because the rootfs would be empty. But it doesn't. ls -l / shows the whole filesystem. And if I create a new file in / (inside that namespace), it appears also outside that namespace.

What am I doing wrong? Maybe it's just not possible, but I would love to know why.

TIA,

Last edited by dvadell; 05-20-2016 at 12:48 PM. Reason: bbcode
 
Old 05-21-2016, 08:57 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Here's Kernel docs on overlayfs https://www.kernel.org/doc/Documenta.../overlayfs.txt

I didn't read anything that specifically mentioned you couldn't overlay on rootfs.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Selective OverlayFS/UnionFS? onlyonemac Linux - Desktop 14 11-28-2015 10:12 AM
[SOLVED] Mount samba share on Slackware: mount error(6) from mount.cifs frushiyama Slackware 11 01-22-2015 07:12 PM
LXer: OverlayFS File-System Proposed For Linux 3.10 Kernel LXer Syndicated Linux News 0 03-14-2013 12:20 AM
manual mount cifs works but srcipt mount cifs has mount error (13): Permission denied CADIT Linux - Newbie 6 11-20-2009 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration