how to transfer files to new external sdcard I have an old 64 GB sdcard and a new 128 GB sdcard, how do I copy over all files from my old card to my new in a way that makes android treat the new card just as the old card.

I tried simply copy-pasting over my DCIM folder, then I put the new sdcard in and rebooted my phone, on startup the phone recreated the /Android folder and all apps had rights to their new folders.

Ways I tried to move the files:

1)


dd old card to disk
dd to new card 


after this the card works but is seen as having 64 GB instead of 128 GB 
space

use gparted to resize partition


this makes android see the card as having used 64 GB space but with no files or folders



2)


dd old card to disk to disk
dd to new card
use fdisk resize partition


this makes android see the card as having only empty folders, but still used 64 GB space



3)


create 128 GB partition


this I have tried with both FAT32 and exFAT 

mount via mtp


Update: I have also tried to copy paste all the files and folders directly to the sdcard from the old card via the cp comand on linux (that was the very first thing I tried... I only tried all the other things because this did not work)

rsync all files and folders to the sdcard


this seems to make android see all the folders and files, but now my apps can't write to their own folders
eg
the problem in all of the above cases is that android eigher a) does not see the file, simply sees the card as a file with 64 GB used space but it cannot see any of the folders, or it does copy it over but the apps does not have 'access' to their own directories eg Android/data/com.bambuna.podcastaddict/files/podcast/ is where my podcasts are, but the app podcastaddict does not have write premissions for the folder.



so in short... how do I copy over all my files from the old sdcard to the new one... or do I have to factory reset my phone and redownload all my apps such that all the folders and appropriate premissions are created by android... which seems to be my only option

additional information


my phone is a unrooted z5 compact


it runs android 5.1

I have access to a Linux and windows computer, but would prefer Linux solutions.
I don't care what file system is on my external SD card.
I am familiar with the command line and would prefer solution listing a few commands I need to copy-paste


As Firelord suggested, rebooting the phone makes android "display" the DCIM folder, so this one can be copied over, however it still seems that the /Android/data/com.company.app/ folders have to be created by the apps themselves, otherwise they cannot write to them, but you can subsequently copy files into these folders

Factory reset and restore from backup did this for me... it is an ugly solution... but at least it works.

I erroneously assumed that file permissions werehidden somewhere on the SD card and therefore tried to find the 'correct way' to copy, but it seems that the folder permission is saved on the internal card, or they are tied to the application in some non-trival way.

I restarted my phone again, and then some of my apps lost permissions to write to their SD card folders?!?!, ie podcastaddict which had downloaded 300 podcasts overnight could not write to sdcard1/Android/data/com.bambuna.podcastaddict/files/podcasts

By deleting and reinstalling podcastadditc it regenerated its folder and it has been working since.
I got a real 128 gb card, here I simply copy pasted over my DCIM folder, then I put the new sdcard in and rebooted my phone, on startup the phone recreated the /Android folder and all apps had rights to their new folders.

so my method:


backup and delete all aps that use the SD card
format the sd card
take a photo to generate the DCIM folder
insert SD card in your compuer
delete the /Android folder (it will be regenerated when you insert the card in your phone)
move relevant files to the DCIM folder
insert sdcard in phone
restart phone
reinstall aps from backup
do something that makes them regenerate their folders (ie down load a file, take a picture ect)
restart the phone
for all aps that cannot write to their own folder, delete he app and delete their /Android/data/com.company.app_name folder then go to 8