Skip to content
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

FS#2214 - block-mount: wrong processing order #7371

Closed
openwrt-bot opened this issue Mar 31, 2019 · 1 comment
Closed

FS#2214 - block-mount: wrong processing order #7371

openwrt-bot opened this issue Mar 31, 2019 · 1 comment
Labels

Comments

@openwrt-bot
Copy link

moocan:

Supply the following if possible:

  • Device problem occurs on
    x86 based release
  • Software versions of OpenWrt/LEDE release, packages, etc.
    OpenWRT 18.06.2
  • Steps to reproduce

/etc/config/fstab:
config global
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'

config mount
option target '/mnt/sda1'
option uuid '57f8f4bc-abf4-655f-bf67-946fc0f9f25b'
option enabled '0'

config mount
option target '/mnt/sda2'
option uuid '57f8f4bc-abf4-655f-bf67-946fc0f9f25b'
option enabled '0'

config swap
option uuid '76a17421-4317-40d4-b62e-d6510627334e'
option label 'swap'
option enabled '1'
option device '/dev/sda4'

config mount
option uuid '84eefd86-9cd3-463a-aa70-6ac876fd4432'
option label 'home'
option device '/dev/sda5'
option fstype 'ext4'
option target '/home'
option enabled '1'
option enabled_fsck '1'
option options 'rw,sync,delalloc,block_validity'

config mount
option uuid '439af06e-a586-4ded-9ab6-7703aff9853f'
option label 'srv'
option device '/dev/sda6'
option fstype 'ext4'
option target '/srv'
option enabled '1'
option enabled_fsck '1'
option options 'rw,sync,delalloc,block_validity'

config mount
option uuid '041c1481-07b9-48ac-b89c-46da429872b9'
option label 'setup'
option device '/dev/sda7'
option fstype 'ext4'
option target '/etc/setup'
option enabled '1'
option enabled_fsck '1'
option options 'rw,sync,delalloc,block_validity'

config mount
option uuid '8c9aea45-352f-4428-8805-a69445d4b1a4'
option label 'ext'
option device '/dev/sda8'
option fstype 'ext4'
option options 'rw,sync'
option target '/srv/ext'
option enabled_fsck '1'
option enabled '0'

uci show fstab

fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@mount[0]=mount
fstab.@mount[0].target='/mnt/sda1'
fstab.@mount[0].uuid='57f8f4bc-abf4-655f-bf67-946fc0f9f25b'
fstab.@mount[0].enabled='0'
fstab.@mount[1]=mount
fstab.@mount[1].target='/mnt/sda2'
fstab.@mount[1].uuid='57f8f4bc-abf4-655f-bf67-946fc0f9f25b'
fstab.@mount[1].enabled='0'
fstab.@swap[0]=swap
fstab.@swap[0].uuid='76a17421-4317-40d4-b62e-d6510627334e'
fstab.@swap[0].label='swap'
fstab.@swap[0].enabled='1'
fstab.@swap[0].device='/dev/sda4'
fstab.@mount[2]=mount
fstab.@mount[2].uuid='84eefd86-9cd3-463a-aa70-6ac876fd4432'
fstab.@mount[2].label='home'
fstab.@mount[2].device='/dev/sda5'
fstab.@mount[2].fstype='ext4'
fstab.@mount[2].target='/home'
fstab.@mount[2].enabled='1'
fstab.@mount[2].enabled_fsck='1'
fstab.@mount[2].options='rw,sync,delalloc,block_validity'
fstab.@mount[3]=mount
fstab.@mount[3].uuid='439af06e-a586-4ded-9ab6-7703aff9853f'
fstab.@mount[3].label='srv'
fstab.@mount[3].device='/dev/sda6'
fstab.@mount[3].fstype='ext4'
fstab.@mount[3].target='/srv'
fstab.@mount[3].enabled='1'
fstab.@mount[3].enabled_fsck='1'
fstab.@mount[3].options='rw,sync,delalloc,block_validity'
fstab.@mount[4]=mount
fstab.@mount[4].uuid='041c1481-07b9-48ac-b89c-46da429872b9'
fstab.@mount[4].label='setup'
fstab.@mount[4].device='/dev/sda7'
fstab.@mount[4].fstype='ext4'
fstab.@mount[4].target='/etc/setup'
fstab.@mount[4].enabled='1'
fstab.@mount[4].enabled_fsck='1'
fstab.@mount[4].options='rw,sync,delalloc,block_validity'
fstab.@mount[5]=mount
fstab.@mount[5].uuid='8c9aea45-352f-4428-8805-a69445d4b1a4'
fstab.@mount[5].label='ext'
fstab.@mount[5].device='/dev/sda8'
fstab.@mount[5].fstype='ext4'
fstab.@mount[5].options='rw,sync'
fstab.@mount[5].target='/srv/ext'
fstab.@mount[5].enabled_fsck='1'
fstab.@mount[5].enabled='1'

/dev/sda8 => /srv/ext is mounted before /dev/sda6 => /srv

block info

/dev/sda1: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" VERSION="1.0" MOUNT="/boot" TYPE="ext4"
/dev/sda2: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" VERSION="1.0" MOUNT="/" TYPE="ext4"
/dev/sda4: UUID="76a17421-4317-40d4-b62e-d6510627334e" LABEL="swap" VERSION="1" TYPE="swap"
/dev/sda5: UUID="84eefd86-9cd3-463a-aa70-6ac876fd4432" LABEL="home" VERSION="1.0" MOUNT="/home" TYPE="ext4"
/dev/sda6: UUID="439af06e-a586-4ded-9ab6-7703aff9853f" LABEL="srv" VERSION="1.0" MOUNT="/srv" TYPE="ext4"
/dev/sda7: UUID="041c1481-07b9-48ac-b89c-46da429872b9" LABEL="setup" VERSION="1.0" MOUNT="/etc/setup" TYPE="ext4"
/dev/sda8: UUID="8c9aea45-352f-4428-8805-a69445d4b1a4" LABEL="ext" VERSION="1.0" MOUNT="/srv/ext" TYPE="ext4"

mount

/dev/root on / type ext4 (rw,noatime,block_validity,delalloc,barrier,user_xattr) proc on /proc type proc (rw,nosuid,nodev,noexec,noatime) sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime) tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime) /dev/sda1 on /boot type ext4 (rw,noatime,block_validity,delalloc,barrier,user_xattr) /dev/sda1 on /boot type ext4 (rw,noatime,block_validity,delalloc,barrier,user_xattr) tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000) /dev/sda7 on /etc/setup type ext4 (rw,sync,relatime,data=ordered) /dev/sda5 on /home type ext4 (rw,sync,relatime,data=ordered) debugfs on /sys/kernel/debug type debugfs (rw,noatime) /dev/sda8 on /srv/ext type ext4 (rw,sync,relatime,data=ordered) /dev/sda6 on /srv type ext4 (rw,sync,relatime,data=ordered)

df -h

Filesystem Size Used Available Use% Mounted on
/dev/root 7.9G 11.1M 7.8G 0% /
tmpfs 121.8M 60.0K 121.7M 0% /tmp
/dev/sda1 256.0M 3.6M 247.3M 1% /boot
/dev/sda1 256.0M 3.6M 247.3M 1% /boot
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda7 975.9M 1.3M 907.4M 0% /etc/setup
/dev/sda5 1.9G 1.5M 1.8G 0% /home
/dev/sda8 2.6G 4.1M 2.5G 0% /srv/ext
/dev/sda6 2.6G 4.1M 2.5G 0% /srv

Mounted manually with good order:
/dev/root on / type ext4 (rw,noatime,block_validity,delalloc,barrier,user_xattr)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/sda1 on /boot type ext4 (rw,noatime,block_validity,delalloc,barrier,user_xattr)
/dev/sda1 on /boot type ext4 (rw,noatime,block_validity,delalloc,barrier,user_xattr)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
/dev/sda7 on /etc/eynola type ext4 (rw,sync,relatime,data=ordered)
/dev/sda5 on /home type ext4 (rw,sync,relatime,data=ordered)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sda6 on /srv type ext4 (rw,relatime,data=ordered)
/dev/sda8 on /srv/ext type ext4 (rw,relatime,data=ordered)

Filesystem Size Used Available Use% Mounted on
/dev/root 7.9G 11.1M 7.8G 0% /
tmpfs 121.8M 64.0K 121.7M 0% /tmp
/dev/sda1 256.0M 3.6M 247.3M 1% /boot
/dev/sda1 256.0M 3.6M 247.3M 1% /boot
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda7 975.9M 1.3M 907.4M 0% /etc/eynola
/dev/sda5 1.9G 1.5M 1.8G 0% /home
/dev/sda6 2.6G 4.1M 2.5G 0% /srv
/dev/sda8 975.9M 1.3M 907.4M 0% /srv/ext

and then /dev/sda6 is available through /srv and /dev/sda8 through /srv/ext

I tried the following things in /etc/config/fstab for sda6 and sda8

only specify mount[x].uuid=
only specify mount[x].device=
only specify mount[x].label=
inverse config mount section order between sda6 and sda8

but sda8 is always mounted before sda6

In which order are processed the mount order from the /etc/config/fstab ?
It does not seems to follow the mount[$idx] order.

Kind Regards

@openwrt-bot
Copy link
Author

yousong:

The order is by strcmp on device uuid, label, path etc.

A simple improvement could be by strlen() on mount target path. I will see if it will work ;)

EDIT: the above statement is wrong. The mount order is determined by order of glob(/dev/xx*) result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant