Note that eMMC is mmcblk0
, and will be ignored. Your current SD card (mmcblk1
) has two partitions on it, and this is basically what you want if you want more than one subdirectory to be replaced with the SD card handling it. The simple method is to just mount a partition at points which use a lot of storage, but which are not related to boot. This can be extended with multiple partitions. However, I don’t know the size of your current SD card, nor do I know if there is content on mmcblk1p1
or mmcblk1p2
which you want to keep and not destroy.
For the purpose of examples, and not because this is what you really have, I will pretend that mmcblk1p1
and mmcblk2p2
are both 32GB on an SD card of size 64GB. I will use the actual UUIDs though, but if you format or repartition, then it is likely the UUID will change.
The first goal is to make an entry in “/etc/fstab
” which “allows” mount of the first partition on “/usr/local
”, but which does not require mount for boot to continue. Consider adding this line into fstab
:
UUID=89b53264-9942-4638-9b91-834c206faa1c /usr/local ext4 noauto,user 0 1
The above, if the partition is not already mounted (be sure to “umount /dev/mmcblk1p1
” prior to experiment with this if the system auto mounted the partition), will allow a user to mount the partition, but won’t require or attempt to mount the partition during boot (we’ll adjust that in steps):
sudo mount /usr/local
From that point on only that partition will be used from that specific UUID without requiring naming the UUID or device partition. Note that in “mount /usr/local
” the system itself determines which partition to use. Note that most people would use “defaults
” instead of the “noauto,user
” argument in field 4. This is why the partition won’t automatically mount. The equivalent to “defaults
” can be found in “man fstab
”, but I’ll note it here:
rw, suid,dev,exec,auto,nouser,async
Even the default would be ok for use with the SD card mount at that location, but I wanted you to try to manually “sudo mount /usr/local
” and “sudo umount /usr/local
” just to see if it works. Next we’ll turn it into “nearly” “defaults
”…we’ll make it so that missing the partition does not cause boot to fail:
UUID=89b53264-9942-4638-9b91-834c206faa1c /usr/local ext4 rw, suid,dev,exec,auto,nouser,async,nofail 0 1
(the “nofail
” is extremely important since it allows boot without that specific partition)
Unfortunately, auto mount when a user logs in to the GUI needs to be disabled if it is automatically mounted. I have mine disabled already, can you tell me the name of files you find in “ls /etc/udev/rules.d/*
”? One of them probably has a rule for mounting to a “run
” location. That one could be temporarily disabled by changing the name…I prefer to compress that file with gzip
to disable (then it can be reenabled by gunzip
).
If you can set up a line which allows that to mount when present, but won’t fail when missing, and does not try to automount, then we can move on to the next steps.