LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Bedrock Linux (https://www.linuxquestions.org/questions/bedrock-linux-118/)
-   -   global mounts in a manually-installed bedrock (https://www.linuxquestions.org/questions/bedrock-linux-118/global-mounts-in-a-manually-installed-bedrock-4175628115/)

jr_bob_dobbs 04-21-2018 07:41 AM

global mounts in a manually-installed bedrock
 
So I've got a bedrock system set up and working. Manual install, so global is its own strata, as is rootfs. The Bedrock boots, gets net, runs x-windows (including keyboard & mouse input functionality), browses the web and plays audio. So far so good. I've not tested video playback yet but with everything else working the way it is, I can't see why that would not.

At the moment, the only partitions mounted by the fstab are the "/" partition and the swap partition.

I have a partition that is Fat32, for use in sharing files with windows. I also have a partition used for the permanent /home directory and a miscellaneous files partition.

Now, I can put entries for the above in the global fstab file, that much I understand. There is no need to mount these partitions early, before one picks the init and strata to finish booting from.

However...

My understanding of the Bedrock documentation is that since global is not rootfs, /home should be mounted to /bedrock/strata/global/home, not to /home. in the fstab. The default framework settings will then ensure it is accessible in the other strata. The idea is that it will appear as /home once booted into bedrock?

A question: is that correct?

A second question, does a "share = /home" need to be added to the default framework section of the /bedrock/etc/strata.conf file? Or no? Or would it instead be "share = /bedrock/strata/global/home"?

A third question: to mount the actual windows ntfs partition requires me specifying ntfs-3g (fuse) like so:

/dev/sda1 /win7 ntfs-3g fmask=111,dmask=000 1 0

My understanding is that the global fstab is interpreted by the busybox mount command, not the chosen strata's mount. If this is so, will the use of ntfs-3d (fuse) be parsed OK?

Thank you.

ParadigmComplex 04-21-2018 01:27 PM

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
So I've got a bedrock system set up and working. Manual install, so global is its own strata, as is rootfs. The Bedrock boots, gets net, runs x-windows (including keyboard & mouse input functionality), browses the web and plays audio. So far so good. I've not tested video playback yet but with everything else working the way it is, I can't see why that would not.

Excellent, good start.

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
At the moment, the only partitions mounted by the fstab are the "/" partition and the swap partition.

I have a partition that is Fat32, for use in sharing files with windows. I also have a partition used for the permanent /home directory and a miscellaneous files partition.

That all makes sense.

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
Now, I can put entries for the above in the global fstab file, that much I understand. There is no need to mount these partitions early, before one picks the init and strata to finish booting from.

I'm not sure what exactly you mean by global fstab. There are two fstabs:
  • The typical fstab at /etc/fstab
  • The Bedrock specific one at /bedrock/etc/fstab

Both are global. That is, all processes see the same thing when they look at either of those paths. If one process messes with one of those files, all the other processes will see the result.

/etc/fstab is intended to be your normal /etc/fstab, nothing special there.

/bedrock/etc/fstab is intended for the weird situation where you need to mount the stratum that provides init. Most distros don't have this because they require the init system to be on the root filesystem, but Bedrock's flexibility tries to offer the choice to have it on another filesystem.

Per the documentation I wrote, either should work. The convention would be to use `/etc/fstab` since `/home` doesn't need to be mounted before the init, as you mentioned. However, there seems to be an issue between the way Bedrock handles these things and some versions of `mount` that I'm working on narrowing down. Essentially, Bedrock mounts something to `/home` before `/etc/fstab` is read with the expectation that mount will read `/etc/fstab` and mount over the preexisting mount. However, some `mount` versions see the existing mount and just silently skip the `/etc/fstab` entry. As a work around, you could either:
  • Put a `mount` line in `/etc/rc.local` (or whatever your init's equivalent is). Something like `mount /dev/sda2 /home`. That should then mount *over* the existing mount as originally intended
  • Put a fstab line in `/bedrock/etc/fstab`. This will be mounted before Bedrock does its own mounts and avoids the confusion. As you mentioned, it shouldn't normally be necessary to do this.

I plan to rework the relevant bit of documentation soon (hopefully tomorrow) now that I understand what the actual issue is. I also have thoughts on how to remedy it for the upcoming release.

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
However...

My understanding of the Bedrock documentation is that since global is not rootfs, /home should be mounted to /bedrock/strata/global/home, not to /home. in the fstab. The default framework settings will then ensure it is accessible in the other strata. The idea is that it will appear as /home once booted into bedrock?

When Bedrock is actively running, assuming nothing is wrong, global paths should be the same for all strata. Every process will see the same thing at /home. When the system is powered off, the bits are only going to be in one place, though, which with your described setup is /bedrock/strata/global/home. Generally, you want to interact with global files without the `/bedrock/strata/<strata-which-provides-global>` prefix. If you want to edit your vimrc on a Bedrock system, the convention would be to edit `/home/<username>/.vimrc` rather than worry about `/home/strata/global/home/<username>/.vimrc`. This pattern includes mounting - if you mount something into `/home/<username>/dvddrive` all processes will see the mounted files at `/home/<username>/dvddrive`. You *can* use `/bedrock/strata/global` for these things as well, but only situationally; the `/bedrock/strata/` path isn't infinitely recursive and will give you something different in some situations for global paths. It's only guaranteed to be useful for local ones.

Mount points mounted by `/bedrock/etc/fstab` is a bit weird, though, as they are mounted before Bedrock sets up all the global share stuff. I'm actually not sure whether a line in `/bedrock/etc/fstab` would prefer `/home` or `/bedrock/strata/global/home`, or if it even makes a difference. You may need to guess and check, and just try the other one if the first doesn't work. Or use `/etc/rc.local` as I mentioned above, which would then work with either but `/home` would be the convention.

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
A second question, does a "share = /home" need to be added to the default framework section of the /bedrock/etc/strata.conf file? Or no?

It's already there. If it wasn't, though, yeah - you'd add a new `share` entry.

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
Or would it instead be "share = /bedrock/strata/global/home"?

It'd be `share = /home`. The value there is a path that should look the same from the point of view of all processes, which is what you care about. The fact the actual bits on disk happen to be in `/bedrock/strata/global/home` when the power is off isn't of much consequence most of the time. You've already configured which stratum provides global elsewhere - Bedrock looks that up when it sets up `share =` items.

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
A third question: to mount the actual windows ntfs partition requires me specifying ntfs-3g (fuse) like so:

/dev/sda1 /win7 ntfs-3g fmask=111,dmask=000 1 0

My understanding is that the global fstab is interpreted by the busybox mount command, not the chosen strata's mount. If this is so, will the use of ntfs-3d (fuse) be parsed OK?

Again, I'm not sure which fstab you mean by "global fstab". /bedrock/etc/fstab is interpreted by busybox and may not understand ntfs-3g. I'm not sure how ntfs-3g is implemented.

/etc/fstab is interpreted by the stratum you select to provide init and should support ntfs-3g fine if the corresponding distro would normally support it.

Bedrock doesn't do anything to make `/win7` global. Only the stratum that mounts it will be able to access files in there by default. You could edit the default framework to add a `share=` field for it, although then you have the headache I described above with `/home`. Another option would be to put it in `/mnt`, e.g. `/mnt/win7`, if that's not a problem for you workflow/muscle-memory. `/mnt` is global by default and it's not mounting directly on top of another mount point so the mount/fstab confusion won't happen (as its mounting in a subdirectory instead).

Quote:

Originally Posted by jr_bob_dobbs (Post 5845864)
Thank you.

Happy to help :)

Nyla's handle of this whole area is, IMO, overly complicated and easily confused. Let me know if that didn't make sense and I can try to rephrase. I'm planning on completely reworking this for the upcoming release to be much simpler, plus provide more examples in the documentation.

jr_bob_dobbs 04-23-2018 05:48 PM

Thank you for the reply.

Quote:

Originally Posted by ParadigmComplex (Post 5845967)
I'm not sure what exactly you mean by global fstab. There are two fstabs:
  • The typical fstab at /etc/fstab
  • The Bedrock specific one at /bedrock/etc/fstab

I put my fstab in the global strata, specifically in /bedrock/strata/global/etc/ so I've been calling it the global fstab. Following the documentation, I also used touch to make an empty fstab in /etc

Was that bad? :o

D'oh! I've gone through the documentation over & over but did not read through the entirety of each configuration file.

Quote:

It'd be `share = /home`. The value there is a path that should look the same from the point of view of all processes, which is what you care about. The fact the actual bits on disk happen to be in `/bedrock/strata/global/home` when the power is off isn't of much consequence most of the time. You've already configured which stratum provides global elsewhere - Bedrock looks that up when it sets up `share =` items.
This removes some of the fog from my brain. Thank you. :)

ParadigmComplex 04-23-2018 06:13 PM

Quote:

Originally Posted by jr_bob_dobbs (Post 5846776)
Thank you for the reply.

No problem!

Quote:

Originally Posted by jr_bob_dobbs (Post 5846776)
I put my fstab in the global strata, specifically in /bedrock/strata/global/etc/ so I've been calling it the global fstab. Following the documentation, I also used touch to make an empty fstab in /etc

Ahhh, okay. I see now - from that point of view, sure, there's multiple `/etc/fstab`, paths, one for each stratum. When Bedrock is running, the global one takes priority and hides the others. But when you're installing and Bedrock's hooks aren't in place, you specifically mean the global stratum's /etc/fstab, or just global fstab for short. That's perfectly reasonable. I'm just used to looking at things from the point of view where everything is enabled, in which case Bedrock ensures `/etc/fstab` is the global stratum's, in which case it isn't clear what adding "global" to it is supposed to signify.

Quote:

Originally Posted by jr_bob_dobbs (Post 5846776)
Was that bad? :o

Per the documentation, that's what you should do. That should have been good on your part. However, due to the Bedrock issue I mentioned in my last post, `/bedrock/etc/fstab` might be better. I don't remember if that's rootfs' when offline, but I could be wrong and it's global's when offline; you might have to guess and check if you can't set it when the system is online.

Quote:

Originally Posted by jr_bob_dobbs (Post 5846776)
This removes some of the fog from my brain. Thank you.

No worries, it's a bit confusing. There's plenty of room for me to both simplify and better express the concepts here.


All times are GMT -5. The time now is 11:51 AM.