Bug 214898 - mount -a will remount a partition if it's a ramdisk by incrementing mdX
Summary: mount -a will remount a partition if it's a ramdisk by incrementing mdX
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.3-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-11-28 09:12 UTC by Bjorn Robertsson
Modified: 2016-11-28 19:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjorn Robertsson 2016-11-28 09:12:55 UTC
Before mount -a:

/var/run and /tmp are mounted as ramdisk:
md                      /tmp            mfs     rw,-s512M,noatime        0       0
md                      /var/run        mfs     rw,-s32M,noatime        0       0

df -h |grep md
/dev/md0 on /tmp (ufs, local, noatime, soft-updates)
/dev/md1 on /var/run (ufs, local, noatime, soft-updates)

After mount -a:
df -h |grep md
/dev/md0              496M     52K    456M     0%    /tmp
/dev/md1               31M    128K     28M     0%    /var/run
/dev/md2              496M    8,0K    456M     0%    /tmp
/dev/md3               31M    8,0K     28M     0%    /var/run

Executing commands in /usr/local/bin will now fail:
# bash
Shared object "libintl.so.8" not found, required by "bash"

Does not happen on FreeBSD 10.2, will also happen on FreeBSD 11.0-RELEASE

Affects:
11.0-RELEASE-p3
10.3-RELEASE-p12

Temporary resolution: umount the filesystems and for /var/run, execute: ldconfig /usr/local/lib

This does not happen when the md devices are explicitly named in fstab:
md0                      /tmp            mfs     rw,-s512M,noatime        0       0
md1                      /var/run        mfs     rw,-s32M,noatime        0       0

But mount -a returns:
mount -a
mount_mfs: mdconfig (attach) exited with error code 1
mount_mfs: mdconfig (attach) exited with error code 1

According to the man page:
     # UFS file system on a swap-backed md(4).  /dev/md10 is
     # automatically created.  If it is "md", a unit number
     # will be automatically selected.
     md10            /scratch        mfs     rw,-s1g         0       0

But at some time, after 10.3-RELEASE it will not re-use, but create new md devices?