Same partition mounted twice

Post Reply
o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Same partition mounted twice

Post by o_lampe »

Hi folks,
I frequently see the same partition appear twice on desktop. Not always the same partition, but they are mounted as /media/usbX and also as /media/odroid/PARTITIONAME.
How can I fix that? I played around with 'odroids' user rights and added it to other groups, it seems related to that issue.
double-mount.png
double-mount.png (288.93 KiB) Viewed 1511 times

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: Same partition mounted twice

Post by o_lampe »

It seems I have found a way to avoid the double mounted drives. It was by coincident,when I added 'big_writes' option to all my partitions I had to turn off the auto session defaults in 'disks'
Since then, I didn't see any dual-mounts
These users thanked the author o_lampe for the post:
odroid (Thu Mar 26, 2020 9:34 am)

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: Same partition mounted twice

Post by o_lampe »

The dual mounting error happens again.
I believe it's a fallback strategy from systemctl. Whenever an error occurs while mounting drives listed in fstab it mounts them to /media/usbX instead. 10-30sec later they can also appear with the correct mountpoint.
And that happens with locally attached drives. It gets worse with network shares, as I've seen in my remote RAM-swapfile experiment.

I started to read about systemctl services and there is a 'before/after' setting we can define. All we need to know, what other service(s) must have happened before we can mount drives? I assume, the network must be 'up', before mounting network drives (obviously). But how about local drives?

mad_ady
Posts: 8599
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 490 times
Contact:

Re: Same partition mounted twice

Post by mad_ady »

There are some systemd man pages about how it handles mounting. Basically it parses /etc/fstab and generates systemd units. There you can check how it does mointing, logs, etc.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: Same partition mounted twice

Post by o_lampe »

mad_ady wrote:
Fri Mar 27, 2020 12:30 am
There are some systemd man pages about how it handles mounting. Basically it parses /etc/fstab and generates systemd units. There you can check how it does mointing, logs, etc.
I already checked that before posting and the generated .mount files were a 1:1 copy of fstab. But still the mountpoints are sometimes different and they change from boot to boot.
When my NAS-drive is on/off before boot or when a DVD is inserted or not at boot time, there is no consistency in mounting points.
I tried to read about autofs, but the german wiki page is a pile of spaghetti. Hard to understand.

mad_ady
Posts: 8599
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 490 times
Contact:

Re: Same partition mounted twice

Post by mad_ady »

Don't read the german page. Try this instead: https://help.ubuntu.com/community/Autofs
These users thanked the author mad_ady for the post:
o_lampe (Fri Mar 27, 2020 4:50 pm)

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: Same partition mounted twice

Post by o_lampe »

I made a screenshot of the generated .mount file and the real mountpoint. media/usb2 can vary from boot to boot. Totally unpredictable.
'Sumpf' is a partition of the SSD drive, I use for booting. (boot kernel from SD card, then set 'root' to uuid of the SSD in bootargs)
Maybe that's the cause for all the trouble?
Attachments
media-usb-sumpf.png
media-usb-sumpf.png (1.09 MiB) Viewed 1243 times

mad_ady
Posts: 8599
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 490 times
Contact:

Re: Same partition mounted twice

Post by mad_ady »

Show us the output of blkid

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: Same partition mounted twice

Post by o_lampe »

Code: Select all

odroid@odroid:~$ sudo blkid
/dev/mmcblk1p1: SEC_TYPE="msdos" LABEL="BOOT" UUID="F702-39CB" TYPE="vfat" PARTUUID="03823826-01"
/dev/sda1: LABEL="swap" UUID="02076016-dbe0-41ab-8a3e-55a25f7c14be" TYPE="swap" PARTUUID="03823826-01"
/dev/sda2: LABEL="rootfs" UUID="e139ce78-9841-40fe-8823-96a304a09859" TYPE="ext4" PARTUUID="03823826-02"
/dev/sda3: LABEL="Video" UUID="02947a56-14a1-4539-86a8-8446d9a8b2ea" TYPE="ext4" PARTUUID="03823826-03"
/dev/sda5: LABEL="Sumpf" UUID="659b461f-c7de-4e36-b8ce-d1d56f952206" TYPE="ext4" PARTUUID="03823826-05"
/dev/mmcblk1: PTUUID="03823826" PTTYPE="dos"
/dev/sdb1: LABEL="NAS_1" UUID="d1ad90e5-58df-44bd-940e-e77f19aa940e" TYPE="ext4" PARTUUID="dcc6b89f-e84b-4d92-b8e2-306e583a23f7"
/dev/sdb2: LABEL="NAS_2" UUID="6BA59B08509ECB69" TYPE="ntfs" PTTYPE="dos" PARTUUID="40a688fd-0bf3-4cd6-b698-96c24697838a"
/dev/sdb3: LABEL="Backup" UUID="7F2922C20E0CBBD0" TYPE="ntfs" PTTYPE="dos" PARTUUID="79d3d0fe-d666-40fd-ae50-ae0706e9824e"
odroid@odroid:~$ 

mad_ady
Posts: 8599
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 579 times
Been thanked: 490 times
Contact:

Re: Same partition mounted twice

Post by mad_ady »

Ok, I was curious if you had duplicate uuids that may cause issues. You don't seem to have them...

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: Same partition mounted twice

Post by o_lampe »

Well, there is a duplicate partuuid shared amongst sd card boot and ssd-swap.
I'll change that and observe...

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 0 guests