[how-to] mount an external drive where it is visible to google photos | XDA Forums
Search This thread

master-hax

New member
May 20, 2024
1
0
this is a quick guide to mount an external drive into the pixel's internal storage. photos/video on this drive do appear in google photos, and can be backed up as well as cleared.

we don't need to copy files onto the pixel anymore! using ext4 also supports files greater than 4gb unlike mounting with the OS in fat32. save your pixel's internal storage from terabytes of unnecessary writes.

picture here
1716188412447.jpeg
i have some scripts to help automate this in my repository here: https://github.com/master-hax/pixel-backup-gang but this is the quick and dirty version. this method requires root access and has only been tested on the stock rom/kernel. it should work on both pixel & pixel XL. warning: running commands as root is dangerous. i'm not responsible if you brick your device.

plug in your ext4 formatted drive, ignore the os notification that the drive is not supported. then run the following shell commands. note that they must be run from the global mount namespace (master mount namespace). also the block device name (/dev/block/sdg1) rotates when devices are plugged/unplugged, so you'll need to double check which block device is your drive.

Code:
mkdir -p -v /mnt/my_drive
mount -t ext4 -o nosuid,nodev,noexec,noatime /dev/block/sdg1 /mnt/my_drive

mkdir -p -v /mnt/my_drive/the_binding
chmod -R 777 /mnt/my_drive/the_binding
chown -R sdcard_rw:sdcard_rw /mnt/my_drive/the_binding

mkdir -p -v /mnt/runtime/write/emulated/0/the_binding
setenforce 0
mount -t sdcardfs -o nosuid,nodev,noexec,noatime,gid=9997 /mnt/my_drive/the_binding /mnt/runtime/write/emulated/0/the_binding

everything under /the_binding on the drive should now be acessible by apps. you might need to force kill google photos for it to immediately notice the new folder.
 
Last edited: