How can I access the original files (the lowerdir) of an overlay mounted on the same location as the lowerdir?

Anonymous

The situation that I've found myself in is that I'm having to run Fedora Linux from a semi-read-only location. I can make edits to the file system, placing files and such, but all is lost on reboot, and as an added hassle, I cannot easily increase the available storage space either. I do have access to some writable media though, so I thought I'd do this:

sudo mount --bind /usr /home/username/Store/Orig/usr
sudo mount -t overlay ovl_usr -o lowerdir=/usr,upperdir=/home/username/Store/usr,workdir=/home/username/Store/Work/usr /usr

The second line works okay, it's the first line that isn't working. What it's meant to do is give me non-overlaid access to the original contents of /usr. I'd expect that since the bind mount is created before the overlay is mounted on /usr, /home/username/Store/Orig/usr would still see the old contents. But no, /home/username/Store/Orig/usr shows the overlaid files, just like /usr.

Is there a way to access the original contents of /usr?

Kamil Maciorowski

I think you're experiencing a "shared" behavior, while you need "private". See man 8 mount:

The shared subtrees operations.
Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared, private, slave or unbindable. A shared mount provides ability to create mirrors of that mount such that mounts and umounts within any of the mirrors propagate to the other mirror. […] A private mount carries no propagation abilities. […]

Solution: after mount --bind … and before mount -t overlay … invoke:

sudo mount --make-private /home/username/Store/Orig/usr

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How can I store files in the mounted shared folder?

分類Dev

How can I run original command that aliased with same name?

分類Dev

I mounted an ISO, but it mounts with 000 permissions, and as a result, I can only access it as root. How can I make it accessible to a normal user?

分類Dev

dockerimage-GraphDriverのmerged / diff / work / LowerDirコンポーネント

分類Dev

how can I make a custom overlay filter?

分類Dev

How can I access the same text area variable?

分類Dev

How can i move multiple files to folder with same name

分類Dev

How can I access files (images) in an azureml FileDataSet?

分類Dev

How can I get access to the original records when joining Kafka Streams

分類Dev

How can I send event for all mounted tags?

分類Dev

How can a script add a little icon overlay on files' icons

分類Dev

How can I overlay a SKScene over a SCNScene in Swift?

分類Dev

How can I avoid a black background when fading in an overlay with ffmpeg?

分類Dev

How can I give an image a black opaque overlay?

分類Dev

How can I overlay a transparent video over an MP4?

分類Dev

How do I access an external drive mounted on a machine on my own network?

分類Dev

How to access drives that are mounted by other users?

分類Dev

How can i get access to the same instance of the class without creating one more bean id

分類Dev

How can I access a class data member from a method within the same class?

分類Dev

How can I access one desktop session from another on the same machine?

分類Dev

How Can I list files in the same order that flyway executes them in bash?

分類Dev

How Can I list files in the same order that flyway executes them in bash?

分類Dev

how can I create two files with same name with different case in mac osx

分類Dev

How can I upload files to Cloud Storage through Cloud Functions and use Firestore to control access to Cloud Storage?

分類Dev

How can I create a user with read-only access to all files? (ie root without writing permissions)

分類Dev

How i can find identical files using a hash and then display the path to them and their access rights?

分類Dev

How do I access files in a Shared Library?

分類Dev

lowerdirと同じ場所にマウントされたオーバーレイの元のファイル(lowerdir)にアクセスするにはどうすればよいですか?

分類Dev

How can I decode an object when original class is not available?

Related 関連記事

  1. 1

    How can I store files in the mounted shared folder?

  2. 2

    How can I run original command that aliased with same name?

  3. 3

    I mounted an ISO, but it mounts with 000 permissions, and as a result, I can only access it as root. How can I make it accessible to a normal user?

  4. 4

    dockerimage-GraphDriverのmerged / diff / work / LowerDirコンポーネント

  5. 5

    how can I make a custom overlay filter?

  6. 6

    How can I access the same text area variable?

  7. 7

    How can i move multiple files to folder with same name

  8. 8

    How can I access files (images) in an azureml FileDataSet?

  9. 9

    How can I get access to the original records when joining Kafka Streams

  10. 10

    How can I send event for all mounted tags?

  11. 11

    How can a script add a little icon overlay on files' icons

  12. 12

    How can I overlay a SKScene over a SCNScene in Swift?

  13. 13

    How can I avoid a black background when fading in an overlay with ffmpeg?

  14. 14

    How can I give an image a black opaque overlay?

  15. 15

    How can I overlay a transparent video over an MP4?

  16. 16

    How do I access an external drive mounted on a machine on my own network?

  17. 17

    How to access drives that are mounted by other users?

  18. 18

    How can i get access to the same instance of the class without creating one more bean id

  19. 19

    How can I access a class data member from a method within the same class?

  20. 20

    How can I access one desktop session from another on the same machine?

  21. 21

    How Can I list files in the same order that flyway executes them in bash?

  22. 22

    How Can I list files in the same order that flyway executes them in bash?

  23. 23

    how can I create two files with same name with different case in mac osx

  24. 24

    How can I upload files to Cloud Storage through Cloud Functions and use Firestore to control access to Cloud Storage?

  25. 25

    How can I create a user with read-only access to all files? (ie root without writing permissions)

  26. 26

    How i can find identical files using a hash and then display the path to them and their access rights?

  27. 27

    How do I access files in a Shared Library?

  28. 28

    lowerdirと同じ場所にマウントされたオーバーレイの元のファイル(lowerdir)にアクセスするにはどうすればよいですか?

  29. 29

    How can I decode an object when original class is not available?

ホットタグ

アーカイブ