Page 1 of 1
Duplicate/double mounts of partitions
Posted: Wed Jul 10, 2024 2:01 am
by dcung
I installed gvfs-backends and afterward (reboot) - on desktop and Thunar there are double entries of partitions.
Initially I was using Bullseye DDOG. But after few days looking into this - fresh builds, my testing showed that Bullseye/Bookworm - DDOG (Thunar), ODBOG (PCManFM) have same/similar symptoms. My googling also found many of same/similar 'complaint' out there for variety of distros. None of the 'solutions' suit me yet.
Some said that they used GPT to solve it. I tried it - still happened. Not that it is a 'practical' solution if that solves it. I have drives too many/big to reformat..
From what I can tell, be it FAT, FAT32, ext3, ext4, NTFS, or whatever it still happened. My guess is - this has got to do with the way they are mounted/auto-mounted at different places. I'd like to learn more, where ?
For me, the 'most' tolerable solution (until I find better one) is.
- Remove 'noauto' from stanza - this stop double mount entries of internal disks/partitions. Else I get double in desktop icons, and file-manager (Thunar/PCManFM).
So, I still get double entries when plugging external devices. Different behavior depending which icon/entry you click (i.e. with or w/o sdxx displayed).
Too long/hard to describe exactly, probably clearer if you try it.
Here are some screenshots from a laptop that have minimal disks/partitions to illustrate.
Re: Duplicate/double mounts of partitions
Posted: Fri Jul 12, 2024 10:19 pm
by dcung
This still interest me to dig further.
I did some research/reading on the net, and took me to Debian's RTFM - Read The Fantastic Manuals - good acronym..
Thru reading various sources - I think what happens is that DOG has its own detection/mounting/unmounting mechanism. And so does gvfs...hence the doubling of the entries. And they are both 'enabled' at the moment.
Found these from further experimenting on different laptops and storages.
- With 'noauto' you get double of 'everything', and with automount - only those USB plugged in later will have double entries (I found exception too, but don't know why yet).
- When there are double entries, DOG will mount it to /mnt/sdxx
, and gvfs will mount it to /media/root/part-name/
(i.e. /media/user/part-name/
)
- When you have USB device already plugged in at the time of boot/reboot, no double entries since the DOG automount takes precedence.
(Edit - just found out this is not applicable if you have it plugged in via a docking station. Double entries. )
From RTFM, there are articles that tells where these gvfs configs are.
I am yet to make sense of those...my experiments are still fruitless...
I saw different rules for different partition types. This probably explains why some USB sticks I don't see doubling of every partition, some only DOG detected.
I'll report if I find something 'useful'.
So far, I found more questions than answer.
Anyway...interesting reading nonetheless.
For now, I can put up with this 'cosmetic' issue.
All still function/working normally.
Re: Duplicate/double mounts of partitions
Posted: Sat Jul 13, 2024 7:42 am
by fredx181
Hi @dcung
The package "pup-volume-monitor" provides showing the devices in Thunar or Pcmanfm. By installing gvfs the devices are doubled as gvfs does about the same as pup-volume-monitor.
So then, uninstalling pup-volume-monitor will solve the "double" problem.
Note that gvfs mounts with different options,
- gvfs mount of my sda3 USB (with nodev and nosuid):
/dev/sda3 on /run/media/root/Persistence type ext4 (rw,nosuid,nodev,relatime,errors=remount-ro,uhelper=udisks2)
- pup-volume-monitor mount of sda3:
/dev/sda3 on /mnt/sda3 type ext4 (rw,relatime)
Side info:
I've found that debootstrap gives error if you run a mklive build on a gvfs mounted partition:
/usr/share/debootstrap/functions: line 1665: /run/media/root/Persistence/bookworm/chroot/test-dev-null: Permission denied
E: Cannot install into target '/run/media/root/Persistence/bookworm/chroot' mounted with noexec or nodev
If the "boot" partition (/mnt/home, where the frugal install is located) is e.g. ext3 or ext4, debootstrap works because it's not a gvfs mount (mounted from the initrd).
P.S. I once investigated, and it seems not possible to configure gvfs-mount to make it mount partitions without "nodev". But you can always bypass gvfs by mounting manually from CLI of course.
Re: Duplicate/double mounts of partitions
Posted: Sat Jul 13, 2024 9:46 am
by dcung
Hi @fredx181 ,
fredx181 wrote: ↑Sat Jul 13, 2024 7:42 am
...
So then, uninstalling pup-volume-monitor will solve the "double" problem.
...
Thanks for this. I tested it and yes, the double entries issue is 'solved'.
'solved' because I think pup-volume-monitor is doing 'better' job than gvfs.
I mentioned above that though some partitions are shown twice when gvfs is installed, there are anomalies that I could not explain yet. i.e. some partition is not shown twice (now I know it is because only pup-volume-monitor picked it up, gvfs didn't). Now without pup-volume-monitor, such partitions are not picked up.
I guess I have to choose what is preferred. Such is linux, full of choices...
Before I read your posting, I tested making gvfs squashfs. And only load it when I need gvfs for a workaround double entries issue. This works too for my need. Note - need to reboot, does not work if loaded on the fly.
I read somewhere that you can customize gvfs mount rules. I'm still playing around with it. I could not make it work like they said it would...
- 2024-07-13-184320_673x548_scrot.png (104.17 KiB) Viewed 1360 times
.
.
Just a little for background how I got into this topic.
I have been using CamPhoneTab to transfer files ever since I use DDOG. I rarely need to use it and it has been sufficient - never did large transfer.
But few days ago, I swapped phone. So, I needed to transfer about 10GB fotos to the new phone.
Using CamPhoneTab reading the 10GB was not an issue, but writing to the new phone wasn't smooth. It always froze/stopped at about 2GB mark or so...
I thought I already ditched Windows forever, but I had to reboot to Windows (my main laptop still multi boot). So, after finished the transfer with Windows, I started researching... and here we go...gvfs...
Anyway... I always learnt something in the process...
FYI - I tried KLUJamXFCE too out of interest. It works and no double entries. Of course, I know now this is because KLUJamXFCE does not use pup-volume-monitor (?)...
Re: Duplicate/double mounts of partitions
Posted: Sat Jul 13, 2024 11:00 am
by fredx181
dcung wrote:I mentioned above that though some partitions are shown twice when gvfs is installed, there are anomalies that I could not explain yet. i.e. some partition is not shown twice (now I know it is because only pup-volume-monitor picked it up, gvfs didn't). Now without pup-volume-monitor, such partitions are not picked up.
Yes, one of the differences is that gvfs doesn't pick up the 'boot from' partition (already mounted from the initrd).
There's "live/image" from the left pane to open that partition (or go to /mnt/home).
I read somewhere that you can customize gvfs mount rules. I'm still playing around with it. I could not make it work like they said it would...
I'm curious about what you can find, I only once found that you can configure it to mount directly on /media/... rather than on /run/media/root/...
EDIT: gvfs is nice as it has many options to mount different filesystem types, pup-volume-monitor is limited to only drive partitions.
Re: Duplicate/double mounts of partitions
Posted: Sat Jul 13, 2024 10:25 pm
by dcung
fredx181 wrote: ↑Sat Jul 13, 2024 11:00 am
Yes, one of the differences is that gvfs doesn't pick up the 'boot from' partition (already mounted from the initrd).
There's "live/image" from the left pane to open that partition (or go to /mnt/home).
Yes, I noticed that too, this includes any USB partitions that I left plugged in during boot time.
gvfs left it alone, those that got picked-up by removing 'noauto', i.e. already mounted - no double entries.
The anomalies I referred to was not that.
I have (two) USB thumb drive(s), used for booting EFI and Legacy HW. Nothing fancy, just a small FAT32 and EXT4 partitions on each thumb drive.
On any already running DOGS (i.e. not booting from the USB), when I plugged in the USB, it only shows 3 entries (1 x FAT32, 2 x EXT4). I was expecting 4. So, I grabbed a spare USB (blank), created FAT16, FAT32, EXT3, EXT4. I plugged in and it shows 8 (per screenshot in first post).
I don't know why gvfs treated it different (?), anomaly (atm). Of course, there are differences, eg. on the bootable USB, I put grub2 bootloader and EFI files.
It's still on the (bottom) list of my things to investigate.
- 2024-07-11-073436_518x593_scrot.png (110.65 KiB) Viewed 1286 times
fredx181 wrote: ↑Sat Jul 13, 2024 11:00 am
I'm curious about what you can find, I only once found that you can configure it to mount directly on /media/... rather than on /run/media/root/...
EDIT: gvfs is nice as it has many options to mount different filesystem types, pup-volume-monitor is limited to only drive partitions.
Yes, it seems that gvfs have lots of options to mount different filesystem types. I came across and read many posts. I didn't bookmark them since none were fruitful when I tried them. But the summary I am getting is that, gvfs can be configured to my preference, just have to know how to configure it. And for now, I don't.
https://forum.manjaro.org/t/defaults-for-gvfs/152517/2
When you want to override the defaults - place a copy of the config in the relevant folder in your home - then edit that file.
.
.
.
FYI - A little off topic.
Few days ago, I refreshed all my builds again. I included gvfs in all full DE DOGS (not on minimal builds DE).
No build issue with Bookworm and Daedalus. With Bullseye, I had to replace fuse with fuse3 (something that Bookworm/Daedalus already done). So, all my test above were using this fresh builds. Unless I want to test manual package installs then I use previous builds.
Re: Duplicate/double mounts of partitions
Posted: Sun Jul 14, 2024 12:36 am
by dcung
dcung wrote: ↑Sat Jul 13, 2024 10:25 pm
It's still on the (bottom) list of my things to investigate.
..
Suddenly become top of the list since it's easy to test...
Turned out, any partition flagged as 'esp', gvfs left it alone...
I flagged FAT16, then FAT32, then EXT3 and saw the doubles disappeared one by one.
My guest is that no rule exist yet to tell it what to do..(?)
- 2024-07-14-102736_500x631_scrot.png (124.31 KiB) Viewed 1270 times
- 2024-07-14-102807_580x388_scrot.png (60.05 KiB) Viewed 1270 times
Re: Duplicate/double mounts of partitions
Posted: Sun Jul 14, 2024 2:59 pm
by fredx181
In case you're interested @dcung .
Found (again) now how to gvfs mount to /media (instead of /run/media/)
From terminal:
echo 'ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1"' > /etc/udev/rules.d/99-udisks2.rules
(possibly reboot required)
(ENV{UDISKS_FILESYSTEM_SHARED}="0"
is the default (mounts in /run/media)
Here's also more info about configuring udisks2 (which is the underlying program for gvfs):
http://storaged.org/doc/udisks2-api/lat ... tions.html
Don't know how to use all that, though.
Re: Duplicate/double mounts of partitions
Posted: Sun Jul 14, 2024 9:55 pm
by dcung
@fredx181 I came across that too, and these among other things.
https://wiki.gnome.org/Projects/gvfs/doc
https://gitlab.gnome.org/GNOME/gvfs/raw ... -shown.txt
I'm not picky about using pup-volume-monitor or gvfs. I put both in full DE because, then I can have 'best' of what I need of them - for the moment.
i.e. this way I can access mobile phone storage easily and also have those esp flagged partitions shown.
Be it at the 'cost' of seeing double - well, it's only 'cosmetic' anyway.
When (or if) I find out how to utilize/create custom rules that suits me better, then I can choose only have one of the monitor.
There are lots of info to 'chew'...and my 'mouth/brain' is small...so it does take time...
The good thing is that experimenting with DOG are fast and easy... no need to fear of losing data.
(applicable to most to most distros in this forum too)
Thank you for that mounting location rule example...
Re: Duplicate/double mounts of partitions
Posted: Mon Jul 15, 2024 12:25 am
by dcung
I came across this (old posts).
https://unix.stackexchange.com/question ... by-udisks2
The guy wanted to use partition-label as part of mount point name, which now I can see that it has been implemented. i.e. when I mount with gvfs it put the label.
(It also has what Fred posted above about changing mount locations).
I saw another guy commented at the time, and the point was it was hardcoded and he posted a link to the source code.
This is beyond me, but I post it here in case someone interested in reading...
https://github.com/storaged-project/udi ... tem.c#L647
Re: Duplicate/double mounts of partitions
Posted: Mon Jul 15, 2024 9:57 am
by fredx181
@dcung It seems to me that the only way with gvfs is using /etc/fstab , it's highly configurable though, mountpoint, mount options, even the display name in the file-manager (x-gvfs-name=...), for example I added in fstab:
/dev/disk/by-label/disk2 /mnt/disk2 auto exec,suid,dev,nofail,x-gvfs-show,noauto,x-gvfs-name=newdata2 0 0
- Screenshot.png (63.38 KiB) Viewed 1155 times
Re: Duplicate/double mounts of partitions
Posted: Mon Jul 15, 2024 4:17 pm
by fredx181
@dcung For to experiment, this script (I named it "cr-fstab" and added it to ~/Startup) works nicely for me, perhaps for you too (or with some modifications maybe).
It will create new /etc/fstab, mountpoints will be in /mnt/, has custom mount options different from the udisks2 defaults.
Not perfect though, the fstab created will only contain the devices that are connected at boot/login, i.e. say you plug in another device afterwards, it will be as the default udisks2 conf, unless you restart X (so that /etc/fstab is re-created by the script in ~/Startup).
Not that it was my intention, but I'd say that this mimics a bit how pup-volume-monitor behaves.
Code: Select all
#!/bin/bash
# set mount options (except for vfat and ntfs, it's specified below)
MOPT="noatime,nodiratime,suid,dev,exec,async,x-gvfs-show,noauto"
# Setup fstab
rm -f /tmp/devices 2>/dev/null
blkid | egrep -v '/dev/sr|/dev/loop|/dev/mapper' >>/tmp/devices
dev=`egrep -v 'TYPE="sw|TYPE="LVM|TYPE=".*_raid_member"' /tmp/devices 2>/dev/null | cut -d: -f1 | cut -d/ -f3 | sort | uniq`
cat > /etc/fstab << EOF
# Device partitions:
EOF
for x in $dev; do
if [ ! -d /mnt/$x ]; then
mkdir /mnt/$x
fi
uuid=`grep -w /dev/$x /tmp/devices | egrep -o ' UUID=[^ ]+' | cut -d'"' -f2`
fs=`grep -w /dev/$x /tmp/devices | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`
lbl=`grep -w /dev/$x /tmp/devices | egrep -o ' LABEL=[^ ]+' | cut -d'"' -f2`
[ -z "$lbl" ] && LBL=$x || LBL="${lbl}_${x}"
if [ $fs = vfat ]; then
echo "/dev/disk/by-uuid/$uuid /mnt/$x vfat noatime,nodiratime,suid,dev,exec,async,umask=0,check=s,utf8,x-gvfs-show,noauto,x-gvfs-name=$LBL 0 0" >>/etc/fstab
elif [ $fs = ntfs ]; then
echo "/dev/disk/by-uuid/$uuid /mnt/$x ntfs rw,noatime,user_id=0,group_id=0,allow_other,blksize=4096,x-gvfs-show,noauto,x-gvfs-name=$LBL 0 0" >>/etc/fstab
else
echo "/dev/disk/by-uuid/$uuid /mnt/$x $fs $MOPT,x-gvfs-name=$LBL 0 0" >>/etc/fstab
fi
done
Re: Duplicate/double mounts of partitions
Posted: Tue Jul 16, 2024 12:34 am
by dcung
fredx181 wrote: ↑Mon Jul 15, 2024 4:17 pm
...
i.e. say you plug in another device afterwards, it will be as the default udisks2 conf, unless you restart X (so that /etc/fstab is re-created by the script in ~/Startup).
...
@fredx181 That's the problem. The 'cosmetic' issue appears when another device is plugged in afterward. And, I like the idea 'automatic' detection/monitor. Especially when it comes to installing it on family/friends laptops - which are even more technically challenged (linux wise) than me. And for them especially, gvfs is an improvement in a sense that they now can just plug in their mobile phone and transfer stuff. And unlike me, they don't plug/unplug different (many) usb drives . So, not an issue for them. And for me, I can put up with it until I find some 'solution' I like.
Anyway, I like to collect script so that I can 'copy' the idea when a suitable need arise. For example, reading your mklive script helped me a lot in gaining deeper understanding of things that were 'magic' under the hood.
No doubt, I certainly will tinker with this code too and learn few new things.!
Thanks Fred!
Re: Duplicate/double mounts of partitions
Posted: Tue Jul 16, 2024 11:32 am
by fredx181
dcung wrote: ↑Tue Jul 16, 2024 12:34 am
fredx181 wrote: ↑Mon Jul 15, 2024 4:17 pm
...
i.e. say you plug in another device afterwards, it will be as the default udisks2 conf, unless you restart X (so that /etc/fstab is re-created by the script in ~/Startup).
...
@fredx181 That's the problem. The 'cosmetic' issue appears when another device is plugged in afterward. And, I like the idea 'automatic' detection/monitor.
...
...
OK, yes, well couldn't resist to work on it a little more , this will monitor for changes in /dev/disk/by-uuid , if there are , it will create new /etc/fstab, still experimental and a bit odd method...
If using pcmanfm, auto-mount insertable drives should be disabled in the preferences, otherwise (I think) it mounts quicker (when removable drive inserted) than fstab is created.
EDIT 2024-07-17 modified the code below, fixed that the "boot_from" partition did not always show in the devices list on Thunar or Pcmanfm
Code: Select all
#!/bin/bash
# set mount options (except for vfat and ntfs, it's specified below)
MOPT="noatime,nodiratime,suid,dev,exec,async,x-gvfs-show,noauto"
# Setup fstab function
fstab () {
rm -f /tmp/devices 2>/dev/null
#rm -f /etc/fstab 2>/dev/null
blkid | egrep -v '/dev/sr|/dev/loop|/dev/mapper' >>/tmp/devices
dev=`egrep -v 'TYPE="sw|TYPE="LVM|TYPE=".*_raid_member"' /tmp/devices 2>/dev/null | cut -d: -f1 | cut -d/ -f3 | sort | uniq`
cat > /etc/fstab << EOF
# Device partitions:
EOF
for x in $dev; do
if [ ! -d /mnt/$x ]; then
mkdir /mnt/$x
fi
uuid=`grep -w /dev/$x /tmp/devices | egrep -o ' UUID=[^ ]+' | cut -d'"' -f2`
fs=`grep -w /dev/$x /tmp/devices | egrep -o ' TYPE=[^ ]+' | cut -d'"' -f2`
lbl=`grep -w /dev/$x /tmp/devices | egrep -o ' LABEL=[^ ]+' | cut -d'"' -f2`
[ -z "$lbl" ] && LBL=$x || LBL="${lbl}_${x}"
if [ $fs = vfat ]; then
echo "/dev/disk/by-uuid/$uuid /mnt/$x vfat noatime,nodiratime,suid,dev,exec,async,umask=0,check=s,utf8,x-gvfs-show,noauto,x-gvfs-name=$LBL 0 0" >>/etc/fstab
elif [ $fs = ntfs ]; then
echo "/dev/disk/by-uuid/$uuid /mnt/$x ntfs rw,noatime,user_id=0,group_id=0,allow_other,blksize=4096,x-gvfs-show,noauto,x-gvfs-name=$LBL 0 0" >>/etc/fstab
else
echo "/dev/disk/by-uuid/$uuid /mnt/$x $fs $MOPT,x-gvfs-name=$LBL 0 0" >>/etc/fstab
fi
done
sleep 1 # wait a sec before renewing fstab
echo '' >> /etc/fstab # renew, will be re-read by gvfs-mount, so then all partitions should be listed
}
fstab
MON=$(ls /dev/disk/by-uuid)
while true; do
NEWMON=$(ls /dev/disk/by-uuid)
if [ "$NEWMON" != "$MON" ]; then
MON=$NEWMON
echo "content of /dev/disk/by-uuid changed, running fstab"
fstab
continue
fi
sleep 1
done
Re: Duplicate/double mounts of partitions
Posted: Tue Jul 16, 2024 8:02 pm
by dcung
fredx181 wrote: ↑Tue Jul 16, 2024 11:32 am
...
OK, yes, well couldn't resist to work on it a little more , this will monitor for changes in /dev/disk/by-uuid , if there are , it will create new /etc/fstab, still experimental and a bit odd method...
If using pcmanfm, auto-mount insertable drives should be disabled in the preferences, otherwise (I think) it mounts quicker (when removable drive inserted) than fstab is created.
...
@fredx181
I tried it. (DDOG DE only - so Thunar FM)
This exercise showed/confirmed something.
fstab was empty to begin with (fresh build), so the (initial) mount/detection was not using/relying on that - who knows where it got it from [Edit - see next post].
The cr-fstab script works in the sense that it creates unique (by uuid) and monitor changes (ie. detect unplugging).
As a result, by using this script, there's even more duplicates/doubles (ie empty vs not-empty fstab)
Even (double) partitions that were 'solved' by removing noauto before, are coming back, since fstab file is now not empty.
Even esp flagged partitions now appears doubles (my dummy usb has 3 such partitions from last experiment - they all 'came back')
Nevertheless - thanks for trying Fred.
It's no biggy - I already got used to this cosmetic 'quirk' by now.
.
.
- 2024-07-17-051950_536x738_scrot.png (136.92 KiB) Viewed 1052 times
Re: Duplicate/double mounts of partitions <SOLVED>
Posted: Tue Jul 16, 2024 10:25 pm
by dcung
I did further testing Fred.
The script actually does work!.
My mistake was that thinking I already removed pup-volume-monitor.
But it was still there. (i.e. got installed again as dependent of drive-icons).
When I made sure to remove it. Your script works. No double.
- 2024-07-17-081933_460x636_scrot.png (111.5 KiB) Viewed 1037 times
Re: Duplicate/double mounts of partitions
Posted: Wed Jul 17, 2024 3:00 pm
by fredx181
dcung wrote:I did further testing Fred.
The script actually does work!.
Yes, only problem I found that it didn't always show the "boot-from" partition (timing issue, I guess), the changed code from here should fix it; viewtopic.php?p=126123#p126123 (see EDIT 2024-07-17).
Not sure, maybe I lost track a little about what you started this thread for, tell me if it's not exactly what you really want.
Re: Duplicate/double mounts of partitions
Posted: Wed Jul 17, 2024 9:38 pm
by dcung
fredx181 wrote: ↑Wed Jul 17, 2024 3:00 pm
... it didn't always show the "boot-from" partition (timing issue, I guess), the changed code from here should fix it; ...
Not sure, maybe I lost track a little about what you started this thread for, tell me if it's not exactly what you really want.
"boot-from" partition
- are you referring to live/image symlink on the left panel?
I'm laptops hopping, so i didn't notice as readily. But I put your script on one of my test laptop.
I already learnt few thing from this thread - very grateful. As the result, I now have few options to tackle this double mounts showing.
I will probably apply differently to different laptops.
I started this thread when I was migrating data to the new phone - it's done.
I now got sidetracked with applying custom ROM on the old phone(s).
And it's off topic, so I didn't write about it here.
Re: Duplicate/double mounts of partitions
Posted: Thu Jul 18, 2024 8:00 am
by fredx181
dcung wrote:"boot-from" partition - are you referring to live/image symlink on the left panel?
That partition, yes, but live/image is a bookmark entry, not "device" entry , what previously happened (and now fixed) was that the partition was showing initially in the Devices list, but sometimes disappeared from that list when plugging in/out another device (when it re-creates /etc/fstab).
Re: Duplicate/double mounts of partitions
Posted: Thu Jul 18, 2024 9:51 pm
by dcung
fredx181 wrote: ↑Thu Jul 18, 2024 8:00 am
dcung wrote:"boot-from" partition - are you referring to live/image symlink on the left panel?
That partition, yes, but live/image is a bookmark entry, not "device" entry , what previously happened (and now fixed) was that the partition was showing initially in the Devices list, but sometimes disappeared from that list when plugging in/out another device (when it re-creates /etc/fstab).
Ok, I've updated with your new/edited script. Will keep en eye when I use that test laptop.
BTW - I saw your post there and now use it in my KLU-Jam-XFCEbase...
viewtopic.php?p=126263&sid=ae88f7f8732b ... 09#p126263
Re: Duplicate/double mounts of partitions
Posted: Fri Jul 19, 2024 8:17 pm
by dcung
fredx181 wrote: ↑Wed Jul 17, 2024 3:00 pm
Yes, only problem I found that it didn't always show the "boot-from" partition (timing issue, I guess), the changed code from here should fix it; viewtopic.php?p=126123#p126123 (see EDIT 2024-07-17).
I refreshed my iso set, incorporating these thing learnt here - your script, edited a little.
I see what you mean now.
In fact, it's not just the "boot-from" partition...in my case all other partitions too some times - well 'random' anyway.
Well - not so random...sdaX higher X has more chance to not appear... ...simple cause their entry created 'later'.
(At first I thought it was favoring ntfs partition, then I realized the entries creation order...ie. my ntfs - sda1)
I concur, it's a timing issue - ie. gvfs-mount read the 'unfinished' fstab before the script completed.
I didn't see it before because the laptop I was testing has only 1 partition (and also slower D630).
I refreshed using the fujitsu, which has more partitions and somewhat faster.
Hence, the effect of timing issue is more 'visible'
Anyway, in short - your forcing gvfs-mount to read fstab file once again after 'final version/completion' solved the issue.