LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bedrock Linux
User Name
Password
Bedrock Linux This forum is for the discussion of Bedrock Linux.

Notices


Reply
  Search this Thread
Old 04-21-2018, 08:41 AM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Linux From Scratch, Bedrock
Posts: 315
Blog Entries: 46

Rep: Reputation: 12
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.
 
Old 04-21-2018, 02:27 PM   #2
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 60

Rep: Reputation: Disabled
Quote:
Originally Posted by jr_bob_dobbs View Post
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 View Post
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 View Post
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 View Post
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 View Post
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 View Post
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 View Post
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 View Post
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.
 
Old 04-23-2018, 06:48 PM   #3
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Linux From Scratch, Bedrock
Posts: 315

Original Poster
Blog Entries: 46

Rep: Reputation: 12
Thank you for the reply.

Quote:
Originally Posted by ParadigmComplex View Post
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?

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.

Last edited by jr_bob_dobbs; 04-23-2018 at 06:50 PM.
 
Old 04-23-2018, 07:13 PM   #4
ParadigmComplex
Bedrock Linux Founder
 
Registered: Feb 2016
Distribution: Bedrock Linux
Posts: 60

Rep: Reputation: Disabled
Quote:
Originally Posted by jr_bob_dobbs View Post
Thank you for the reply.
No problem!

Quote:
Originally Posted by jr_bob_dobbs View Post
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 View Post
Was that bad?
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 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] bedrock not using brsh.conf, dropped to bedrock's /bin/sh Siljrath Linux - Distributions 2 08-25-2014 06:47 AM
[SOLVED] uninstalling software installed manually rkrara Linux - Newbie 4 12-08-2012 12:24 PM
Removal of a Manually Installed Application metallica1973 Linux - Software 3 11-11-2008 04:26 PM
installed testing - dev mounts odd jmeads Debian 2 01-02-2005 08:19 AM
How to run Global Call software installed on linux? a2715mt Linux - Networking 3 06-22-2004 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Bedrock Linux

All times are GMT -5. The time now is 02:55 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration