I have a removable media (SD card) which automatically mounts itself when I log into Ubuntu. I want all my user directories (Music, Downloads etc) in that removable media. I modified the .config/user-dirs.dirs file to point to directories in $HOME which have symbolic links to directories in the removable media. But every time I restart my computer, the directories reset to $HOME/ instead of, for example, $HOME/downloads -> /media/username/removablemedia/downloads.
My guess is that when I log into Ubuntu xdg-user-dirs-update runs before the SD card gets mounted. Since it cannot find the directories (symlinks point to void as of now), it defaults to $HOME/. I know this because when I change the values in .config/user-dirs.dirs to directories in my $HOME, the changes persist.
So is there a way I could make Ubuntu such that it mounts the SD card first and then executes xdg-user-dirs-update?