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

How to re-mount the SD

Scheduled Pinned Locked Moved Support
7 Posts 2 Posters 969 Views 1 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.
    • G Offline
      guru
      last edited by 23 Apr 2019, 11:05

      Hello,

      I can unmount my SD but can't mount it again with:

      # mount
      ...
      /dev/mmcblk1 on /media/phablet/A8FD-027E type vfat (ro,nosuid,nodev,relatime,uid=32011,gid=32011,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
      # umount /media/phablet/A8FD-027E
      # mount /media/phablet/A8FD-027E
      mount: can't find /media/phablet/A8FD-027E in /etc/fstab
      # mount /dev/mmcblk1
      mount: can't find /dev/mmcblk1 in /etc/fstab
      # mount -t vfat /dev/mmcblk1 /media/phablet/A8FD-027E
      mount: mount point /media/phablet/A8FD-027E does not exist
      # ls -ld /media/phablet/A8FD-027E
      ls: cannot access '/media/phablet/A8FD-027E': No such file or directory
      

      What is the correct way to mount the SD again?

      The background of my question is: every now and than files and dirs on my SD get corrupted. Is this a known problem?

      T 2 Replies Last reply 23 Apr 2019, 13:28 Reply Quote 0
      • T Offline
        tera @guru
        last edited by tera 23 Apr 2019, 13:28

        @guru The target folder need to exist and permissions from the mounted filesystem will apply, try the following for example (note the partition at the end of sdcard device: ...p1):

        sudo mount /dev/mmcblk1p1 /mnt
        

        Did not have issue with corrupted files so far on FP2 but i'm using ext4 fs (now encrypted as well), but you can probably try to check the filesystem before mounting the partition:

        sudo fsck.vfat /dev/mmcblk1p1
        
        G 1 Reply Last reply 24 Apr 2019, 06:59 Reply Quote 0
        • T Offline
          tera @guru
          last edited by tera 23 Apr 2019, 13:34

          @guru You should also be able to use the following based on your input:

          sudo fsck.vfat /dev/disk/by-uuid/A8FD-027E
          sudo mount /dev/disk/by-uuid/A8FD-027E /mnt
          
          G 1 Reply Last reply 23 Apr 2019, 15:33 Reply Quote 0
          • G Offline
            guru @tera
            last edited by 23 Apr 2019, 15:33

            I have 30+ years of UNIX knowlege and know how to mount a fs. The question was, how to mount it again exactly as done by UT on boot or by the app after formatting.

            T 1 Reply Last reply 23 Apr 2019, 17:12 Reply Quote 0
            • T Offline
              tera @guru
              last edited by tera 23 Apr 2019, 17:12

              @guru That bumps it up to almost 60 years on this page, hopefully we will manage 🙂
              Looking at https://github.com/ubports/ciborium, it seems that udisks2 is in use, can you have a try with something like this (maybe without p1):

              sudo udisksctl mount -b /dev/mmcblk1p1
              

              Never heard ab it before tbh, info seems to give hints as well: http://manpages.ubuntu.com/manpages/xenial/man1/udisksctl.1.html

              1 Reply Last reply Reply Quote 1
              • G Offline
                guru @tera
                last edited by 24 Apr 2019, 06:59

                @tera said in How to re-mount the SD:

                @guru The target folder need to exist and permissions from the mounted filesystem will apply, try the following for example (note the partition at the end of sdcard device: ...p1):

                sudo mount /dev/mmcblk1p1 /mnt
                

                Did not have issue with corrupted files so far on FP2 but i'm using ext4 fs (now encrypted as well), but you can probably try to check the filesystem before mounting the partition:

                sudo fsck.vfat /dev/mmcblk1p1
                

                Is ext4 on the SD supported without making the system writable to modify the fstab?

                T 1 Reply Last reply 24 Apr 2019, 08:09 Reply Quote 0
                • T Offline
                  tera @guru
                  last edited by tera 24 Apr 2019, 08:09

                  @guru said in How to re-mount the SD:

                  Is ext4 on the SD supported without making the system writable to modify the fstab?

                  I would guess not, using encryption, a script is required to mount the fs following this post: https://forums.ubports.com/topic/1012/one-method-to-encrypt-home-phablet

                  I had a go at it, inserted a new SD card, formatted it using the External Drives app and it actually do not create a partition but format the whole SD card in fat32/vfat which is a behavior i have never observed before...

                  Additional 2p, it looks like the External Drives app only support vfat:
                  https://github.com/ubports/ciborium/blob/xenial/cmd/ciborium/main.go#L107
                  https://github.com/ubports/ciborium/blob/xenial/cmd/ciborium-ui/main.go#L53

                  1 Reply Last reply Reply Quote 0
                  5 out of 7
                  • First post
                    5/7
                    Last post