PINE64
Persistently mount SD card? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: Persistently mount SD card? (/showthread.php?tid=11737)



Persistently mount SD card? - DarkManiels - 10-05-2020

I have Mobian installed on my eMMC and use a 128GB SD card to store my music collection. Unfortunately I've had troubles with various music players "losing" my music library after a while and having to re-scan or re-build it when I open the app after a few days (which can take quite a while). I believe I read somewhere that Mobian only mounts the SD card when it's needed, rather than keeping it persistently mounted, and I'm guessing this may be behind my problem.

I've read about the option to mount the SD card as an extended home directory in the tweaks section of the Mobian wiki, but I'm not sure I want to wipe my SD card and follow those directions just to see if this fixes my music problem. Does anyone know if there's a way to persistently mount an SD card without wiping it and setting it as the home directory? Or is this even something I'd want to do? Presumably there's a reason the card isn't persistently mounted in the "stock" Mobian installation. Any thoughts on the matter would be appreciated.


RE: Persistently mount SD card? - fernando_c_m - 10-06-2020

(10-05-2020, 05:17 PM)DarkManiels Wrote: I have Mobian installed on my eMMC and use a 128GB SD card to store my music collection. Unfortunately I've had troubles with various music players "losing" my music library after a while and having to re-scan or re-build it when I open the app after a few days (which can take quite a while). I believe I read somewhere that Mobian only mounts the SD card when it's needed, rather than keeping it persistently mounted, and I'm guessing this may be behind my problem.

I've read about the option to mount the SD card as an extended home directory in the tweaks section of the Mobian wiki, but I'm not sure I want to wipe my SD card and follow those directions just to see if this fixes my music problem. Does anyone know if there's a way to persistently mount an SD card without wiping it and setting it as the home directory? Or is this even something I'd want to do? Presumably there's a reason the card isn't persistently mounted in the "stock" Mobian installation. Any thoughts on the matter would be appreciated.
/etc/fstab is the place where you can do this. I do it so, since I had the same problems you reported. I don't have the home directory mounted on the sd card, though there are certainly some benefits like being able to flash the image directly to the emmc and then installing the packages you need as a way to restore your system vs. backing up your whole emmc with jumpdrive and dd.
Code:
UUID=youruuid / ext4 defaults 0 0
UUID=youruuid /boot ext4 defaults 0 0
UUID=youruuid          /mnt/sdcard      exfat-fuse  defaults    0      0
Just as an example my fstab. blkid can give you the uuid of your SD card. Be careful, don't reboot until the output of mount -v -a is correct. If you can't figure it out, just delete the lines you added and ask for help.


RE: Persistently mount SD card? - DarkManiels - 11-08-2020

(10-06-2020, 04:00 AM)fernando_c_m Wrote:
(10-05-2020, 05:17 PM)DarkManiels Wrote: I have Mobian installed on my eMMC and use a 128GB SD card to store my music collection. Unfortunately I've had troubles with various music players "losing" my music library after a while and having to re-scan or re-build it when I open the app after a few days (which can take quite a while). I believe I read somewhere that Mobian only mounts the SD card when it's needed, rather than keeping it persistently mounted, and I'm guessing this may be behind my problem.

I've read about the option to mount the SD card as an extended home directory in the tweaks section of the Mobian wiki, but I'm not sure I want to wipe my SD card and follow those directions just to see if this fixes my music problem. Does anyone know if there's a way to persistently mount an SD card without wiping it and setting it as the home directory? Or is this even something I'd want to do? Presumably there's a reason the card isn't persistently mounted in the "stock" Mobian installation. Any thoughts on the matter would be appreciated.
/etc/fstab is the place where you can do this. I do it so, since I had the same problems you reported. I don't have the home directory mounted on the sd card, though there are certainly some benefits like being able to flash the image directly to the emmc and then installing the packages you need as a way to restore your system vs. backing up your whole emmc with jumpdrive and dd.
Code:
UUID=youruuid / ext4 defaults 0 0
UUID=youruuid /boot ext4 defaults 0 0
UUID=youruuid          /mnt/sdcard      exfat-fuse  defaults    0      0
Just as an example my fstab. blkid can give you the uuid of your SD card. Be careful, don't reboot until the output of mount -v -a is correct. If you can't figure it out, just delete the lines you added and ask for help.
Thank you, @fernando_c_m , and sorry for the late reply. This seems to have fixed my problem.


RE: Persistently mount SD card? - HLing - 11-12-2020

um, I think I need help. I was able to follow the mobian tweaks up until finding out the UUID:

Now that you have Mobian installed on the eMMC and a fresh sdcard inserted, power on the phone and launch the terminal. First, mount the sdcard by running
Code:
sudo mkdir /mnt/sdcard && sudo mount -t ext4 /dev/mmcblk0p1 /mnt/sdcard
. Then, copy the current contents of /home to it with
Code:
sudo cp -aR /home/* /mnt/sdcard/
. Then, unmount it from the temporary mountpoint with
Code:
sudo umount /mnt/sdcard
, and mount it at /home with
Code:
sudo mount -t ext4 /dev/mmcblk0p1 /home
. Finally, we will need to acquire the UUID of the sdcard and add an entry to fstab. Run
Code:
sudo blkid /dev/mmcblk0p1
to get the UUID, and then copy just the UUID (it will look like 1f255d6ae-1634-2aa4-172cfa15) and edit /etc/fstab with vim or nano (or whatever). Copy the first line, and paste it at the bottom of the file as a new third line. Then replace the UUID with what you copied from the output of blkid, and change the / to /home, and finally change the final 0 to a 2 (this will tell fsck to check it after the other entries). It should look like this:
Code:
UUID=a2c1f977-0405-4ae1-8169-639b8ae53e3b    /home    ext4    defaults    0    2


Here's where I got confused. Can I just add the third line by typing in the UUID I got from sudo blkid /dev/mmcblk0p1?
At the moment, it looks like the sd card is there. My storage Usage has a "Storage 1(the size of my 32G sd card) with a Home folder having 581 MB,, and Storage 2 (my internal memory) with Operating system of 5.1GB. 
I should not leave it as is, but I'm confused as to what the portions after each UUID should look like.
Please help!


RE: Persistently mount SD card? - DarkManiels - 11-19-2020

(11-12-2020, 04:57 PM)HLing Wrote: um, I think I need help. I was able to follow the mobian tweaks up until finding out the UUID:

........

Here's where I got confused. Can I just add the third line by typing in the UUID I got from sudo blkid /dev/mmcblk0p1?
At the moment, it looks like the sd card is there. My storage Usage has a "Storage 1(the size of my 32G sd card) with a Home folder having 581 MB,, and Storage 2 (my internal memory) with Operating system of 5.1GB. 
I should not leave it as is, but I'm confused as to what the portions after each UUID should look like.
Please help!

It looks like you're following the directions from the wiki to mount an SD card as your home directory. I was looking for a way to persistently mount an SD card but keep my home directory on the eMMC, which is what @fernando_c_m helped me with. Sorry - I haven't tried those directions in the wiki, so I don't know how to answer your question. Hopefully someone else can help out, or you could ask as a separate question.


RE: Persistently mount SD card? - HLing - 11-21-2020

(11-19-2020, 04:30 PM)DarkManiels Wrote:
(11-12-2020, 04:57 PM)HLing Wrote: um, I think I need help. I was able to follow the mobian tweaks up until finding out the UUID:

........

Here's where I got confused. Can I just add the third line by typing in the UUID I got from sudo blkid /dev/mmcblk0p1?
At the moment, it looks like the sd card is there. My storage Usage has a "Storage 1(the size of my 32G sd card) with a Home folder having 581 MB,, and Storage 2 (my internal memory) with Operating system of 5.1GB. 
I should not leave it as is, but I'm confused as to what the portions after each UUID should look like.
Please help!

It looks like you're following the directions from the wiki to mount an SD card as your home directory. I was looking for a way to persistently mount an SD card but keep my home directory on the eMMC, which is what @fernando_c_m helped me with. Sorry - I haven't tried those directions in the wiki, so I don't know how to answer your question. Hopefully someone else can help out, or you could ask as a separate question.

Thanks,  DarkManiels, for your reply.  I  misunderstood  then.  oops. My pinephone  is working fine  now. the 32G  card is   seen but not mounted. That's the good news.   The bad news is I messed up   my work desktop computer as a  result of carelessness  when I used Jumpdrive to  write  the fstab. (instead, the desktop fstab file got deleted, nothing  boots..