Project

General

Profile

Bug #36118

Add support to boot from dataset with a colon in its name

Added by Bonnie Follweiler over 1 year ago. Updated over 1 year ago.

Status:
Done
Priority:
No priority
Assignee:
Alexander Motin
Category:
OS
Target version:
Seen in:
Severity:
High
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

Rolled my FreeNAS 11.2-INTERNAL9 back to a previous non-internal release and now I am getting a "can't load 'kernel' and it's stuck there
(screenshot Provided)

cant load kernel.jpg (103 KB) cant load kernel.jpg Bonnie Follweiler, 06/28/2018 07:32 AM
Screen Shot 2018-06-28 at 10.53.25 AM.png (78.7 KB) Screen Shot 2018-06-28 at 10.53.25 AM.png Bonnie Follweiler, 06/28/2018 08:01 AM
Screen Shot 2018-06-28 at 11.00.30 AM.png (75.9 KB) Screen Shot 2018-06-28 at 11.00.30 AM.png Bonnie Follweiler, 06/28/2018 08:01 AM
Screen Shot 2018-06-28 at 11.14.41 AM.png (76.2 KB) Screen Shot 2018-06-28 at 11.14.41 AM.png Bonnie Follweiler, 06/28/2018 08:18 AM
kernal again.jpg (94.6 KB) kernal again.jpg Bonnie Follweiler, 06/28/2018 08:20 AM
Screen Shot 2018-07-02 at 5.15.40 PM.png (65.7 KB) Screen Shot 2018-07-02 at 5.15.40 PM.png Bonnie Follweiler, 07/02/2018 02:47 PM
Screen Shot 2018-07-02 at 5.21.53 PM.png (76.6 KB) Screen Shot 2018-07-02 at 5.21.53 PM.png Bonnie Follweiler, 07/02/2018 02:48 PM
Screen Shot 2018-07-02 at 5.32.03 PM.png (95 KB) Screen Shot 2018-07-02 at 5.32.03 PM.png Bonnie Follweiler, 07/02/2018 02:48 PM
Screen Shot 2018-07-02 at 5.33.24 PM.png (96.3 KB) Screen Shot 2018-07-02 at 5.33.24 PM.png Bonnie Follweiler, 07/02/2018 02:48 PM
can_t load Kernal.jpg (122 KB) can_t load Kernal.jpg Bonnie Follweiler, 07/02/2018 02:49 PM
19788
19793
19798
19803
19808
20153
20158
20163
20168
20173

Associated revisions

Revision 89a802c2 (diff)
Added by Alexander Motin over 1 year ago

Split path in currdev variable by the last colon, not the second. If boot environment name includes colon in its name (like time), then this code will interpret it as separator and won't be able to find a dataset by the incomplete name to load the kernel from. This change is based on assumption that path is almost never really used there, and even if used, there are rarely colons in it. Ticket: #36118

Revision dfedfe49 (diff)
Added by William Grzybowski over 1 year ago

feat(migrations): rename BEs with ":" in the name Ticket: #36118

Revision 9011136d (diff)
Added by William Grzybowski over 1 year ago

feat(migrations): rename BEs with ":" in the name Ticket: #36118

Revision 57f3e087 (diff)
Added by William Grzybowski over 1 year ago

feat(migration): use beadm list -H Ticket: #36118

Revision d4f2548f (diff)
Added by William Grzybowski over 1 year ago

feat(migrations): rename BEs with ":" in the name Ticket: #36118

Revision ddcacefc (diff)
Added by William Grzybowski over 1 year ago

feat(migration): use beadm list -H Ticket: #36118

Revision bebed582 (diff)
Added by William Grzybowski over 1 year ago

fix(migration): skip migration on fresh install Ticket: #36118

Revision ce5d23c1 (diff)
Added by William Grzybowski over 1 year ago

fix(migration): skip migration on fresh install Ticket: #36118

History

#1 Updated by Bonnie Follweiler over 1 year ago

  • Assignee changed from William Grzybowski to Alexander Motin

#3 Updated by Bonnie Follweiler over 1 year ago

19793
19798

From Internal9 to Initial-Install is working

I will now try booting into Internal9 and then rolling back to the Wizard BE

#4 Updated by Bonnie Follweiler over 1 year ago

19803
19808

Cloned Internal9 and renamed it Internal:9 and it wont load
(screenshots provided)

#5 Updated by Bonnie Follweiler over 1 year ago

  • Subject changed from Rolled my FreeNAS 11.2-INTERNAL9 back to a previous version and now I am getting a "can't load 'kernel' and it's stuck there to Rolled my FreeNAS 11.2-INTERNAL9 back to a previous version that has : in it's name and now I am getting a "can't load 'kernel' and it's stuck there

#6 Updated by Alexander Motin over 1 year ago

  • Subject changed from Rolled my FreeNAS 11.2-INTERNAL9 back to a previous version that has : in it's name and now I am getting a "can't load 'kernel' and it's stuck there to bsdloader fails to boot from dataset with ":" in its name
  • Status changed from Unscreened to Screened

The problem is that ":" is used as a field separator in currdev and bootdev loader variables, and the code just takes the first ":" when parses them, after which it just can't find the dataset with the truncated name.

#7 Updated by Dru Lavigne over 1 year ago

  • Target version changed from Backlog to 11.2-BETA1

#9 Updated by Alexander Motin over 1 year ago

  • Status changed from Screened to In Progress
  • Target version changed from 11.2-BETA1 to Backlog

This PR fixes the issue for newly installed boot environments: https://github.com/freenas/os/pull/125 .

Unfortunately there is still a problem with old BEs, if they are activated via WebUI or beadm. Since zfsloader is loaded from the active BE, if old one is activated and it has a colon in its name -- it won't be able to boot. I have no better idea then cycle through all of them during install/update and update /boot/zfsloader on each.

#10 Updated by Alexander Motin over 1 year ago

Sorry, I've changed it to Backlog by mistake. It should still probably be BETA1, just needs more work.

#11 Updated by Dru Lavigne over 1 year ago

  • Target version changed from Backlog to 11.2-BETA1
  • Severity changed from New to High

#12 Updated by Dru Lavigne over 1 year ago

  • Status changed from In Progress to Ready for Testing
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#13 Updated by Alexander Motin over 1 year ago

We could actually merge it down to 11.1-U6. It is irrelevant to GRUB-based versions directly, but may help with booting old BEs after updating to 11.2 and GRUB removal.

#14 Updated by Dru Lavigne over 1 year ago

  • Subject changed from bsdloader fails to boot from dataset with ":" in its name to Add support to boot from dataset with a colon in its name

#15 Updated by Bonnie Follweiler over 1 year ago

Waiting for Internal14, failed in Internal13

#18 Updated by Bonnie Follweiler over 1 year ago

  • Status changed from Failed Testing to Ready for Testing

Going forward, any boot environment with a colon will work. past boot environments couldn't be fixed. If a person wants to use a boot environment with a : in it they will have to clone the BE and make sure the name of the clone does not have colons in it or they wont be able to use the BE with a colon in it.
I will re-test tomorrow morning and update

#19 Updated by Bonnie Follweiler over 1 year ago

Please note:
I tried renaming a BE with a colon to remove the colon's - it resulted in the same failure.

My next step was to "clean installed" FreeNAS 11.1-u4, run the wizard to create a BE with a colon in it, upgraded to FreeNAS 11.1-U5, and then rolled back to the wizard BE. that was successful.

I upgraded to FreeNAS 11.2Internal14, ran the wizard to create s BE with colons, cloned the upgraded Internal and rolled it forward to the clone. I rolled to and fron the one with the colon to the Intenal14 with no issues

#20 Updated by Bonnie Follweiler over 1 year ago

  • Status changed from Ready for Testing to Failed Testing

#21 Updated by Alexander Motin over 1 year ago

BEs in FreeNAS have not only real names, but also a nicknames, which I guess may be used for UI renaming, while real BE name with colon persist and boot will probably still fail. Middleware team should probably know it better. That I guess explain the persistence of the problem after rename.

#22 Updated by William Grzybowski over 1 year ago

Alexander Motin wrote:

BEs in FreeNAS have not only real names, but also a nicknames, which I guess may be used for UI renaming, while real BE name with colon persist and boot will probably still fail. Middleware team should probably know it better. That I guess explain the persistence of the problem after rename.

In middleware we use the RenameClone method from sefpkg. I dont know what it does under the hood but I believe it indeed only changes the nickname, not dataset name. I suppose there is a reason for that (perhaps because the loader inside each BE will have to be changed to catch up the dataset rename?)

#23 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year ago

Using the beadm command without the -n flag should do a rename of the dataset itself, not the nickname.

beadm rename [-n] <origBeName> <newBeName>

#24 Updated by Alexander Motin over 1 year ago

William Grzybowski wrote:

I suppose there is a reason for that (perhaps because the loader inside each BE will have to be changed to catch up the dataset rename?)

bsdloader unlike GRUB has no config, so it does not care much about rename, it populates the list of BEs for menu dynamically (and I guess I has no idea about nicknames). The only thing that may need to be updated during rename is bootfs pool property. Also I suppose there may be problem to rename current BE, that is possibly why nicknames were introduced.

#25 Updated by William Grzybowski over 1 year ago

Alexander Motin wrote:

William Grzybowski wrote:

I suppose there is a reason for that (perhaps because the loader inside each BE will have to be changed to catch up the dataset rename?)

bsdloader unlike GRUB has no config, so it does not care much about rename, it populates the list of BEs for menu dynamically (and I guess I has no idea about nicknames). The only thing that may need to be updated during rename is bootfs pool property. Also I suppose there may be problem to rename current BE, that is possibly why nicknames were introduced.

That might be another issue then, rename in beadm only changes nickname, and bsdloader uses realname only?

#26 Updated by Alexander Motin over 1 year ago

William Grzybowski wrote:

Alexander Motin wrote:

William Grzybowski wrote:

I suppose there is a reason for that (perhaps because the loader inside each BE will have to be changed to catch up the dataset rename?)

bsdloader unlike GRUB has no config, so it does not care much about rename, it populates the list of BEs for menu dynamically (and I guess I has no idea about nicknames). The only thing that may need to be updated during rename is bootfs pool property. Also I suppose there may be problem to rename current BE, that is possibly why nicknames were introduced.

That might be another issue then, rename in beadm only changes nickname, and bsdloader uses realname only?

It seems beadm FreeNAS includes is different from FreeBSD one, which has no concept of nicknames. Not sure that is a big problem, but yes, it is an inconsistency.

#27 Updated by William Grzybowski over 1 year ago

Alexander Motin wrote:

William Grzybowski wrote:

Alexander Motin wrote:

William Grzybowski wrote:

I suppose there is a reason for that (perhaps because the loader inside each BE will have to be changed to catch up the dataset rename?)

bsdloader unlike GRUB has no config, so it does not care much about rename, it populates the list of BEs for menu dynamically (and I guess I has no idea about nicknames). The only thing that may need to be updated during rename is bootfs pool property. Also I suppose there may be problem to rename current BE, that is possibly why nicknames were introduced.

That might be another issue then, rename in beadm only changes nickname, and bsdloader uses realname only?

It seems beadm FreeNAS includes is different from FreeBSD one, which has no concept of nicknames. Not sure that is a big problem, but yes, it is an inconsistency.

This is literally making rename a no-op for BE selection, not really an inconsistency.
Perhaps we should rename the BEs using the nickname?
Or add support to show nickname in loader? What is best?

#29 Updated by Alexander Motin over 1 year ago

I don't know the whole motivation for the nicknames, guess it was added to overcome limitations of rename, like renaming of current BE (which seems actually possible now with new `-u` flag), and may be some limitations of used symbols. I'd propose nicknames could be used only when they are needed to not have two different names for BE in cases where it is not needed.

I don't very like idea of adding that to loader, since the nicknames are not even present in FreeBSD's beadm. Guess it may be TrueOS or FreeNAS specific feature.

#30 Updated by Sean Fagan over 1 year ago

Yes, that's why they were added. I don't think this is a necessary feature to add.

The ability to do live updates never worked out in practice, since the build was non-reproducible, and so the nicknames were never a necessary feature.

#31 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year ago

I'm perfectly happy having Nicknames get removed. That was a JKH request (If I recall correctly). In 11.2 and later we can revert back to the standard beadm from FreeBSD. We don't even use the nickname version on TrueOS. (I never liked them either)

#32 Updated by William Grzybowski over 1 year ago

  • Status changed from Failed Testing to Ready for Testing

#33 Updated by Vladimir Vinogradenko over 1 year ago

  • Status changed from Ready for Testing to In Progress

#34 Updated by William Grzybowski over 1 year ago

  • Status changed from In Progress to Ready for Testing

#37 Updated by Bonnie Follweiler over 1 year ago

  • Status changed from Ready for Testing to Passed Testing
  • Needs QA changed from Yes to No

#39 Updated by Dru Lavigne over 1 year ago

  • Status changed from Passed Testing to Done

Also available in: Atom PDF