I am booting from an ISO for my OSdev and I've implemented the Joliet ISO filesystem.
Since the block device shows up as CD-ROM, the root filesystem also becomes read-only by my design.
I also don't have a separate VFS. I just select the appropriate FS as / and let each FS implementation switch to another FS whenever a mount point is encountered during path traversal.
Now, when I want to mount other filesystems at some mount point say /fs/<GUID>, I'm unable to create the directory /fs.
I was thinking of adding a flag isVirtual to my makeDirectory function which will essentially mean this is a memory-only directory entry and must not be committed to the underlying device. But that seems hackish to me.
I have 2 questions.
1. Is there a better way to create "virtual" directories?
2. How does Live Ubuntu ISO or any other live distro handle this? Assuming the same CD-ROM constraints.
Live ISO, VFS, and mount points
Re: Live ISO, VFS, and mount points
Typically, you'd simply already have these directories present (but empty) on the read-only filesystem, so that they can be used as mount points for writable filesystems later.startrail wrote:Is there a better way to create "virtual" directories?
A Linux live CD will typically use an overlay, putting an in-memory writable filesystem atop read-only data from a squashfs image on the CD.startrail wrote:How does Live Ubuntu ISO or any other live distro handle this? Assuming the same CD-ROM constraints.
Further, a Linux live CD may support an additional overlay system called casper, which allows changes to be written to (and read back from) a persistent storage device like a USB stick.
- AndrewAPrice
- Member
- Posts: 2297
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Live ISO, VFS, and mount points
Make empty placeholder directories on your disk drive if needed. Failing that, go with having an overlay.
I got around it by ditching the Unix hierarchy and not having anything mounted at /. My root directories are all virtual (mount points, shortcuts to installed applications, etc.)
I got around it by ditching the Unix hierarchy and not having anything mounted at /. My root directories are all virtual (mount points, shortcuts to installed applications, etc.)
My OS is Perception.
Re: Live ISO, VFS, and mount points
I get around this by having a root fs mounted at '/' that is it's own filesystem, but a in-memory filesystem. It implements the same interface as a regular filesystem, except it has no backing device.
Then I just mount new filesystems under /storage/<dev>/<part>/.... and see if the the partition has a mount-point preferred by it's GUID and remount it under /... whatever.
Then I just mount new filesystems under /storage/<dev>/<part>/.... and see if the the partition has a mount-point preferred by it's GUID and remount it under /... whatever.