D
D
Dmitry Gavrilenko2019-04-10 19:12:44
linux
Dmitry Gavrilenko, 2019-04-10 19:12:44

Ubuntu. How to create a fake USB from a folder?

Hello!
The task is interesting, but I have not yet been able to find a solution.
In general, I run a docker container from an ubuntu image. In a running container, do the following:

  1. create folder X
  2. put what files in folder X
  3. create img/iso image of X folder
  4. Mount img/iso image under the guise of a removable USB drive

Those. eventually some folder should act as the inserted USB. You can even readonly
Here is the last point of the problem.
PS: in fact, physically, no USB media will be inserted. You just need to get this effect.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2019-04-11
@pfg21

the file system from the image file is mounted via the loop device.
google "mount -o loop" the topic is long-standing painted in a bunch of places.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question