Confused with Boot Environments: clone or create ?

Joined
Nov 11, 2014
Messages
1,174
What I my trying to do is:
1. make fresh install configure everything on freenas the point before pool creation
2. then make a clean pristine snapshot
3. then add drives , pool , ftp services , etc.

Now I already did step 1, but I am confused should I make "clone" of the "default" which is active right now, or should I just go and "create" another one ? I don't will it make any difference between "create" new environment or clone "default" environment ?!

Which is the proper way to save my install progress to pristine environment I can go back later if I decide to re-purpose for different use with different pools ?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
clone "default" environment ?!
If you want to make a snapshot of where you are, you would make a clone. Be sure to give it a name so you will know what state it is in.
 
Joined
Nov 11, 2014
Messages
1,174
If you want to make a snapshot of where you are, you would make a clone. Be sure to give it a name so you will know what state it is in.

So I should select default (which is active) boot environment and make "clone" with different name ?

What I did was, I didn't select anything, I went and press "create" boot environment and gave it a name. So that was wrong and I should just delete it ? I wonder what that does, compared to what you describe I should of done ?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
What I did was, I didn't select anything, I went and press "create" boot environment and gave it a name. So that was wrong and I should just delete it ?
Yes. That one probably won't be valid.
I wonder what that does, compared to what you describe I should have done ?
I am not sure, but I know what the clone does, because I have used that.
So I should select default (which is active) boot environment and make "clone" with different name
Correct.
 
Joined
Nov 11, 2014
Messages
1,174
Thank you very much @Chris Moore.
I'll make a clone of the default with different name (default-clean) then and till something happens I'll keep running the default.

When I want to go back. Then I assume: I select "default-clean" to be active on next boot, reboot, and then delete old "default" and create a new clone of "default-clean" which I call back "default", then select the new clone "default" to be active on next reboot and I am good ?

I will still have the untouched "default-clean" I can use for new clones if I need to go back to pristine ?
 
Joined
Nov 11, 2014
Messages
1,174
In a mean time I still would like to know, if somebody can tell me what is the difference between "create" and "clone" ?
 

Attachments

  • bootenv.PNG
    bootenv.PNG
    51.3 KB · Views: 276

toadman

Guru
Joined
Jun 4, 2013
Messages
619
What did the freenas documentation say was the difference?

Although to me it wasn't really all that clear. Clone seems obvious. Create didn't. When I click it I am asked for a name, which I assume is a dataset name. And the action appears to create a dataset. I'm not sure what's in it. I assume I would have to populate the boot environment with whatever I wanted to run at boot. i.e. "Create" does what it says, which is create a boot environment which can then be booted into if selected.

http://doc.freenas.org/11/system.html#boot
 
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
With clone, you can make as many copies as you want to, whenever you want.
Name them what you want and then select which one you want to boot into.

Sent from my SAMSUNG-SGH-I537 using Tapatalk
 
Joined
Nov 11, 2014
Messages
1,174
What did the freenas documentation say was the difference?

Although to me it wasn't really all that clear. Clone seems obvious. Create didn't. When I click it I am asked for a name, which I assume is a dataset name. And the action appears to create a dataset. I'm not sure what's in it. I assume I would have to populate the boot environment with whatever I wanted to run at boot. i.e. "Create" does what it says, which is create a boot environment which can then be booted into if selected.

http://doc.freenas.org/11/system.html#boot

It doesn't say . My screenshot was from the documentation. I even went to look documentation from 9.3 to 11.x just to see if I can find a little bit more info, but it was all the same on this topic across all versions.

By the way I don't think boot environments has something to do with datasets I think it has more to do with a snapshots. I am not sure, I wish I could know more. Documentation has never been freenas strongest side, but this forum has been providing great support (from the freenas community) and I got a lot of help here over the years. So that's the good side, if you can't find info from the people who create it , perhaps an community expert would know and help.

I will use clone for now, as you said "Clone seems obvious." to what is does, but I still would like to know one day what "create" does ?


P.S. Just to elaborate on your idea ""Create" does what it says, which is create a boot environment" I then ask out of what ? Out of thin air ? What you suppose to find when you boot in that environment ? Clone of the last active one when create was made ? In this case why would they go through the effort to make this "create" button if is the same thing as "clone" ?!?!?
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I think it has more to do with a snapshots.
Exactly. When you make a 'clone' you are making a snapshot of the current condition of the Boot Volume and you can make several because the first one consumes space on disk the clones only consume the space required for the difference between the clone and the original. When you select one of the clones to be active on next boot, boot into it and make changes, those changes consume space on disk that is associated with that snapshot. When you delete a clone, it just deletes the snapshot and the associated changes. All the boot environments (as I understand it) are basically just snapshots because you can roll back to a previous boot environment at any time.

I am sure someone will correct me if I am wrong on this. I have been mistaken in my understanding or unclear in my explanations before, so I give no warranty on the preceding explanation.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Clone of the last active one when create was made ? In this case why would they go through the effort to make this "create" button if is the same thing as "clone" ?!?!?
I think that "Create" does make a "Clone" of the active environment. With "Clone", you select any environment in the list and make a copy of it. I have 12 boot environments in the list right now, dating all the way back to 2016, which is the last time I went through and deleted the old environments. I just have not worried about it since then. I used to periodically delete the old ones, but I don't bother with it any more.
boot.PNG
 
Joined
Nov 11, 2014
Messages
1,174
I think that "Create" does make a "Clone" of the active environment. With "Clone", you select any environment in the list and make a copy of it.

This is exactly how I would interpret it logically. So following that logic then, if you want to make a copy(clone) of the active environment running at the moment it will make no difference if you press "create" button, of if you select the active environment and press "clone" , right ?

I wish I knew what the creators had in mine ? Did they made an extra effort to make function that is redundant and not necessary ?


P.S. I am trying to learn the boot environments ,not because I do upgrades and worry about something go wrong, but because I have this idea to using the same freenas for totally different purposes, just by selecting other environment, power down, swap hdd and boot in to complete different purpose freenas machine. And if you need to use the other one, you select other boot environment, power down, put other drives back ,and power back on. This might sounds confusing , but I kind of tested before and find it very cool.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I wish I knew what the creators had in mine ?
There are some features that have been around for a long time (this is one) and when it was created, it must have made sense. Maybe not as much now.
This might sounds confusing , but I kind of tested before and find it very cool.
Sounds like it should work. Good luck
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Yea, my mistake. I meant "snapshot" vs "dataset." Thanks for correcting that point. :)

However, datasets come into play. When you clone a snapshot it creates a new dataset. So we have to have datasets in the freenas-boot pool. For example, on my system I have the following output:
Code:
17:14:28 [root@fileserver ~]$ zfs list
NAME													 USED  AVAIL  REFER  MOUNTPOINT
freenas-boot											1.62G  6.07G	31K  none
freenas-boot/ROOT									   1.44G  6.07G	25K  none
freenas-boot/ROOT/11.0-U3								 61K  6.07G   751M  /
freenas-boot/ROOT/11.0-U4							   1.44G  6.07G   753M  /
freenas-boot/grub										166M  6.07G  6.84M  legacy
...{list of datasets from my other pool}...


If I now issue a "Clone" for 11.0-U4 and call it "11.0-U4-Clone" and also issue a "Create" and call it "created-via-create-button" I get:

Code:
17:17:21 [root@fileserver ~]$ zfs list
NAME													 USED  AVAIL  REFER  MOUNTPOINT
freenas-boot											1.62G  6.07G	31K  none
freenas-boot/ROOT									   1.44G  6.07G	25K  none
freenas-boot/ROOT/11.0-U3								 61K  6.07G   751M  /
freenas-boot/ROOT/11.0-U4							   1.44G  6.07G   753M  /
freenas-boot/ROOT/11.0-U4-Clone							1K  6.07G   753M  /
freenas-boot/ROOT/created-via-create-button				1K  6.07G   753M  /
freenas-boot/grub										166M  6.07G  6.84M  legacy
...{list of datasets from my other pool}...


The question now becomes, "what is the difference between those?" I have to go back and look how to get into the freenas-boot datasets and poke around.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
BTW, if I go look at the snapshots on the current environment I get the following:

Code:
17:27:21 [root@fileserver /.zfs/snapshot]$ ls -al
total 32
dr-xr-xr-x   5 root  wheel   5 Feb 17 17:21 .
dr-xr-xr-x   3 root  wheel   3 May  8  2015 ..
drwxr-xr-x  20 root  wheel  28 Sep  7 11:22 2017-09-26-12:22:07
drwxr-xr-x  20 root  wheel  27 Jan 25 12:47 2018-02-17-17:21:06
drwxr-xr-x  20 root  wheel  27 Feb 17 17:21 2018-02-17-17:21:33


Note that the last two are labeled from today, corresponding to the Clone and the Create. But the file dates are different. One, Jan 25 must be what was Cloned (as I did that first) and the latter is the Create which has a file date of today.
 
Joined
Nov 11, 2014
Messages
1,174
Sounds like it should work. Good luck

Yeah I think so. As long as you don't forget to swap the drives when you switch the proper boot environment for them, then everything should be there , you pool, your share, your services /ftp/nfs/smb all there like nothing ever happened.

This way you could have this small 4 bay freenas to be dvr/backup nas. It will work 24h as DVR recorder for ip cameras, but when I am home I don't mine turn if off hour or two and use it for something else. Like use it as cold storage zfs pool with another 4 drives , that will normally be won't be used , but just fo the moment I could turn off the DVR, and swap drives , and boot in other envoroment all set for them as cold storage. Add some data, perhaps to a scrub, and then, power down(and select dvr enviroment) add back the dvr hdd and continue to record as DVR like nothing happened. I am sharing this cause I find this idea cool , for somebody who can use it.



P.S. This is when you have a bunch of old drives you have no use for , and you could use them as cold storage and in a same time you don't what to build a whole new freenas system for them , just cause you might need to access them ones a year or less.
 
Joined
Nov 11, 2014
Messages
1,174
BTW, if I go look at the snapshots on the current environment I get the following:

Code:
17:27:21 [root@fileserver /.zfs/snapshot]$ ls -al
total 32
dr-xr-xr-x   5 root  wheel   5 Feb 17 17:21 .
dr-xr-xr-x   3 root  wheel   3 May  8  2015 ..
drwxr-xr-x  20 root  wheel  28 Sep  7 11:22 2017-09-26-12:22:07
drwxr-xr-x  20 root  wheel  27 Jan 25 12:47 2018-02-17-17:21:06
drwxr-xr-x  20 root  wheel  27 Feb 17 17:21 2018-02-17-17:21:33


Note that the last two are labeled from today, corresponding to the Clone and the Create. But the file dates are different. One, Jan 25 must be what was Cloned (as I did that first) and the latter is the Create which has a file date of today.

So here they all look the same cause they all are snapshots after all.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Yep, but the contents are different. Exactly how I don't know. So I still don't know what "Create" does exactly.
 
Joined
Nov 11, 2014
Messages
1,174
Yea, my mistake. I meant "snapshot" vs "dataset." Thanks for correcting that point. :)

However, datasets come into play. When you clone a snapshot it creates a new dataset. So we have to have datasets in the freenas-boot pool. For example, on my system I have the following output:
Code:
17:14:28 [root@fileserver ~]$ zfs list
NAME													 USED  AVAIL  REFER  MOUNTPOINT
freenas-boot											1.62G  6.07G	31K  none
freenas-boot/ROOT									   1.44G  6.07G	25K  none
freenas-boot/ROOT/11.0-U3								 61K  6.07G   751M  /
freenas-boot/ROOT/11.0-U4							   1.44G  6.07G   753M  /
freenas-boot/grub										166M  6.07G  6.84M  legacy
...{list of datasets from my other pool}...


If I now issue a "Clone" for 11.0-U4 and call it "11.0-U4-Clone" and also issue a "Create" and call it "created-via-create-button" I get:

Code:
17:17:21 [root@fileserver ~]$ zfs list
NAME													 USED  AVAIL  REFER  MOUNTPOINT
freenas-boot											1.62G  6.07G	31K  none
freenas-boot/ROOT									   1.44G  6.07G	25K  none
freenas-boot/ROOT/11.0-U3								 61K  6.07G   751M  /
freenas-boot/ROOT/11.0-U4							   1.44G  6.07G   753M  /
freenas-boot/ROOT/11.0-U4-Clone							1K  6.07G   753M  /
freenas-boot/ROOT/created-via-create-button				1K  6.07G   753M  /
freenas-boot/grub										166M  6.07G  6.84M  legacy
...{list of datasets from my other pool}...


The question now becomes, "what is the difference between those?" I have to go back and look how to get into the freenas-boot datasets and poke around.

But here you say, you made a "clone" from gui ,and is registered as "created-via-create-button" in datasets listing ?!


This definitely don't untangle the issue, quite the opposite.:smile:
 
Joined
Nov 11, 2014
Messages
1,174
I am at least glad that I am not alone in this confusion !:smile:
 
Top