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

Unable to mount root fs since upgrading from 0.6.5.1-4-wheezy to 0.6.5.2-1-wheezy #3869

Closed
markdesouza opened this issue Oct 2, 2015 · 8 comments
Milestone

Comments

@markdesouza
Copy link

During boot, initrd stage fails with:

Command: mount_fs san-rpool/ROOT
Message:
Error: 1

Error: Failed to mount root file system 'san-rpool/ROOT'.

Note I can manually boot the system with:
mount -o zfsutil -t zfs san-rpool/ROOT /root
exit

@markdesouza
Copy link
Author

I presume this relates to #3816

@woffs
Copy link

woffs commented Oct 2, 2015

I have the same here, with 0.6.5.2. The root fs is successfully mounted, it seems to be a false error. Simply pressing ^D continues the boot process. I have set zfsdebug=1 but was not able to get through the logic of zfs-functions.sh yet.

@markdesouza
Copy link
Author

Confirmed. It script falsely reports an error... Attaching a couple screenshots from an affected server

screen shot 2015-10-02 at 8 00 02 pm

screen shot 2015-10-02 at 8 00 21 pm

@markdesouza
Copy link
Author

Digging deaper, It looks like the issue relates to mounting other zfs datasets. Changing line 815 in /etc/zfs/zfs-functions to "return 0" instead of "return 1" fixes the issue.

Note: the structure of the code means that the reported error incorrectly points the users to their being a problem mounting the root file system, as opposed to other datasets ie /var. Prob worth flagging for review

 797         zfs_action "Mounting '${fs}' on '${rootmnt}/${mountpoint}'" \
 798             "${cmd}" "${fs}" "${rootmnt}/${mountpoint}"
 799         if [ "${ZFS_ERROR}" != 0 ]
 800         then
 801                 disable_plymouth
 802                 if [ "$?" -ne "123" ]; then
 803                         echo ""
 804                         echo "Command: ${ZFS_CMD}"
 805                         echo "Message: ${ZFS_STDERR}"
 806                         echo "Error: ${ZFS_ERROR}"
 807                         echo ""
 808                         echo "Failed to mount ${fs} on ${rootmnt}/${mountpoint}."
 809                         echo "Manually mount the filesystem and exit."
 810                         emergency_shell
 811                 else
 812                         return 1
 813                 fi
 814         else
 815                 return 0
 816         fi
 817 
 818         return 0
 819 }
 820 

@FransUrbo
Copy link
Contributor

Oups! I see it! It's a patch gone wrong and the problem is "everywhere"! I'm building new packages as we speak. Should be available in an hour or so..

Thanx for the assist!

@markdesouza
Copy link
Author

Not a problem. Glad to commit back to the project.

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 2, 2015
* Apparently "var > 0" doesn't work. Use 'var -gt 0' instead. But that
  means that 'var' needs to be set, so set this to '0' if it's not already
  set at the beginning of the initrd script.
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869
FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 2, 2015
* Apparently "var > 0" doesn't work. Use 'var -gt 0' instead. But that
  means that 'var' needs to be set, so set this to '0' if it's not already
  set at the beginning of the initrd script.
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869
* Make sure we set/reset IFS when retreiving sub-filesystems in
  recursive_mount_filesystems().
@RJVB
Copy link

RJVB commented Oct 2, 2015

Heh, I see I'm not wrong in having 'held' my zfs-initramfs package ...

Still no 0.6.5.2 for Ubuntu, though ... thorough testing going on? ;)

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 2, 2015
* Apparently "var > 0" doesn't work. Use 'var -gt 0' instead. But that
  means that 'var' needs to be set, so set this to '0' if it's not already
  set at the beginning of the initrd script.
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869
* Make sure we set/reset IFS when retreiving sub-filesystems in
  recursive_mount_filesystems().
* Set and reset IFS in read_{mtab,fstab}().
@behlendorf behlendorf added this to the 0.6.5.3 milestone Oct 2, 2015
FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 4, 2015
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869

Signed-off-by: Turbo Fredriksson <[email protected]>
@FransUrbo
Copy link
Contributor

@markdesouza Since this is now fixed, can you close this?

FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 4, 2015
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869

Signed-off-by: Turbo Fredriksson <[email protected]>
FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 4, 2015
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869

Signed-off-by: Turbo Fredriksson <[email protected]>
FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 4, 2015
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869

Signed-off-by: Turbo Fredriksson <[email protected]>
FransUrbo added a commit to FransUrbo/zfs that referenced this issue Oct 8, 2015
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869

Signed-off-by: Turbo Fredriksson <[email protected]>
FransUrbo added a commit to FransUrbo/zfs that referenced this issue Jan 21, 2016
* Fixing return variable from a bunch of assist functions.
  Returned false when they should have returned true!
  Thanx to markdesouza @ GitHub for help findind this.
  Closes: openzfs#3869

Signed-off-by: Turbo Fredriksson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants