manage zfs / clones to allow use of boot environments
Boot environments for ZFS / enable storage cheap redundant copy of / directory that can quickly be rolled back or booted into, allowing toe easily test new packages.
Blueprint information
- Status:
- Not started
- Approver:
- Damian Wojsław
- Priority:
- Low
- Drafter:
- Damian Wojsław
- Direction:
- Needs approval
- Assignee:
- Damian Wojsław
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Based on illumos beadm command. Man page: https:/
Synopsis:
SYNOPSIS
beadm create [-a] [-d description]
[-e non-activeBeName | beName@snapshot]
[-o property=value] ... [-p zpool]
[-v] beName
beadm create [-v] beName@snapshot
beadm destroy [-fFsv] beName | beName@snapshot
beadm list [-a | -ds] [-H]
[-k|-K date | name | space] [-v] [beName]
beadm mount [-s ro|rw] [-v] beName mountpoint
beadm unmount [-fv] beName | mountpoint
beadm rename [-v] beName newBeName
beadm activate [-v] beName
beadm rollback [-v] beName snapshot
beadm rollback [-v] beName@snapshot
-------------------
Output from illumos beadm:
trochej@
BE Active Mountpoint Space Policy Created
openindiana NR / 2,36G static 2016-05-16 23:40
openindiana-1 - - 51,0K static 2016-05-16 23:51
-------
Steps to follow after installing rootfs in rpool/ROOT/ubuntu:
1. FS list:
root@ubuntuzfs:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 3.95G 3.74G 96K /
rpool/ROOT 2.03G 3.74G 96K none
rpool/ROOT/ubuntu 2.03G 3.74G 1.97G /
rpool/ROOT/
rpool/home 8.49M 3.74G 96K /home
rpool/home/root 124K 3.74G 124K /root
rpool/home/trochej 8.27M 3.74G 8.27M /home/trochej
rpool/swap 1.06G 4.80G 64K -
rpool/var 866M 3.74G 96K /var
rpool/var/cache 865M 3.74G 865M /var/cache
rpool/var/log 768K 3.74G 768K /var/log
rpool/var/spool 104K 3.74G 104K /var/spool
rpool/var/tmp 132K 3.74G 132K /var/tmp
2. Create a snapshot and clone:
root@ubuntuzfs:~# zfs snapshot rpool/ROOT/
root@ubuntuzfs:~# zfs clone rpool/ROOT/
root@ubuntuzfs:~# zfs set canmount=noauto rpool/ROOT/
root@ubuntuzfs:~# zfs set mountpoint=/ rpool/ROOT/
3. Added Ubuntu Clone entry to /boot/grub/
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod zfs
set root='hd0,gpt1'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root 3da0b77e44dee80b
fi
linux /ROOT/ubuntu@
initrd /ROOT/ubuntu@
}
menuentry 'Ubuntu Clone' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod zfs
set root='hd0,gpt1'
if [ x$feature_
search --no-floppy --fs-uuid --set=root --hint-
else
search --no-floppy --fs-uuid --set=root 3da0b77e44dee80b
fi
linux /ROOT/ubuntu@
initrd /ROOT/ubuntu@
}