F
F
fdroid2016-06-08 13:39:45
ubuntu
fdroid, 2016-06-08 13:39:45

Ubuntu Server 14.04. Why is the disk mounted twice?

Hello. There is a NAS running Ubuntu Server 14.04. Two hard drives - the main 750 Gb - mounted in /, and the second 500 Gb - mounted in /mnt/hdd500. Also, there are several more directories in /mnt, incl. /mnt/flash, which is designed to automatically mount usb devices when they are connected. For some time now, such a problem has arisen - the contents of /mnt/hdd500 are automatically mounted in /mnt/flash. Thus, a double mount occurs. I can not understand what this is connected with, I did not change the mount settings. Contents of /cat/proc/mounts

[email protected]:~$ cat /proc/mounts
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,relatime,size=1013192k,nr_inodes=214917,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
tmpfs /run tmpfs rw,nosuid,noexec,relatime,size=204644k,mode=755 0 0
/dev/disk/by-uuid/e868a187-ccd1-4e7e-bb36-bace1115ebdd / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0
none /sys/fs/cgroup tmpfs rw,relatime,size=4k,mode=755 0 0
none /sys/fs/fuse/connections fusectl rw,relatime 0 0
none /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/kernel/security securityfs rw,relatime 0 0
none /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0
none /run/shm tmpfs rw,nosuid,nodev,relatime 0 0
none /run/user tmpfs rw,nosuid,nodev,noexec,relatime,size=102400k,mode=755 0 0
none /sys/fs/pstore pstore rw,relatime 0 0
/dev/sda1 /boot ext4 rw,relatime,stripe=4,data=ordered 0 0
/dev/sdb5 /mnt/hdd500 ext4 rw,relatime,data=ordered 0 0
/dev/sdb5 /mnt/flash ext4 rw,relatime,data=ordered 0 0
systemd /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,name=systemd 0 0

fstab content:
/etc/fstab                                            874/874               100%
# /etc/fstab: static file system information.
# 
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
# 
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda6 during installation
UUID=e868a187-ccd1-4e7e-bb36-bace1115ebdd /               ext4    errors=remount
-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=509b747a-5037-4b5b-b5b2-55339c527e3d /boot           ext4    defaults
  0       2
# /mnt/hdd500 was on /dev/sdb5 during installation
UUID=024cc84d-ecec-4ce9-9515-c5594b882cac /mnt/hdd500     ext4    defaults
  0       2
# swap was on /dev/sda5 during installation
UUID=a6a90573-34bc-442c-ae78-56d0ce23ee18 none            swap    sw
  0       0

Trying to unmount /mnt/flash
[email protected]:~$ umount /dev/sdb5 /mnt/flash
umount: похоже, что /dev/sdb5 примонтирован несколько раз

When connecting, for example, a flash drive, it is perfectly mounted in /mnt/flash, when it is disconnected, /mnt/hd500 is immediately mounted in /mnt/flash. How can this situation be resolved?
upd: It was possible to unmount as root.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Nikulin, 2016-06-09
@fdroid

Good afternoon!
Try checking the UDEV rules in
/etc/udev/rules.d
Look for something with a name that includes "automount", although it can be called anything...
Look for lines like this:
SUBSYSTEM=="block", KERNEL=="sd *", ACTION=="add", RUN+="/bin/mount /dev/sdb5 /mnt/flash/"
SUBSYSTEM=="block", KERNEL=="sd*", ACTION=="remove", RUN+ ="/bin/umount /mnt/flash"
It is possible that /dev/sdb5 is defined as removable and automounting occurs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question