Skip to content

Instantly share code, notes, and snippets.

@matias-pizarro
Created October 29, 2016 20:01
Show Gist options
  • Save matias-pizarro/fa7347c04e7a6082a9c285ea77dc5124 to your computer and use it in GitHub Desktop.
Save matias-pizarro/fa7347c04e7a6082a9c285ea77dc5124 to your computer and use it in GitHub Desktop.
Mount a BE filesystem temporarily

find out which are the BE filesystems:

$ zfs list
NAME                                        USED  AVAIL  REFER  MOUNTPOINT
tank                                       59.2G   840G    88K  none
tank/ROOT                                  16.5G   840G    88K  none
tank/ROOT/11.0-RC3                            8K   840G  3.66G  /
tank/ROOT/12.0-CURRENT-up-20161003_121021  60.6M   840G  7.08G  /
tank/ROOT/12.0-CURRENT-up-20161006_054232  12.0G   840G  9.97G  /
tank/ROOT/12.0-CURRENT-up-20161017_004530  4.43G   840G  9.04G  /

Let's say I want to mount the following BE -> 12.0-CURRENT-up-20161003_121021 First I change the mountpoint:

$ sudo zfs set mountpoint=/mnt tank/ROOT/12.0-CURRENT-up-20161003_121021
$ zfs list tank/ROOT/12.0-CURRENT-up-20161003_121021
NAME                                        USED  AVAIL  REFER  MOUNTPOINT
tank/ROOT/12.0-CURRENT-up-20161003_121021  60.6M   840G  7.08G  /mnt

I can now mount the BE filesystem:

$ sudo zfs mount tank/ROOT/12.0-CURRENT-up-20161003_121021

Once I have done what I needed to do, I unmount the filesystem and restore the original mnountpoint:

$ sudo zfs unmount tank/ROOT/12.0-CURRENT-up-20161003_121021
$ sudo zfs set mountpoint=/ tank/ROOT/12.0-CURRENT-up-20161003_121021

Just be careful not to set the mountpoint before unmounting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment