-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mount -a fails to use UUID if /proc and /sys are to be mounted #1492
Comments
Added work-arond for this problem: util-linux/util-linux#1492
I don't think so. If I remember classic init scripts then /proc and /sys are always mounted by separate mount(8) calls before The libmount uses libblkid to evaluate the tags (UUID= or LABEL=). The libblkid uses udevd symlinks in /dev/disk/by-* and if not available then it reads /sys to get a list of block devices to scan for the tags. The old versions (before v2.37) use /proc/partitions rather than /sys. Anyway, this dependence on /proc is there for more than 15 years ...
Please, use in your scripts before mount -a. Note that /proc and /sys are often already mounted in initrd. I don't see any elegant way how to improve it. It would be possible to scan all /dev and try all block devices, but it does not make sense if the kernel provides /sys with all the information. And postpone UUID= until you get /proc and /sys is against |
Addresses: #1492 Signed-off-by: Karel Zak <kzak@redhat.com>
|
Closing, not a bug. |
|
OK, thanks for you time. |
Hmm, then we actually have As you can see, /sys is mounted |
|
So to be clear: |
That's a good question. I need to test it with "LIBMOUNT_DEBUG=all LIBBLKID_DEBUG=all mount --all". |
|
I guess (not tested yet) the problem is /* ignore already mounted filesystems */
rc = mnt_context_is_fs_mounted(cxt, *fs, &mounted);
if (rc)
return rc;in libmount/src/context_mount.c:mnt_context_next_mount(). There we need to care about situations related to missing /proc or /sys and ignore 'rc' in this case. |
|
I can test the patch if you want. |
Now 'mount --all' ends with error if /proc is not mounted and there is some other entry before /proc in fstab. This commit improves this situation and ignores all mount table related errors if the table is empty. This is important for situation when there is for example "/" as the first line in fstab. Addresses: #1492 Signed-off-by: Karel Zak <kzak@redhat.com>
|
The problem should be fixed in the git "master" branch. I have tested it in chroot it works for me ;-) |
|
I applied that specific patch |
|
Well, if /proc is not mounted then the mount table is empty (in libmount). Can you try |
|
... and it would be better to try the current git, not only the patch. |
|
But /proc IS mounted, because, |
|
I probably see where is the issue. There is a cache in libblkid and it does not re-read the cache. |
For "mount --all" we need to read the cache more than once in a short time. The library checks the delay between probes, and if the delay is too short, it does not read devices. This is a problem on boot when there are no /sys, and the cache is empty. In this case, we need to check for /sys until it's available constantly. #1492 Signed-off-by: Karel Zak <kzak@redhat.com>
|
Sorry, github only posted the comment Now I tested it and it works, thank you!
OMG, nothing is deterministic |
|
Thanks for your report, test, and patience! ;-) It will be fixed in the next release. |
|
Good to know, thanks. :) |
I am using buildroot with mount from util-linux-2.37.2, libmount 2.37.2.
When my fstab contains UUIDs,
mount at boot fails to find them.
After some experimenting, it seems
that it would need /proc or /sys to
find device by UUID. And the fact
is, that exact "mount -a" at boot is
used to mount /proc and /sys.
So if they were already mounted,
then UUID look-up succeeds. If
they are to be mounted by the
same "mount -a", then UUID fails.
I don't think I've seen this problem
on earlier versions. I suspect
"mount -a" should delay the UUID/LABEL
mounts to the last step, so that
/proc and /sys are always mounted
first.
The text was updated successfully, but these errors were encountered: