beadm question
I haven't used beadm before. I think the concept is really cool, and it's great that you've ported it to FreeBSD! That being said, I gave it a try and ran into a few questions.. If anyone might be able to clarify a few things, that would be great!
If I start with no snapshots:
Only the default... let's say I want to install updates on my system, so I ...
So far, I think I understand. I've created a snapshot of "default" called "test". It isn't active yet, but in theory, if I activate it, and reboot, I should be using "test". If I want to go back to default, I should be able to re-activate default.
Just for (useless) fun, I create another snapshot called "test1":
In theory, test and test1, should be the same since they are both snapshots of default?
I'm fine here, until I decide to activate test1.
This output, which may very well be correct confuses me as a first time beadm user.
It's not quite clear what happens on activate. I know snapshots are read only, but I wouldn't have expected default@test or default@test1 snapshots to change -- is this correct?
Now let's say I want to go back to default -- I would imagine everything would go back to the way it was before:
That seemed okay, but ...
Hmmm still not sure I understand that output.
So let's say I want to go back to default and start again.
So I'll try running destroy again.
In fact, I can run it over and over again with the same result, but if I do:
I can see in the output:
and then after a "+ zfs promote sys/ROOT/default", I see:
and now:
The odd thing is that after, I was able to do:
I guarantee that some of this is my lack of understanding of beadm, but I suspect there's a bug hiding in there as well.
A few other minor questions:
1) How does one determine which version of beadm that they have? I downloaded mine today from SF, so I imagine it's the latest version as of today, but how do I keep track? (May I recommend a version number at the top of the script?)
2) In your instructions above, after installing FreeBSD with ZFS root, you recommend taking a snapshot. I think that's a great idea, but do I need to use zfs snapshot for that, or if I have beadm, would I just use beadm? That is, would there ever be a circumstance where I would need to take a snapshot of ROOT where beadm wouldn't be the tool to use?
Thanks for any assistance.
Jason.
I haven't used beadm before. I think the concept is really cool, and it's great that you've ported it to FreeBSD! That being said, I gave it a try and ran into a few questions.. If anyone might be able to clarify a few things, that would be great!
If I start with no snapshots:
Code:
# zfs list -t snapshot
no datasets available
# beadm list
BE Active Mountpoint Space Policy Created
default NR / 597M static 2012-05-18 07:36
Only the default... let's say I want to install updates on my system, so I ...
Code:
# beadm create test
Created successfully
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
sys/ROOT/default@test 0 - 597M -
So far, I think I understand. I've created a snapshot of "default" called "test". It isn't active yet, but in theory, if I activate it, and reboot, I should be using "test". If I want to go back to default, I should be able to re-activate default.
Code:
# beadm list
BE Active Mountpoint Space Policy Created
default NR / 597M static 2012-05-18 07:36
test - - 1K static 2012-05-22 09:49
Code:
# beadm create test1
Created successfully
In theory, test and test1, should be the same since they are both snapshots of default?
Code:
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
sys/ROOT/default@test 62.5K - 597M -
sys/ROOT/default@test1 0 - 597M -
I'm fine here, until I decide to activate test1.
Code:
# beadm activate test1
Activated successfully
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
sys/ROOT/test1@test 62.5K - 597M -
sys/ROOT/test1@test1 19K - 597M -
It's not quite clear what happens on activate. I know snapshots are read only, but I wouldn't have expected default@test or default@test1 snapshots to change -- is this correct?
Code:
# beadm list
BE Active Mountpoint Space Policy Created
default N / 0 static 2012-05-18 07:36
test - - 1K static 2012-05-22 09:49
test1 R - 597M static 2012-05-22 09:50
Now let's say I want to go back to default -- I would imagine everything would go back to the way it was before:
Code:
# beadm activate default
# beadm list
BE Active Mountpoint Space Policy Created
default NR / 0 static 2012-05-18 07:36
test - - 1K static 2012-05-22 09:49
test1 - - 597M static 2012-05-22 09:50
That seemed okay, but ...
Code:
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
sys/ROOT/test1@test 62.5K - 597M -
sys/ROOT/test1@test1 19K - 597M -
Hmmm still not sure I understand that output.
So let's say I want to go back to default and start again.
Code:
# beadm destroy test
Are you sure you want to destroy 'test'?
This action cannot be undone (y/[n]): y
Destroyed successfully
# beadm destroy test1
Are you sure you want to destroy 'test1'?
This action cannot be undone (y/[n]): y
Note: No error message, but no destroyed successfully message either.. hmm.
# beadm list
BE Active Mountpoint Space Policy Created
default NR / 97.5K static 2012-05-18 07:36
test1 - - 597M static 2012-05-22 09:50
So I'll try running destroy again.
Code:
# beadm destroy test1
Are you sure you want to destroy 'test1'?
This action cannot be undone (y/[n]): y
In fact, I can run it over and over again with the same result, but if I do:
# sh -xv beadm destroy test1
I can see in the output:
Code:
zfs promote cannot destroy \''sys/ROOT/test1'\'':' filesystem has dependent clones
and then after a "+ zfs promote sys/ROOT/default", I see:
Code:
+ echo 'Destroyed successfully'
Destroyed successfully
Code:
# beadm list
BE Active Mountpoint Space Policy Created
default NR / 597M static 2012-05-18 07:36
test1 - - 71.5K static 2012-05-22 10:25
# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
sys/ROOT/default@test1 63.5K - 597M -
Code:
# beadm destroy test1
Are you sure you want to destroy 'test1'?
This action cannot be undone (y/[n]): y
Destroyed successfully
# beadm list
BE Active Mountpoint Space Policy Created
default NR / 597M static 2012-05-18 07:36
A few other minor questions:
1) How does one determine which version of beadm that they have? I downloaded mine today from SF, so I imagine it's the latest version as of today, but how do I keep track? (May I recommend a version number at the top of the script?)
2) In your instructions above, after installing FreeBSD with ZFS root, you recommend taking a snapshot. I think that's a great idea, but do I need to use zfs snapshot for that, or if I have beadm, would I just use beadm? That is, would there ever be a circumstance where I would need to take a snapshot of ROOT where beadm wouldn't be the tool to use?
Thanks for any assistance.
Jason.