LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-08-2024, 06:00 PM   #1
amenar
LQ Newbie
 
Registered: May 2024
Posts: 1

Rep: Reputation: 0
Question How to mount overlay fs over root (/) with my own set of utilities?


Hi,
I am testing my own utilities with different configurations and I need to place specific file into different directories. I came up with overlay filesystem idea and now I want to mount overlay over root fs of an active server (Debian 12, if it matters). The problem is that I can't find a way to make a correct mount.

My set of utilities come in tar.gz format that mimics the rootfs, so it has /bin, /etc and other directories with required files in them. What I need is just to unpack them into upper (say, /tmp/upper) directory and overlay it over root (/), so what I did is the following:
Code:
mount -t overlay overlay -o lowerdir=/,upperdir=/tmp/upper,workdir=/tmp/wrkdir /
And it gives no error but still it does not work - I can't see my files from /tmp/upper in / (root).

I tried traversal of /tmp/upper with find utility and mount overlay for each directory, but then I got an error: the filesystem is busy. Needless to say that I can't always reboot server when I am done with tests - I need a clean unmount process with no traces left in the system.

What is the most correct approach of mounting side tree over root (/) with overlay? Where am I wrong?

Last edited by amenar; 05-08-2024 at 06:01 PM.
 
Old 05-11-2024, 07:38 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,153

Rep: Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265
Your current directory is the prior un-overlayed directory which is unchanged. Before and after the mount do "cd /"
 
  


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
mount -t overlay overlay? gregors Linux - Software 2 06-08-2023 01:39 AM
Live Image mount: union FS overlay vs dmsetup overlay kostya Linux - Software 2 02-16-2012 06:38 AM
mmap to overlay VME bus into kernel space memory over a PCI? IanVaughan Programming 0 07-31-2009 09:17 AM
ATI drivers will not stretch overlay over entire screen. kslen Slackware 3 12-15-2008 09:27 PM
setting up video streaming over overlay network using ragzy Linux - Software 1 04-27-2004 12:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:54 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