• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

fstab getting overwritten?

Scheduled Pinned Locked Moved Unsolved Support
14 Posts 5 Posters 1.6k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      AppLee @crackulator
      last edited by 9 Oct 2021, 17:04

      @crackulator
      I thought there were apps in the open store to access SMB servers. But I couldn't find any.
      I think you can create an app in order to mount the SMB folder, but I'm not sure if everything needed is in the OS.

      I don't have my Nexus5 anymore and I'll have to wait a bit to get another UT device 😞
      Sorry I cannot help more.

      C 1 Reply Last reply 29 Oct 2021, 22:06 Reply Quote 0
      • C Offline
        crackulator @AppLee
        last edited by 29 Oct 2021, 22:06

        Anybody know why my fstab is getting overwritten, or how I can accomplish this task?

        Note: I don't have any trouble accessing SMB shares, I'm just trying to map some shares into my home directory for easy access. In fact, the workaround is just to copy up a new fstab and then mount the shares, works perfectly. It just seems like a rather grubby workaround. On most Linux installs, one just edits fstab to map the shares, and then it's done for good.

        N 1 Reply Last reply 29 Oct 2021, 22:38 Reply Quote 1
        • N Offline
          nogoogle @crackulator
          last edited by 29 Oct 2021, 22:38

          @crackulator if you only want to access shares from filemanager then this solution may work

          https://forums.ubports.com/post/31279

          I believe fstab is overwritten because /etc is on the system partition which is overwritten with every OTA because of image based updates.

          A 1 Reply Last reply 30 Oct 2021, 12:02 Reply Quote 0
          • A Offline
            AppLee @nogoogle
            last edited by 30 Oct 2021, 12:02

            @nogoogle said in fstab getting overwritten?:

            I believe fstab is overwritten because /etc is on the system partition which is overwritten with every OTA because of image based updates.

            Yes that is correct.
            That's why modifying the rootfs is deprecated by UBports.

            How do you mount your SMB partition, there might be a way. I don't modify my fstab on my desktop to mount a partition wherever I want...

            C 1 Reply Last reply 1 Nov 2021, 18:41 Reply Quote 0
            • C Offline
              crackulator @AppLee
              last edited by 1 Nov 2021, 18:41

              @applee It's not just overwriting it during an update, it's overwriting it every boot. So maybe there is an upstream source of it that I could edit instead.

              On a desktop system, it would make no sense to overwrite fstab during an update or reboot; it maps the UUIDs of all your drives and partitions to locations within your directory tree. Your install usually sets it up for you, and if you put your home folder on a different partition or drive than the root system, those details would be in fstab. You'd have to modify it manually if, for example, you put several distros on different partitions and have them all share a Documents folder. Mapping SMB shares is just the same, it's just that the for-example Documents folder is on a network server, which is what I'm doing. I believe this is all quite normal, expected Linux behavior.

              UBPorts seems to be doing quite a bit of remapping in fstab, from a glance looks like it's mapping the android parts of the tree to the linux parts, and otherwise bringing parts of the tree to places that linux expects. So it makes sense that it would want to update it, as it's a pretty complex mapping. It looks like the UBPorts system doesn't need to map the UUIDs as desktop linux does, as the android blob takes care of that.

              But I believe brutally overwriting fstab is subverting part of its purpose. Perhaps less important in a portable context, as you don't have partitions, and wouldn't usually have permanent servers available, but there are use cases.

              I have documents and music and videos on my servers which I'd like to access from my devices, when I'm on my home network. To use these with anything besides File Manager, they need to be mapped somewhere in the root tree. I can hack fstab with a script as I'm doing, but that subverts UBPorts in that I have to make the root system r/w. Perhaps there is another way to mount SMB shares dynamically without putting them in fstab, I just don't know it. Obviously the system can do this with pluggable devices. If anybody can point me in that direction, I'd like to learn about it.

              A 1 Reply Last reply 1 Nov 2021, 19:18 Reply Quote 0
              • A Offline
                AppLee @crackulator
                last edited by 1 Nov 2021, 19:18

                @crackulator I don't have an Ubuntu Touch device at the moment to test.
                Have you tried smbmount ?
                This is for me the "normal" way of mounting a remote SMB partition. Modifying fstab is interesting if you want to mount it at each boot and if the SMB server is always reachable. That's a pretty specific use case in my opinion but there is no such thing as the right method to do things and if it works for you than that's fine.

                C 2 Replies Last reply 1 Nov 2021, 23:23 Reply Quote 0
                • C Offline
                  crackulator @AppLee
                  last edited by crackulator 11 Jan 2021, 23:24 1 Nov 2021, 23:23

                  @applee Well, that's a good point. fstab is probably not doing anything besides automatically mounting shares that could as easily be dynamically mounted by a script. smbmount seems to be obsolete but it looks like one can do it with mount.cifs in just the same way as with fstab. I'll work that out and report back.

                  1 Reply Last reply Reply Quote 1
                  • C Offline
                    crackulator @AppLee
                    last edited by 9 Nov 2021, 08:25

                    @applee so yeah, my swapping-out of fstab isn't really bringing anything to the dynamic-mounting party. One can do it just as easily with:

                    sudo mount -t cifs -o username=<username>,password=<password>,rw,uid=32011,gid=32011,sec=ntlmssp //<server>/<share> <mount path>
                    

                    (With appropriate replacements for <these fields>). The uid and gid numbers are those for the phablet user that UBPorts gave, as shown with the "id" command).

                    However I still think that changing fstab is better in some ways, since the shares should mount automatically, that is, if UBPorts wasn't clobbering the fstab. It seems like it should be possible to share that function with UBPorts' remappings. Of course it would fail to mount automatically if the network or share is not available, but that seems to be ok on other distros, it just doesn't mount, and you mount it manually later. It also lets the admin set it up so a user can mount it without having the technicals. But again that's a bit different on UBPorts, since it isn't really multi-user.

                    It seems like there are other things in /etc/ that are generally necessary to modify, /etc/ssh/ssh_config comes to mind. Isn't that where any systemwide config would be? I'm not sure how that could be unmodifyable.

                    Maybe I'm just expecting too much Linux out of it...

                    A 1 Reply Last reply 9 Nov 2021, 08:36 Reply Quote 0
                    • A Offline
                      AppLee @crackulator
                      last edited by 9 Nov 2021, 08:36

                      @crackulator said in fstab getting overwritten?:

                      Maybe I'm just expecting too much Linux out of it...

                      I understand your point of view but the way you put it is a bit sensitive here.
                      Ubuntu Touch is Linux but not for desktop PC and so has specific constraints (bootloader, firmware, partitioning, power saving, ...)

                      To fit Ubuntu Touch in the partitions made for android is not an easy task. I'm no expert here, but I guess the partitioning is source of a lot of non standard solution found to overcome these constraints.
                      I don't have an explanation for the fstab file but I suspect it has something to do with how the partitions are made.

                      At least you have a working solution for your need and if you wish to dig deeper to understand what is at play here, I'll be happy to understand it.

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        kuzmi4
                        last edited by 18 Dec 2024, 14:44

                        Hi all,
                        Has anyone succeeded in finding the fstab "generator"?

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post